--- a/mercurial/bookmarks.py Sun Aug 26 00:27:44 2012 +0200
+++ b/mercurial/bookmarks.py Sun Aug 26 00:28:56 2012 +0200
@@ -209,7 +209,7 @@
cl = repo[nl]
if cl.rev() >= cr.rev():
continue
- if cr in cl.descendants():
+ if validdest(repo, cl, cr):
repo._bookmarks[k] = cr.node()
changed = True
ui.status(_("updating bookmark %s\n") % k)
@@ -252,3 +252,7 @@
ui.status(_("no changed bookmarks found\n"))
return 1
return 0
+
+def validdest(repo, old, new):
+ """Is the new bookmark destination a valid update from the old one"""
+ return new in old.descendants()