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

Christian Ebert blacktrash at gmx.net
Mon Jun 2 09:13:13 UTC 2008


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1212320112 -7200
# Node ID 5769cc95f9bc4e16b8a054bffc3a8fd21870fc6d
# Parent  72b9cb02e546876e490b00a6374137dac0876537
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
@@ -507,7 +507,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