Patchwork [6,of,6] workingfilectx: add audit() as a wrapper for wvfs.audit()

login
register
mail settings
Submitter Phillip Cohen
Date June 26, 2017, 5:36 a.m.
Message ID <d2f2b5a60476e18e69fd.1498455366@phillco-mbp.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/21725/
State Accepted
Headers show

Comments

Phillip Cohen - June 26, 2017, 5:36 a.m.
# HG changeset patch
# User Phil Cohen <phillco@fb.com>
# Date 1498455014 25200
#      Sun Jun 25 22:30:14 2017 -0700
# Node ID d2f2b5a60476e18e69fdcd76ac296d37bb69b112
# Parent  8ef73d9c80f5be80fbcce7161295a4d6f1eb96f6
workingfilectx: add audit() as a wrapper for wvfs.audit()
Augie Fackler - June 26, 2017, 2:49 p.m.
On Sun, Jun 25, 2017 at 10:36:06PM -0700, Phil Cohen wrote:
> # HG changeset patch
> # User Phil Cohen <phillco@fb.com>
> # Date 1498455014 25200
> #      Sun Jun 25 22:30:14 2017 -0700
> # Node ID d2f2b5a60476e18e69fdcd76ac296d37bb69b112
> # Parent  8ef73d9c80f5be80fbcce7161295a4d6f1eb96f6
> workingfilectx: add audit() as a wrapper for wvfs.audit()

queued, thanks
Sean Farley - July 5, 2017, 12:21 a.m.
Phil Cohen <phillco@fb.com> writes:

> # HG changeset patch
> # User Phil Cohen <phillco@fb.com>
> # Date 1498455014 25200
> #      Sun Jun 25 22:30:14 2017 -0700
> # Node ID d2f2b5a60476e18e69fdcd76ac296d37bb69b112
> # Parent  8ef73d9c80f5be80fbcce7161295a4d6f1eb96f6
> workingfilectx: add audit() as a wrapper for wvfs.audit()

Aw yeah; looks great man!

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1882,6 +1882,9 @@ 
                 raise
             return (t, tz)
 
+    def audit(self):
+        return self._repo.wvfs.audit(self._path)
+
     def cmp(self, fctx):
         """compare with other file context
 
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1096,7 +1096,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 +1201,6 @@ 
         if f1 != f and move:
             moves.append(f1)
 
-    audit = repo.wvfs.audit
     _updating = _('updating')
     _files = _('files')
     progress = repo.ui.progress
@@ -1210,7 +1209,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 +1267,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 +1288,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 +1322,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