From ee9748eee0d05178effcdd0a40702615a4ac461a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Sat, 24 Dec 2011 11:09:48 +0100 Subject: [PATCH] pq: rename PatchQueue to PatchSeries since this models a quilt patch series --- gbp/pq.py | 38 +++++++++++++++++++------------------- gbp/scripts/pq.py | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gbp/pq.py b/gbp/pq.py index 9ffe77a..0012799 100644 --- a/gbp/pq.py +++ b/gbp/pq.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -"""Handle patches and patch queues""" +"""Handle Patches and Patch Series""" import os import re @@ -22,7 +22,7 @@ from errors import GbpError class Patch(object): """ - A patch in a L{PatchQueue} + A patch in a L{PatchSeries} @ivar path: path to the patch @type path: string @@ -39,16 +39,16 @@ class Patch(object): def __repr__(self): repr = ">> PatchQueue._read_series(['a/b', \ + >>> PatchSeries._read_series(['a/b', \ 'a -p1', \ 'a/b -p2'], '.') # doctest:+NORMALIZE_WHITESPACE [, , ] - >>> PatchQueue._read_series(['# foo', 'a/b', '', '# bar'], '.') + >>> PatchSeries._read_series(['# foo', 'a/b', '', '# bar'], '.') [] @param series: series of patches in quilt format @@ -89,7 +89,7 @@ class PatchQueue(list): @type patch_dir: string """ - queue = PatchQueue() + queue = PatchSeries() for line in series: try: if line[0] in [ '\n', '#' ]: @@ -102,12 +102,12 @@ class PatchQueue(list): @staticmethod def _get_topic(line): """ - Get the topic from the path's path + Get the topic from the patch's path - >>> PatchQueue._get_topic("a/b c") + >>> PatchSeries._get_topic("a/b c") 'a' - >>> PatchQueue._get_topic("asdf") - >>> PatchQueue._get_topic("/asdf") + >>> PatchSeries._get_topic("asdf") + >>> PatchSeries._get_topic("/asdf") """ topic = os.path.dirname(line) if topic in [ '', '/' ]: @@ -119,11 +119,11 @@ class PatchQueue(list): """ Separate the -p option from the patch name - >>> PatchQueue._split_strip("asdf -p1") + >>> PatchSeries._split_strip("asdf -p1") ('asdf', 1) - >>> PatchQueue._split_strip("a/nice/patch") + >>> PatchSeries._split_strip("a/nice/patch") ('a/nice/patch', None) - >>> PatchQueue._split_strip("asdf foo") + >>> PatchSeries._split_strip("asdf foo") ('asdf foo', None) """ patch = line @@ -141,11 +141,11 @@ class PatchQueue(list): @classmethod def _parse_line(klass, line, patch_dir): """ - Parse a single line from a patch file + Parse a single line from a series file - >>> PatchQueue._parse_line("a/b -p1", '/tmp/patches') + >>> PatchSeries._parse_line("a/b -p1", '/tmp/patches') - >>> PatchQueue._parse_line("a/b", '.') + >>> PatchSeries._parse_line("a/b", '.') """ line = line.rstrip() diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index e8e9497..4dee07c 100644 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -30,7 +30,7 @@ from gbp.command_wrappers import (Command, GitCommand, RunAtCommand, CommandExecFailed) from gbp.errors import GbpError import gbp.log -from gbp.pq import PatchQueue +from gbp.pq import PatchSeries PQ_BRANCH_PREFIX = "patch-queue/" PATCH_DIR = "debian/patches/" @@ -221,7 +221,7 @@ def import_quilt_patches(repo, branch, series, tries, force): if len(commits) > 1: tmpdir, series = safe_patches(series) - queue = PatchQueue.read_series_file(series) + queue = PatchSeries.read_series_file(series) for commit in commits: try: gbp.log.info("Trying to apply patches at '%s'" % commit) -- 2.7.4