hgext/bookmarks.py
changeset 7484 167853c7e54a
parent 7483 187a13bd14c6
child 7487 63446383dfb7
--- a/hgext/bookmarks.py	Sat Dec 06 14:03:30 2008 +0200
+++ b/hgext/bookmarks.py	Sat Dec 06 19:30:20 2008 +0100
@@ -96,9 +96,15 @@
     Set the name of the bookmark that we are on (hg update <bookmark>).
     The name is recoreded in .hg/bookmarks.current
     '''
-    if repo._bookmarkcurrent == mark:
+    if current(repo) == mark:
         return
+
     refs = parse(repo)
+
+    'do not update if we do update to an rev equal to the current bookmark'
+    if (mark not in refs and
+        current(repo) and refs[current(repo)] == repo.changectx('.').node()):
+        return
     if mark not in refs:
         mark = ''
     file = repo.opener('bookmarks.current', 'w+')