X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=inline;f=git-debrebase;h=66167b2bafd501671885cbb7db43984d200d6aa5;hb=6152f859fc4fa61b485362a6ff5613f436883db8;hp=5a9a9cbe10886ded4019ffbfe8669ed2de7a01cb;hpb=813a7ced61b4c18222f43b31c10ad7b4c8e16bf1;p=dgit.git diff --git a/git-debrebase b/git-debrebase index 5a9a9cbe..66167b2b 100755 --- a/git-debrebase +++ b/git-debrebase @@ -2390,6 +2390,24 @@ sub cmd_make_patches () { } } +sub check_series_has_all_patches ($) { + my ($head) = @_; + my $seriesfn = 'debian/patches/series'; + my ($dummy, $series) = git_cat_file "$head:$seriesfn", + [qw(blob missing)]; + $series //= ''; + my %series; + foreach my $f (grep /\S/, grep {!m/^\s\#/} split /\n/, $series) { + fail "patch $f repeated in $seriesfn !" if $series{$f}++; + } + foreach my $patchfile (get_tree "$head:debian/patches", 1,1) { + my ($f,$i) = @$patchfile; + next if $series{$f}; + next if $f eq 'series'; + snag 'unused-patches', "Unused patch file $f will be discarded"; + } +} + sub cmd_convert_from_gbp () { badusage "want only 1 optional argument, the upstream git commitish" unless @ARGV<=1; @@ -2437,6 +2455,8 @@ END "upstream ($upstream) contains debian/ directory"; } + check_series_has_all_patches $old_head; + my $previous_dgit_view = eval { my @clogcmd = qw(dpkg-parsechangelog --format rfc822 -n2); my ($lvsn, $suite); @@ -2587,6 +2607,8 @@ END } } + check_series_has_all_patches $head; + snags_maybe_bail_early(); my $version = upstreamversion $clogp->{Version};