# HG changeset patch # User David Soria Parra # Date 1248388800 -7200 # Node ID abc198bca7c110b4dd6d4b42d577328a1243ebe6 # Parent a15b0412de06ce7d4f93a73892951656758b1072 bookmarks: optimize update routine in case track.current is set diff -r a15b0412de06 -r abc198bca7c1 hgext/bookmarks.py --- a/hgext/bookmarks.py Fri Jul 24 00:37:42 2009 +0200 +++ b/hgext/bookmarks.py Fri Jul 24 00:40:00 2009 +0200 @@ -259,12 +259,13 @@ parents = (parents[0],) marks = parse(self) update = False - for mark, n in marks.items(): - if ui.configbool('bookmarks', 'track.current'): - if mark == current(self) and n in parents: - marks[mark] = node - update = True - else: + 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