$gdrlastinfo is undef for now, and will be used in a moment.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
+sub begin_convert_from () {
+ my $head = get_head();
+ return ($head, undef);
+}
+
+sub complete_convert_from ($$$$) {
+ my ($old_head, $new_head, $gi, $mrest) = @_;
+ ffq_check $new_head;
+ snags_maybe_bail();
+ update_head_checkout $old_head, $new_head, $mrest;
+}
+
sub cmd_convert_from_gbp () {
badusage "want only 1 optional argument, the upstream git commitish"
unless @ARGV<=1;
sub cmd_convert_from_gbp () {
badusage "want only 1 optional argument, the upstream git commitish"
unless @ARGV<=1;
my $upstream =
resolve_upstream_version($upstream_spec, $upstream_version);
my $upstream =
resolve_upstream_version($upstream_spec, $upstream_version);
- my $old_head = get_head();
+ my ($old_head, $gdrlastinfo) = begin_convert_from();
my $upsdiff = get_differs $upstream, $old_head;
if ($upsdiff & D_UPS) {
my $upsdiff = get_differs $upstream, $old_head;
if ($upsdiff & D_UPS) {
- ffq_check $work;
- snags_maybe_bail();
- update_head_checkout $old_head, $work, 'convert-from-gbp';
+ complete_convert_from $old_head, $work, $gdrlastinfo, 'convert-from-gbp';
print <<END or die $!;
git-debrebase: converted from patched-unapplied (gbp) branch format, OK
END
print <<END or die $!;
git-debrebase: converted from patched-unapplied (gbp) branch format, OK
END
+ my ($head, $gdrlastinfo) = begin_convert_from();
if (!$always) {
my $troubles = 0;
if (!$always) {
my $troubles = 0;
printf STDERR "Yes, will base new branch on %s\n", $result->{Source};
printf STDERR "Yes, will base new branch on %s\n", $result->{Source};
- ffq_check $result->{Result};
- snags_maybe_bail();
- update_head_checkout $head, $result->{Result},
+ complete_convert_from $head, $result->{Result}, $gdrlastinfo,
'convert-from-dgit-view';
}
'convert-from-dgit-view';
}