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

Christian Ebert blacktrash at gmx.net
Wed Jun 11 20:28:20 CDT 2008


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1212320112 -7200
# Node ID a6c4ede8048dd4caa03f524e810fe28f21b4b679
# Parent  bc553c6d1ef9b4360fe2fc6b65f50862e519d2fa
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