aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-12-27 16:54:21 +0100
committerGuido Günther <agx@sigxcpu.org>2011-12-27 19:13:57 +0100
commita64ba8144d1882e29a7b59a97541fff672f53aee (patch)
tree995fa0eee9e3821d4692f4921a10c7486eeb75b1 /gbp/scripts
parent8dc3d9b87e9eee80caef2d12ef916c8e4046c7d1 (diff)
dch: Add doctests for snapshot_version
Diffstat (limited to 'gbp/scripts')
-rw-r--r--gbp/scripts/dch.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py
index a7c3d994..8307b6cf 100644
--- a/gbp/scripts/dch.py
+++ b/gbp/scripts/dch.py
@@ -145,8 +145,16 @@ def fixup_trailer(repo, git_author, dch_options):
def snapshot_version(version):
"""
- get the current release and snapshot version
+ Get the current release and snapshot version.
+
Format is <debian-version>~<release>.gbp<short-commit-id>
+
+ >>> snapshot_version('1.0-1')
+ ('1.0-1', 0)
+ >>> snapshot_version('1.0-1~1.test0')
+ ('1.0-1~1.test0', 0)
+ >>> snapshot_version('1.0-1~2.gbp1234')
+ ('1.0-1', 2)
"""
try:
(release, suffix) = version.rsplit('~', 1)