[PATCH] keyword: use dirstate.parents to obtain current first parent

Christian Ebert blacktrash at gmx.net
Sun Jun 1 06:50:32 CDT 2008


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1212320112 -7200
# Node ID 9ed57d1109d3b3d41a7bb2581e665cca1986be09
# Parent  1603bba96411ce4608d7653bc1f3d6058ddf2db2
keyword: use dirstate.parents to obtain current first parent

This should be quicker than changectx().node()

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -509,7 +509,7 @@
         comparing against working dir.'''
         if node2 is not None:
             kwt.matcher = util.never
-        elif node1 is not None and node1 != repo.changectx().node():
+        elif node1 is not None and node1 != repo.dirstate.parents()[0]:
             kwt.restrict = True
         patch_diff(repo, node1, node2, match, fp, changes, opts)
 


More information about the Mercurial-devel mailing list