mercurial/commands.py
branchstable
changeset 17264 ec7b9bec19c9
parent 17260 e432fb4b4221
child 17266 4e35dea77e31
--- a/mercurial/commands.py	Fri Jul 27 12:33:48 2012 -0500
+++ b/mercurial/commands.py	Thu Jul 26 16:57:50 2012 -0500
@@ -1298,10 +1298,20 @@
                                editor=editor,
                                extra=extra)
 
+        current = repo._bookmarkcurrent
+        marks = old.bookmarks()
         node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts)
         if node == old.node():
             ui.status(_("nothing changed\n"))
             return 1
+        elif marks:
+            ui.debug('moving bookmarks %r from %s to %s\n' %
+                     (marks, old.hex(), hex(node)))
+            for bm in marks:
+                repo._bookmarks[bm] = node
+                if bm == current:
+                    bookmarks.setcurrent(repo, bm)
+            bookmarks.write(repo)
     else:
         e = cmdutil.commiteditor
         if opts.get('force_editor'):