bookmarks: optimize update routine in case track.current is set
authorDavid Soria Parra <dsp@php.net>
Fri, 24 Jul 2009 00:40:00 +0200
changeset 9237 abc198bca7c1
parent 9236 a15b0412de06
child 9238 40196d036a71
bookmarks: optimize update routine in case track.current is set
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