Mercurial > hg-stable
changeset 26721:3d094fbedf74
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.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 15 Oct 2015 02:12:15 +0100 |
parents | 6c22a17faa18 |
children | 6cd643a1d32c |
files | mercurial/destutil.py |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/destutil.py Thu Oct 15 14:10:57 2015 +0100 +++ b/mercurial/destutil.py Thu Oct 15 02:12:15 2015 +0100 @@ -53,22 +53,22 @@ 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: - 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 + 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())