log: speedup keyword search when used with --branch
authorTK Soh <teekaysoh@yahoo.com>
Tue, 18 Oct 2005 20:06:13 -0700
changeset 1405 6fd6527f95eb
parent 1404 67e20e27d8df
child 1406 34cb3957d875
log: speedup keyword search when used with --branch By avoiding unnecessary branch lookup.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Oct 18 20:06:05 2005 -0700
+++ b/mercurial/commands.py	Tue Oct 18 20:06:13 2005 -0700
@@ -1274,9 +1274,6 @@
         elif st == 'add':
             du.bump(rev)
             br = None
-            if opts['branch']:
-                br = repo.branchlookup([repo.changelog.node(rev)])
-
             if opts['keyword']:
                 changes = repo.changelog.read(repo.changelog.node(rev))
                 miss = 0
@@ -1289,6 +1286,9 @@
                 if miss:
                     continue
 
+            if opts['branch']:
+                br = repo.branchlookup([repo.changelog.node(rev)])
+
             show_changeset(du, repo, rev, brinfo=br)
             if opts['patch']:
                 changenode = repo.changelog.node(rev)