# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1444871535 -3600
#      Thu Oct 15 02:12:15 2015 +0100
# Node ID 3d094fbedf740e4fa5307fe5b120716ec2fecdea
# Parent  6c22a17faa18ab1236ffb157f7133002aaa09fd0
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.

diff --git a/mercurial/destutil.py b/mercurial/destutil.py
--- a/mercurial/destutil.py
+++ b/mercurial/destutil.py
@@ -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())