Mercurial > hg
diff tests/test-update-branches.t @ 48689:fbf7e383e961
destutil: if wdp is obsolete, update to the closest non-obsolete ancestor
As the original comments suggest, using prune as a model here was an existing
idea, and now this patch implements it.
I think it would be even better to do what solveobswdp() from evolve does (in
short, it allows to update to a successor of the closest ancestor even if that
ancestor is obsolete), but that is outside of this series' scope.
Differential Revision: https://phab.mercurial-scm.org/D12099
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 15 Jan 2022 09:08:41 +0300 |
parents | 7e503eff3c76 |
children | cdfba684b6a1 |
line wrap: on
line diff
--- a/tests/test-update-branches.t Tue Jan 04 23:38:39 2022 +0300 +++ b/tests/test-update-branches.t Sat Jan 15 09:08:41 2022 +0300 @@ -696,9 +696,8 @@ (commit or update --clean to discard changes) [255] -Test that we don't crash when updating from a pruned changeset (i.e. has no -successors). Behavior should probably be that we update to the first -non-obsolete parent but that will be decided later. +Test that we update to the closest non-obsolete ancestor when updating from a +pruned changeset (i.e. that has no successors) $ hg id --debug -r 2 bd10386d478cd5a9faf2e604114c8e6da62d3889 $ hg up --quiet 0 @@ -706,21 +705,18 @@ $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889 1 new obsolescence markers obsoleted 1 changesets + $ hg log -r '_destupdate()' + 1:0786582aa4b1 1 (no-eol) $ hg up - 0 files updated, 0 files merged, 0 files removed, 0 files unresolved - -Test experimental revset support - - $ hg log -r '_destupdate()' - 2:bd10386d478c 2 (no-eol) + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Test that boolean flags allow --no-flag specification to override [defaults] $ cat >> $HGRCPATH <<EOF > [defaults] > update = --check > EOF - $ hg co 2 + $ hg co 1 abort: uncommitted changes [20] - $ hg co --no-check 2 + $ hg co --no-check 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved