}
}
+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;
"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);
if (!$previous_dgit_view) {
$@ =~ s/^\n+//;
chomp $@;
- print STDERR "cannot stitch in dgit view: $@\n";
+ print STDERR <<END;
+Cannot confirm dgit view: $@
+Failed to stitch in dgit view (see messages above).
+dgit --overwrite will be needed on the first dgit push after conversion.
+END
}
snags_maybe_bail_early();
ffq_check $work;
snags_maybe_bail();
update_head_checkout $old_head, $work, 'convert-from-gbp';
+ print <<END or die $!;
+git-debrebase: converted from patched-unapplied (gbp) branch format, OK
+END
}
sub cmd_convert_to_gbp () {
}
}
+ check_series_has_all_patches $head;
+
snags_maybe_bail_early();
my $version = upstreamversion $clogp->{Version};