From a64ba8144d1882e29a7b59a97541fff672f53aee Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 27 Dec 2011 16:54:21 +0100 Subject: dch: Add doctests for snapshot_version --- gbp/scripts/dch.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gbp/scripts/dch.py') diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index a7c3d99..8307b6c 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 ~.gbp + + >>> 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) -- cgit v1.2.3