Patchwork [5,of,7,clowncopter] automv: reuse existing scutil._markchanges() function

login
register
mail settings
Submitter Martijn Pieters
Date Feb. 15, 2016, 5:24 p.m.
Message ID <14ed7e41f1afdc0250af.1455557099@mjpieters-mbp>
Download mbox | patch
Permalink /patch/13207/
State Accepted
Headers show

Comments

Martijn Pieters - Feb. 15, 2016, 5:24 p.m.
# HG changeset patch
# User Martijn Pieters <mjpieters@fb.com>
# Date 1455556398 0
#      Mon Feb 15 17:13:18 2016 +0000
# Node ID 14ed7e41f1afdc0250afe722669dfb4975f6ee94
# Parent  df7847e855528ed4702757dc89095ad8a7489e5e
automv: reuse existing scutil._markchanges() function.

Patch

diff --git a/hgext/automv.py b/hgext/automv.py
--- a/hgext/automv.py
+++ b/hgext/automv.py
@@ -40,7 +40,7 @@ 
             match = scmutil.match(repo[None], pats, opts)
             added, removed = _interestingfiles(repo, match)
             renames = _findrenames(repo, match, added, removed, threshold)
-            _markchanges(repo, renames)
+            scmutil._markchanges(repo, (), (), renames)
 
     return orig(ui, repo, *pats, **opts)
 
@@ -80,13 +80,3 @@ 
     if renames:
         repo.ui.status(_('detected move of %d files\n') % len(renames))
     return renames
-
-def _markchanges(repo, renames):
-    """Marks the files in renames as copied."""
-    wctx = repo[None]
-    wlock = repo.wlock()
-    try:
-        for dst, src in renames.iteritems():
-            wctx.copy(src, dst)
-    finally:
-        wlock.release()