bookmarks: Teach addchangset to respect track.current
authorDavid Soria Parra <dsp@php.net>
Fri, 24 Jul 2009 00:37:42 +0200
changeset 9236 a15b0412de06
parent 9235 dde454349864
child 9237 abc198bca7c1
bookmarks: Teach addchangset to respect track.current addchangeset didn't respect track.current, resulting in hg pull to forward all bookmarks although track.current is set to True. Reported by Christos Trochalakis.
hgext/bookmarks.py
--- a/hgext/bookmarks.py	Fri Jul 24 00:04:24 2009 +0200
+++ b/hgext/bookmarks.py	Fri Jul 24 00:37:42 2009 +0200
@@ -285,10 +285,16 @@
             node = self.changelog.tip()
             marks = parse(self)
             update = False
-            for mark, n in marks.items():
-                if n in parents:
+            if ui.configbool('bookmarks', 'track.current'):
+                mark = current(self)
+                if mark and marks[mark] in parents:
                     marks[mark] = node
                     update = True
+            else:
+                for mark, n in marks.items():
+                    if n in parents:
+                        marks[mark] = node
+                        update = True
             if update:
                 write(self, marks)
             return result