diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-03-21 14:20:50 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-04-17 16:04:10 +0200 |
commit | 002d4ce2cc346cacff9daaa69caeded64e16bf1e (patch) | |
tree | bd2299f6541bb5a68182744b28b57746c0e26833 /gbp-pq | |
parent | 5f8460017389a3829e45bbf4f6d93871f030bdd1 (diff) |
gbp-pq: add some simple doctests
Git-Dch: Ignore
Diffstat (limited to 'gbp-pq')
-rwxr-xr-x | gbp-pq | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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):] |