mercurial/commands.py
branchstable
changeset 16019 eb85d5f89fef
parent 16010 c7811ca6fb94
child 16021 7f47873d7484
--- a/mercurial/commands.py	Sun Jan 29 13:36:10 2012 -0600
+++ b/mercurial/commands.py	Sun Jan 29 14:07:45 2012 -0600
@@ -4260,11 +4260,16 @@
     if modheads == 0:
         return
     if optupdate:
+        movemarkfrom = repo['.'].node()
         try:
-            return hg.update(repo, checkout)
+            ret = hg.update(repo, checkout)
         except util.Abort, inst:
             ui.warn(_("not updating: %s\n" % str(inst)))
             return 0
+        if not ret and not checkout:
+            if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
+                ui.status(_("updating bookmark %s\n") % repo._bookmarkcurrent)
+        return ret
     if modheads > 1:
         currentbranchheads = len(repo.branchheads())
         if currentbranchheads == modheads: