chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-debrebse: merge handling: Handle absence of patches via $any
[dgit.git]
/
git-debrebase
diff --git
a/git-debrebase
b/git-debrebase
index a67008f7ed4039d083eb59fe522a5756a133d5f2..4756748adaf58b9853166982d16763a452a5ad97 100755
(executable)
--- a/
git-debrebase
+++ b/
git-debrebase
@@
-603,9
+603,10
@@
sub merge_series ($$$;@) {
playtree_setup();
foreach my $q ($base_q, reverse @input_qs) {
my $s = $q->{MR}{S};
playtree_setup();
foreach my $q ($base_q, reverse @input_qs) {
my $s = $q->{MR}{S};
- gbp_pq_export "p-$s", $q->{SeriesBase}, $q->{SeriesTip};
+
my $any =
gbp_pq_export "p-$s", $q->{SeriesBase}, $q->{SeriesTip};
my @earlier;
my @earlier;
- if (open S, $seriesfile) {
+ if ($any) {
+ open S, $seriesfile or die "$seriesfile $!";
while (my $patch = <S>) {
chomp $patch or die $!;
$prereq{$patch} //= {};
while (my $patch = <S>) {
chomp $patch or die $!;
$prereq{$patch} //= {};
@@
-617,8
+618,6
@@
sub merge_series ($$$;@) {
}
S->error and die "$seriesfile $!";
close S;
}
S->error and die "$seriesfile $!";
close S;
- } else {
- die "$seriesfile $!" unless $!==ENOENT;
}
read_tree_upstream $newbase, 1;
my $pec = make_commit [ grep { defined } $base_q->{MR}{PEC} ], [
}
read_tree_upstream $newbase, 1;
my $pec = make_commit [ grep { defined } $base_q->{MR}{PEC} ], [
@@
-1081,9
+1080,8
@@
sub keycommits ($;$$$$$) {
my ($head, $furniture, $unclean, $trouble, $fatal, $claimed_bw) = @_;
# => ($anchor, $breakwater)
my ($head, $furniture, $unclean, $trouble, $fatal, $claimed_bw) = @_;
# => ($anchor, $breakwater)
- # $unclean->("unclean-$tagsfx", $msg, $cl)
# $furniture->("unclean-$tagsfx", $msg, $cl)
# $furniture->("unclean-$tagsfx", $msg, $cl)
- # $
dgitimport->("unclean-$tagsfx", $msg, $cl)
)
+ # $
unclean->("unclean-$tagsfx", $msg, $cl
)
# is callled for each situation or commit that
# wouldn't be found in a laundered branch
# $furniture is for furniture commits such as might be found on an
# is callled for each situation or commit that
# wouldn't be found in a laundered branch
# $furniture is for furniture commits such as might be found on an
@@
-2408,12
+2406,17
@@
sub make_patches_staged ($) {
sub make_patches ($) {
my ($head) = @_;
keycommits $head, 0, \&snag;
sub make_patches ($) {
my ($head) = @_;
keycommits $head, 0, \&snag;
- make_patches_staged $head;
+ m
y $any = m
ake_patches_staged $head;
my $out;
in_workarea sub {
my $out;
in_workarea sub {
- my $ptree = cmdoutput @git, qw(write-tree --prefix=debian/patches/);
+ my $ptree = !$any ? undef :
+ cmdoutput @git, qw(write-tree --prefix=debian/patches/);
runcmd @git, qw(read-tree), $head;
runcmd @git, qw(read-tree), $head;
- read_tree_subdir 'debian/patches', $ptree;
+ if ($ptree) {
+ read_tree_subdir 'debian/patches', $ptree;
+ } else {
+ rm_subdir_cached 'debian/patches';
+ }
$out = make_commit [$head], [
'Commit patch queue (exported by git-debrebase)',
'[git-debrebase make-patches: export and commit patches]',
$out = make_commit [$head], [
'Commit patch queue (exported by git-debrebase)',
'[git-debrebase make-patches: export and commit patches]',