Read about our upcoming Code of Conduct on this issue

Commit d043dc82 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

status: adapt the "keyword" extensions to gather stats at lookup time

See main core code for details.

We don't factor the code in a common function yet, because we will have to adapt
a bit more things in the keyword case at the end of the series.

Differential Revision: https://phab.mercurial-scm.org/D11787
parent 991e6f728b50
......@@ -116,6 +116,7 @@ from mercurial.utils import (
dateutil,
stringutil,
)
from mercurial.dirstateutils import timestamp
cmdtable = {}
command = registrar.command(cmdtable)
......@@ -326,6 +327,7 @@ class kwtemplater(object):
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 @@ class kwtemplater(object):
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment