mercurial/commands.py
changeset 22626 fb74a5833467
parent 22625 62ab9ca90b36
child 22634 e48a5d3996c2
--- a/mercurial/commands.py	Thu Sep 25 02:53:29 2014 -0700
+++ b/mercurial/commands.py	Thu Sep 25 17:53:27 2014 -0700
@@ -4961,6 +4961,14 @@
 
         modheads = repo.pull(other, heads=revs, force=opts.get('force'))
         bookmarks.updatefromremote(ui, repo, remotebookmarks, source)
+        # update specified bookmarks
+        if opts.get('bookmark'):
+            marks = repo._bookmarks
+            for b in opts['bookmark']:
+                # explicit pull overrides local bookmark if any
+                ui.status(_("importing bookmark %s\n") % b)
+                marks[b] = repo[remotebookmarks[b]].node()
+            marks.write()
         if checkout:
             checkout = str(repo.changelog.rev(other.lookup(checkout)))
         repo._subtoppath = source
@@ -4970,14 +4978,6 @@
         finally:
             del repo._subtoppath
 
-        # update specified bookmarks
-        if opts.get('bookmark'):
-            marks = repo._bookmarks
-            for b in opts['bookmark']:
-                # explicit pull overrides local bookmark if any
-                ui.status(_("importing bookmark %s\n") % b)
-                marks[b] = repo[remotebookmarks[b]].node()
-            marks.write()
     finally:
         other.close()
     return ret