changeset 33098:eb4c49f55f1f

workingfilectx: add audit() as a wrapper for wvfs.audit()
author Phil Cohen <phillco@fb.com>
date Sun, 25 Jun 2017 22:30:14 -0700
parents 1e79c66d6b07
children fcd1c483f5ea
files mercurial/context.py mercurial/merge.py
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sun Jun 25 22:30:14 2017 -0700
+++ b/mercurial/context.py	Sun Jun 25 22:30:14 2017 -0700
@@ -1879,6 +1879,9 @@
                 raise
             return (t, tz)
 
+    def audit(self):
+        return self._repo.wvfs.audit(self._path)
+
     def cmp(self, fctx):
         """compare with other file context
 
--- a/mercurial/merge.py	Sun Jun 25 22:30:14 2017 -0700
+++ b/mercurial/merge.py	Sun Jun 25 22:30:14 2017 -0700
@@ -1084,7 +1084,6 @@
     yields tuples for progress updates
     """
     verbose = repo.ui.verbose
-    audit = repo.wvfs.audit
     try:
         cwd = pycompat.getcwd()
     except OSError as err:
@@ -1096,7 +1095,7 @@
         repo.ui.debug(" %s: %s -> r\n" % (f, msg))
         if verbose:
             repo.ui.note(_("removing %s\n") % f)
-        audit(f)
+        wctx[f].audit()
         try:
             wctx[f].remove(ignoremissing=True)
         except OSError as inst:
@@ -1201,7 +1200,6 @@
         if f1 != f and move:
             moves.append(f1)
 
-    audit = repo.wvfs.audit
     _updating = _('updating')
     _files = _('files')
     progress = repo.ui.progress
@@ -1210,7 +1208,7 @@
     for f in moves:
         if os.path.lexists(repo.wjoin(f)):
             repo.ui.debug("removing %s\n" % f)
-            audit(f)
+            wctx[f].audit()
             wctx[f].remove()
 
     numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
@@ -1268,7 +1266,7 @@
         progress(_updating, z, item=f, total=numupdates, unit=_files)
         f0, flags = args
         repo.ui.note(_("moving %s to %s\n") % (f0, f))
-        audit(f)
+        wctx[f].audit()
         wctx[f].write(wctx.filectx(f0).data(), flags)
         wctx[f0].remove()
         updated += 1
@@ -1289,7 +1287,7 @@
         z += 1
         progress(_updating, z, item=f, total=numupdates, unit=_files)
         flags, = args
-        audit(f)
+        wctx[f].audit()
         wctx[f].setflags('l' in flags, 'x' in flags)
         updated += 1
 
@@ -1323,7 +1321,7 @@
             subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
                              overwrite, labels)
             continue
-        audit(f)
+        wctx[f].audit()
         complete, r = ms.preresolve(f, wctx)
         if not complete:
             numupdates += 1