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.
--- 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