[PATCH 3 of 4] bookmarks: Teach addchangset to respect track.current

David Soria Parra sn_ at gmx.net
Thu Jul 23 17:58:34 CDT 2009


# HG changeset patch
# User David Soria Parra <dsp at php.net>
# Date 1248388662 -7200
# Node ID 970d6727696d60e4891e1d3ff3f23aba11ea8e9c
# Parent  5a9016338ac60df6a5babfee15f909cbc5d2398a
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.

diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py
--- a/hgext/bookmarks.py
+++ b/hgext/bookmarks.py
@@ -288,10 +288,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


More information about the Mercurial-devel mailing list