summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-03-21 14:20:50 +0100
committerGuido Günther <agx@sigxcpu.org>2011-04-17 16:04:10 +0200
commit002d4ce2cc346cacff9daaa69caeded64e16bf1e (patch)
treebd2299f6541bb5a68182744b28b57746c0e26833
parent5f8460017389a3829e45bbf4f6d93871f030bdd1 (diff)
gbp-pq: add some simple doctests
Git-Dch: Ignore
-rwxr-xr-xgbp-pq23
1 files changed, 21 insertions, 2 deletions
diff --git a/gbp-pq b/gbp-pq
index 7c83a88c..fffed6fa 100755
--- a/gbp-pq
+++ b/gbp-pq
@@ -36,16 +36,35 @@ PATCH_DIR = "debian/patches/"
SERIES_FILE = os.path.join(PATCH_DIR,"series")
def is_pq_branch(branch):
+ """
+ is branch a patch-queue branch?
+ >>> is_pq_branch("foo")
+ False
+ >>> is_pq_branch("patch-queue/foo")
+ True
+ """
return [False, True][branch.startswith(PQ_BRANCH_PREFIX)]
+
def pq_branch_name(branch):
- """get the patch queue branch corresponding to branch"""
+ """
+ get the patch queue branch corresponding to branch
+
+ >>> pq_branch_name("patch-queue/master")
+ >>> pq_branch_name("foo")
+ 'patch-queue/foo'
+ """
if not is_pq_branch(branch):
return PQ_BRANCH_PREFIX + branch
def pq_branch_base(pq_branch):
- """get the branch corresponding to the given patch queue branch"""
+ """
+ get the branch corresponding to the given patch queue branch
+ >>> pq_branch_base("patch-queue/master")
+ 'master'
+ >>> pq_branch_base("foo")
+ """
if is_pq_branch(pq_branch):
return pq_branch[len(PQ_BRANCH_PREFIX):]