From 06ef121b4141a3bd8f9b2ff4c0afc4493696753c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 18 Oct 2016 01:33:38 +0100 Subject: 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 --- dgit | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index bc4d7c3..2cbb2fd 100755 --- a/dgit +++ b/dgit @@ -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 <