}
snags_maybe_bail();
update_head_checkout $head, $out, "convert to gbp (v0)";
- print <<END or confess $!;
-$us: converted to git-buildpackage branch format
-$us: WARNING: do not now run "git-debrebase" any more
-$us: WARNING: doing so would drop all upstream patches!
+ print f_ <<END, $us,$us,$us or confess $!;
+%s: converted to git-buildpackage branch format
+%s: WARNING: do not now run "git-debrebase" any more
+%s: WARNING: doing so would drop all upstream patches!
END
}
'origs!', \$do_origs,
'tags!', \$do_tags,
'always-convert-anyway!', \$always);
- fail "takes 1 optional argument, the upstream commitish" if @ARGV>1;
+ fail __ "takes 1 optional argument, the upstream commitish" if @ARGV>1;
my @upstreams;
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,
};
}
keycommits $head, sub{}, sub{}, $trouble, $trouble;
printdebug "troubles=$troubles\n";
if (!$troubles) {
- print STDERR <<END;
-$us: Branch already seems to be in git-debrebase format!
-$us: --always-convert-anyway would do the conversion operation anyway
-$us: but is probably a bad idea. Probably, you wanted to do nothing.
+ print STDERR f_ <<END, $us,$us,$us;
+%s: Branch already seems to be in git-debrebase format!
+%s: --always-convert-anyway would do the conversion operation anyway
+%s: but is probably a bad idea. Probably, you wanted to do nothing.
END
- fail "Branch already in git-debrebase format." unless $opt_noop_ok;
+ fail __ "Branch already in git-debrebase format."
+ unless $opt_noop_ok;
finish 0;
}
}
snags_maybe_bail_early();
my $version = upstreamversion $clogp->{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";
}
# 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;
};
}
} else {
- printf STDERR
+ print STDERR f_
" orig: no suitable origs found (looked for %s in %s)\n",
"${p}_".(stripeoch $version)."...", $bpd;
}
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) {
}
my $r = system @gbp_cmd;
if ($r) {
- printf STDERR
+ print STDERR f_
" %s: couldn't apply patches: gbp pq %s",
$u->{Source}, waitstatusmsg();
return;
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;
}
}
if (!$result) {
- fail <<END;
+ fail __ <<END;
Could not find or construct a suitable upstream commit.
Rerun adding --diagnose after convert-from-dgit-view, or pass a
upstream commmit explicitly or provide suitable origs.
END
}
- printf STDERR "Yes, will base new branch on %s\n", $result->{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";
textdomain("git-debrebase");
getoptions_main
- ("bad options\n",
+ (__ "bad options\n",
"D+" => \$debuglevel,
'noop-ok', => \$opt_noop_ok,
'f=s' => \@snag_force_opts,
initdebug('git-debrebase ');
enabledebug if $debuglevel;
-my $toplevel = cmdoutput @git, qw(rev-parse --show-toplevel);
-chdir $toplevel or fail "chdir toplevel $toplevel: $!\n";
+changedir_git_toplevel();
$rd = fresh_playground "$playprefix/misc";