X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=git-debrebase;h=79c832188c7abfefd43f0b93d1f7dbb1565956ae;hp=3101ae7d9dcddb39902d3aa6b71d976d694c5c3c;hb=0f37a4cac41ca7dc266b9e9af877f0d6a6e49b01;hpb=0eef00174d9c13c2a7b3c72c9515d5fc89a7feba diff --git a/git-debrebase b/git-debrebase index 3101ae7d..79c83218 100755 --- a/git-debrebase +++ b/git-debrebase @@ -2698,10 +2698,10 @@ sub cmd_convert_to_gbp () { } snags_maybe_bail(); update_head_checkout $head, $out, "convert to gbp (v0)"; - print <1; + fail __ "takes 1 optional argument, the upstream commitish" if @ARGV>1; my @upstreams; @@ -2728,7 +2728,7 @@ sub cmd_convert_from_dgit_view () { my $spec = shift @ARGV; my $commit = git_rev_parse "$spec^{commit}"; push @upstreams, { Commit => $commit, - Source => "$ARGV[0], from command line", + Source => (f_ "%s, from command line", $ARGV[0]), Only => 1, }; } @@ -2741,12 +2741,13 @@ sub cmd_convert_from_dgit_view () { keycommits $head, sub{}, sub{}, $trouble, $trouble; printdebug "troubles=$troubles\n"; if (!$troubles) { - print STDERR <{Version}; - print STDERR "Considering possible commits corresponding to upstream:\n"; + print STDERR __ + "Considering possible commits corresponding to upstream:\n"; if (!@upstreams) { if ($do_tags) { my @tried; my $ups_tag = upstream_commitish_search $version, \@tried; if ($ups_tag) { - my $this = "git tag $tried[-1]"; + my $this = f_ "git tag %s", $tried[-1]; push @upstreams, { Commit => $ups_tag, Source => $this, }; } else { - printf STDERR + print STDERR f_ " git tag: no suitable tag found (tried %s)\n", "@tried"; } @@ -2778,11 +2780,12 @@ END # we do a quick check to see if there are plausible origs my $something=0; if (!opendir BPD, $bpd) { - die "opendir build-products-dir $bpd: $!" unless $!==ENOENT; + die f_ "opendir build-products-dir %s: %s", $bpd, $! + unless $!==ENOENT; } else { while ($!=0, my $f = readdir BPD) { next unless is_orig_file_of_p_v $f, $p, $version; - printf STDERR + print STDERR f_ " orig: found what looks like a .orig, %s\n", "$bpd/$f"; $something=1; @@ -2813,7 +2816,7 @@ END }; } } else { - printf STDERR + print STDERR f_ " orig: no suitable origs found (looked for %s in %s)\n", "${p}_".(stripeoch $version)."...", $bpd; } @@ -2822,7 +2825,8 @@ END my $some_patches = stat_exists 'debian/patches/series'; - print STDERR "Evaluating possible commits corresponding to upstream:\n"; + print STDERR __ + "Evaluating possible commits corresponding to upstream:\n"; my $result; foreach my $u (@upstreams) { @@ -2858,7 +2862,7 @@ END } my $r = system @gbp_cmd; if ($r) { - printf STDERR + print STDERR f_ " %s: couldn't apply patches: gbp pq %s", $u->{Source}, waitstatusmsg(); return; @@ -2867,8 +2871,9 @@ END my $work = git_rev_parse qw(HEAD); my $diffout = cmdoutput @git, qw(diff-tree --stat HEAD), $work; if (length $diffout) { - print STDERR - " $u->{Source}: applying patches gives different tree\n"; + print STDERR f_ + " %s: applying patches gives different tree\n", + $u->{Source}; print STDERR $diffout if $diagnose; return; } @@ -2880,24 +2885,26 @@ END } if (!$result) { - fail <{Source}; + print STDERR f_ "Yes, will base new branch on %s\n", $result->{Source}; complete_convert_from $head, $result->{Result}, $gdrlastinfo, 'convert-from-dgit-view'; } sub cmd_forget_was_ever_debrebase () { - badusage "forget-was-ever-debrebase takes no further arguments" if @ARGV; + badusage __ "forget-was-ever-debrebase takes no further arguments" + if @ARGV; my ($ffqstatus, $ffq_msg, $current, $ffq_prev, $gdrlast) = ffq_prev_branchinfo(); - fail "Not suitable for recording git-debrebaseness anyway: $ffq_msg" + fail f_ "Not suitable for recording git-debrebaseness anyway: %s", + $ffq_msg if defined $ffq_msg; push @deferred_updates, "delete $ffq_prev"; push @deferred_updates, "delete $gdrlast"; @@ -2998,7 +3005,7 @@ setlocale(LC_MESSAGES, ""); textdomain("git-debrebase"); getoptions_main - ("bad options\n", + (__ "bad options\n", "D+" => \$debuglevel, 'noop-ok', => \$opt_noop_ok, 'f=s' => \@snag_force_opts, @@ -3025,7 +3032,7 @@ initdebug('git-debrebase '); enabledebug if $debuglevel; my $toplevel = cmdoutput @git, qw(rev-parse --show-toplevel); -chdir $toplevel or fail "chdir toplevel $toplevel: $!\n"; +chdir $toplevel or fail f_ "chdir toplevel %s: %s\n", $toplevel, $!; $rd = fresh_playground "$playprefix/misc";