[Updated] D11787: status: adapt the "keyword" extensions to gather stats at lookup time

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Dec 1 15:22:12 UTC 2021


Closed by commit rHG4237be881bb6: status: adapt the "keyword" extensions to gather stats at lookup time (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11787?vs=31109&id=31249

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11787/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11787

AFFECTED FILES
  hgext/keyword.py

CHANGE DETAILS

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -116,6 +116,7 @@
     dateutil,
     stringutil,
 )
+from mercurial.dirstateutils import timestamp
 
 cmdtable = {}
 command = registrar.command(cmdtable)
@@ -326,6 +327,7 @@
             msg = _(b'overwriting %s expanding keywords\n')
         else:
             msg = _(b'overwriting %s shrinking keywords\n')
+        wctx = self.repo[None]
         for f in candidates:
             if self.restrict:
                 data = self.repo.file(f).read(mf[f])
@@ -356,7 +358,12 @@
                 fp.write(data)
                 fp.close()
                 if kwcmd:
-                    self.repo.dirstate.set_clean(f)
+                    s = wctx[f].lstat()
+                    mode = s.st_mode
+                    size = s.st_size
+                    mtime = timestamp.mtime_of(s)
+                    cache_data = (mode, size, mtime)
+                    self.repo.dirstate.set_clean(f, cache_data)
                 elif self.postcommit:
                     self.repo.dirstate.update_file_p1(f, p1_tracked=True)
 



To: marmoute, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211201/a4288bd5/attachment-0002.html>


More information about the Mercurial-patches mailing list