projects
/
tools
/
git-buildpackage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8dc3d9b
)
dch: Add doctests for snapshot_version
author
Guido Günther
<agx@sigxcpu.org>
Tue, 27 Dec 2011 15:54:21 +0000
(16:54 +0100)
committer
Guido Günther
<agx@sigxcpu.org>
Tue, 27 Dec 2011 18:13:57 +0000
(19:13 +0100)
gbp/scripts/dch.py
patch
|
blob
|
history
diff --git
a/gbp/scripts/dch.py
b/gbp/scripts/dch.py
index
a7c3d99
..
8307b6c
100644
(file)
--- 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)