mercurial/bookmarks.py
branchstable
changeset 13478 c631ac076375
parent 13425 0fe36c347c00
child 13627 71a96f6c205d
--- a/mercurial/bookmarks.py	Fri Feb 18 17:09:08 2011 -0600
+++ b/mercurial/bookmarks.py	Thu Feb 24 14:38:50 2011 +0100
@@ -127,8 +127,11 @@
     update = False
     mark = repo._bookmarkcurrent
     if mark and marks[mark] in parents:
-        marks[mark] = node
-        update = True
+        old = repo[marks[mark]]
+        new = repo[node]
+        if new in old.descendants():
+            marks[mark] = new.node()
+            update = True
     if update:
         write(repo)