Skip to content
Snippets Groups Projects
Commit 6cd643a1d32c authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

destupdate: move obsolete handling first

This block was overwriting any result from the previous block anyway. So we move
it first to prove it is possible and we'll extract it in its own function in the
next patch.
parent 3d094fbedf74
No related merge requests found
......@@ -53,11 +53,5 @@
node = None
wc = repo[None]
p1 = wc.p1()
movemark, activemark = None
if node is None:
# we also move the active bookmark, if any
node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
if node is not None:
activemark = node
movemark = activemark = None
......@@ -63,12 +57,4 @@
if node is None:
try:
node = repo.branchtip(wc.branch())
except error.RepoLookupError:
if wc.branch() == 'default': # no default branch!
node = repo.lookup('tip') # update to tip
else:
raise error.Abort(_("branch %s not found") % wc.branch())
if p1.obsolete() and not p1.children():
# allow updating to successors
successors = obsolete.successorssets(repo, p1.node())
......@@ -94,6 +80,23 @@
# get the max revision for the given successors set,
# i.e. the 'tip' of a set
node = repo.revs('max(%ln)', successors).first()
if bookmarks.isactivewdirparent(repo):
movemark = repo['.'].node()
if node is None:
# we also move the active bookmark, if any
node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
if node is not None:
activemark = node
if node is None:
try:
node = repo.branchtip(wc.branch())
except error.RepoLookupError:
if wc.branch() == 'default': # no default branch!
node = repo.lookup('tip') # update to tip
else:
raise error.Abort(_("branch %s not found") % wc.branch())
rev = repo[node].rev()
_destupdatevalidate(repo, rev, clean, check)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment