##// END OF EJS Templates
destutil: if wdp is obsolete, update to the closest non-obsolete ancestor...
av6 -
r49538:fbf7e383 default
parent child Browse files
Show More
@@ -65,9 +65,8 b' def _destupdateobs(repo, clean):'
65 65 # replaced changesets: same as divergent except we know there
66 66 # is no conflict
67 67 #
68 # pruned changeset: no update is done; though, we could
69 # consider updating to the first non-obsolete parent,
70 # similar to what is current done for 'hg prune'
68 # pruned changeset: update to the closest non-obsolete ancestor,
69 # similar to what 'hg prune' currently does
71 70
72 71 if successors:
73 72 # flatten the list here handles both divergent (len > 1)
@@ -77,11 +76,15 b' def _destupdateobs(repo, clean):'
77 76 # get the max revision for the given successors set,
78 77 # i.e. the 'tip' of a set
79 78 node = repo.revs(b'max(%ln)', successors).first()
80 if bookmarks.isactivewdirparent(repo):
81 movemark = repo[b'.'].node()
82 79 else:
83 # TODO: copy hg prune logic
84 node = repo[b'.'].node()
80 p1 = p1.p1()
81 while p1.obsolete():
82 p1 = p1.p1()
83 node = p1.node()
84
85 if node is not None and bookmarks.isactivewdirparent(repo):
86 movemark = repo[b'.'].node()
87
85 88 return node, movemark, None
86 89
87 90
@@ -696,9 +696,8 b' Test that 5 is not detected as a valid d'
696 696 (commit or update --clean to discard changes)
697 697 [255]
698 698
699 Test that we don't crash when updating from a pruned changeset (i.e. has no
700 successors). Behavior should probably be that we update to the first
701 non-obsolete parent but that will be decided later.
699 Test that we update to the closest non-obsolete ancestor when updating from a
700 pruned changeset (i.e. that has no successors)
702 701 $ hg id --debug -r 2
703 702 bd10386d478cd5a9faf2e604114c8e6da62d3889
704 703 $ hg up --quiet 0
@@ -706,21 +705,18 b' non-obsolete parent but that will be dec'
706 705 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
707 706 1 new obsolescence markers
708 707 obsoleted 1 changesets
708 $ hg log -r '_destupdate()'
709 1:0786582aa4b1 1 (no-eol)
709 710 $ hg up
710 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
711
712 Test experimental revset support
713
714 $ hg log -r '_destupdate()'
715 2:bd10386d478c 2 (no-eol)
711 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
716 712
717 713 Test that boolean flags allow --no-flag specification to override [defaults]
718 714 $ cat >> $HGRCPATH <<EOF
719 715 > [defaults]
720 716 > update = --check
721 717 > EOF
722 $ hg co 2
718 $ hg co 1
723 719 abort: uncommitted changes
724 720 [20]
725 $ hg co --no-check 2
721 $ hg co --no-check 1
726 722 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now