[PATCH 1 of 2] keyword: force dirstate normal when all changes in a file are recorded

Christian Ebert blacktrash at gmx.net
Mon May 31 18:24:19 CDT 2010


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1275347145 -7200
# Node ID 6f927a8163a2c0b961e0233391d40297b2fb7007
# Parent  ac6fec2af8c882670144d9cb8e3637d1cee1a171
keyword: force dirstate normal when all changes in a file are recorded

Before this bugfix a file whose changes were entirely recorded was still
considered modified by "hg status".

There is no test case, as this only happens when record is called without
the --message option and the commit editor is opened.

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -220,6 +220,8 @@
                     self.repo.wwrite(f, data, mf.flags(f))
                     if node is None:
                         self.repo.dirstate.normal(f)
+                    elif self.record:
+                        self.repo.dirstate.normallookup(f)
             self.restrict = False
 
     def shrinktext(self, text):


More information about the Mercurial-devel mailing list