summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2007-10-07 13:53:46 +0200
committerGuido Guenther <agx@sigxcpu.org>2007-10-07 13:53:46 +0200
commitfee45b0acd4f9539c438fc6d9d457b64f55928ee (patch)
treeae5d7c01f20c3e18df457a145cf0deeb192660ae
parent05e29158263faf865f90e75592b26e76b3eb8576 (diff)
handle versions containing epochs
-rwxr-xr-xgit-dch10
1 files changed, 7 insertions, 3 deletions
diff --git a/git-dch b/git-dch
index 64637852..10d27387 100755
--- a/git-dch
+++ b/git-dch
@@ -78,11 +78,15 @@ def head_commit():
def snapshot_version(version):
"""
get the current release and snapshot version
- @FIXME: this causes trouble with epochs
+ Format is <debian-version>~<release>.gbp<short-commit-id>
"""
try:
- (release, suffix) = version.split('~', 1)
- snapshot = int(suffix.split('.',1)[0])
+ (release, suffix) = version.rsplit('~', 1)
+ (snapshot, commit) = suffix.split('.', 1)
+ if not commit.startswith('gbp'):
+ raise ValueError
+ else:
+ snapshot = int(snapshot)
except ValueError: # not a snapshot release
release = version
snapshot = 0