chiark / gitweb /
git-debrebase: merge: Split off merge_series_patchqueue_convert
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:24:47 +0000 (20:24 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:24:47 +0000 (20:24 +0100)
We're about to reuse this.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 910e444..0dea5d5 100755 (executable)
@@ -428,6 +428,8 @@ sub merge_attempt_cmd {
     }
 }
 
+sub merge_series_patchqueue_convert ($$$);
+
 sub merge_series ($$$;@) {
     my ($newbase, $wrecknotes, $base_q, @input_qs) = @_;
     # $base_q{SeriesBase}  $input_qs[]{SeriesBase}
@@ -452,7 +454,6 @@ sub merge_series ($$$;@) {
     # $prereq{<patch filename>}{<possible prereq}  exists or not (later)
     # $prereq{<patch filename>}               exists or not (even later)
 
-    my $result;
     my $merged_pq;
 
     my $mwrecknote = sub { &mwrecknote($wrecknotes, @_); };
@@ -595,7 +596,17 @@ sub merge_series ($$$;@) {
        runcmd @git, qw(commit --quiet -m), 'Merged patch queue form';
        $merged_pq = git_rev_parse 'HEAD';
        $mwrecknote->('merged-patchqueue', $merged_pq);
+    };
+    return merge_series_patchqueue_convert
+           $wrecknotes, $newbase, $merged_pq;
+}
 
+sub merge_series_patchqueue_convert ($$$) {
+    my ($wrecknotes, $newbase, $merged_pq) = @_;
+
+    my $result;
+    in_workarea sub {
+       playtree_setup();
        printdebug "merge_series series gbp pq import\n";
        runcmd @git, qw(checkout -q -b mergec), $merged_pq;