diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-18 01:33:38 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-18 01:44:23 +0100 |
commit | 06ef121b4141a3bd8f9b2ff4c0afc4493696753c (patch) | |
tree | c611c281ff1d1644031a9f06622a795c88f55e4e | |
parent | 12da50e85e2fe58f537d8eb1c3b06f1377e373c9 (diff) |
pseudomerge: Suppress checks in split brain mode with --overwrite
If the user has specified an appropriate --overwrite (=VERSION with
the archive's version, or without a version and the archive's version
being in debian/changelog), do not do all the automatic checks.
Instead, in this case, simply make the dgit view be a descendant of
the archive, as instructed.
Closes:#841101.
When generating split brain pseudomerge with --overwrite
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | dgit | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -2896,17 +2896,26 @@ sub splitbrain_pseudomerge ($$$$) { return $dgitview if is_fast_fwd $archive_hash, $dgitview; - my $t_dep14 = debiantag_maintview $i_arch_v->[0], access_basedistro; - my $i_dep14 = infopair_lrf_tag_lookup($t_dep14, "maintainer view tag"); - my $t_dgit = debiantag_new $i_arch_v->[0], access_basedistro; - my $i_dgit = infopair_lrf_tag_lookup($t_dgit, "dgit view tag"); - my $i_archive = [ $archive_hash, "current archive contents" ]; - - printdebug "splitbrain_pseudomerge i_archive @$i_archive\n"; - - infopair_cond_equal($i_dgit, $i_archive); - infopair_cond_ff($i_dep14, $i_dgit); - $overwrite_version // infopair_cond_ff($i_dep14, [ $maintview, 'HEAD' ]); + if (defined $overwrite_version) { + } elsif (!eval { + my $t_dep14 = debiantag_maintview $i_arch_v->[0], access_basedistro; + my $i_dep14 = infopair_lrf_tag_lookup($t_dep14, "maintainer view tag"); + my $t_dgit = debiantag_new $i_arch_v->[0], access_basedistro; + my $i_dgit = infopair_lrf_tag_lookup($t_dgit, "dgit view tag"); + my $i_archive = [ $archive_hash, "current archive contents" ]; + + printdebug "splitbrain_pseudomerge i_archive @$i_archive\n"; + + infopair_cond_equal($i_dgit, $i_archive); + infopair_cond_ff($i_dep14, $i_dgit); + infopair_cond_ff($i_dep14, [ $maintview, 'HEAD' ]); + 1; + }) { + print STDERR <<END; +$us: check failed (maybe --overwrite is needed, consult documentation) +END + die "$@"; + } my $r = pseudomerge_make_commit $clogp, $dgitview, $archive_hash, $i_arch_v, |