From: Ian Jackson Date: Fri, 6 Jul 2018 23:41:56 +0000 (+0100) Subject: git-debrebase new-upstream: Add a -1 revision if the user didn't supply one. X-Git-Tag: archive/debian/5.8~3 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=180a9c094c1b1e51281c70940dc451465ec04806;hp=87da76cc34151e4623797b32d16c351029969bb6 git-debrebase new-upstream: Add a -1 revision if the user didn't supply one. Closes:#903127. Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index 6dea1695..4acfcb81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ dgit (5.8~) unstable; urgency=medium * dgit, git-debrebase: Properly make patches even if an awkward .gitignore ignores the things in debian/patches. Closes:#903130. * git-debrebase status: Fix commit reporting. Closes:903131. + * git-debrebase new-upstream: Add a -1 revision if the user + didn't supply one. Closes:#903127. * dgit(1): Unscramble push[-source] descriptions. Closes:#903116. -- diff --git a/git-debrebase b/git-debrebase index 557e7898..c28a775c 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1140,7 +1140,11 @@ sub cmd_new_upstream () { badusage "need NEW-VERSION [UPS-COMMITTISH]" unless @ARGV >= 1; # parse args - low commitment - my $new_version = (new Dpkg::Version scalar(shift @ARGV), check => 1); + my $spec_version = shift @ARGV; + my $new_version = (new Dpkg::Version $spec_version, check => 1); + if ($new_version->is_native()) { + $new_version = (new Dpkg::Version "$spec_version-1", check => 1); + } my $new_upstream_version = $new_version->version(); my $new_upstream = shift @ARGV; diff --git a/git-debrebase.1.pod b/git-debrebase.1.pod index 1c3e6812..4d1a6736 100644 --- a/git-debrebase.1.pod +++ b/git-debrebase.1.pod @@ -135,6 +135,12 @@ If you git-rebase --abort, the whole new upstream operation is aborted, except for the laundering. + +may be whole new Debian version, including revision, +or just the upstream part, +in which case -1 will be appended +to make the new Debian version. + The are, optionally, in order: =over