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

destupdate: indent bookmark and branch logic

We'll move the obsolete related logic first (as it is overwriting any other
anyway) to make the next patch clearer we add indentation in this one.
parent 6c22a17faa18
No related branches found
No related tags found
No related merge requests found
......@@ -53,11 +53,6 @@
node = None
wc = repo[None]
p1 = wc.p1()
activemark = 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
if node is None:
......@@ -62,10 +57,7 @@
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())
# we also move the active bookmark, if any
node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
if node is not None:
activemark = node
......@@ -71,4 +63,12 @@
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())
......
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