automv: reuse existing scutil._markchanges() function
authorMartijn Pieters <mjpieters@fb.com>
Mon, 15 Feb 2016 17:13:18 +0000
changeset 28150 7a984cece04a
parent 28149 d356d5250ab2
child 28151 74e3d634a30e
automv: reuse existing scutil._markchanges() function
hgext/automv.py
--- a/hgext/automv.py	Mon Feb 15 17:01:33 2016 +0000
+++ b/hgext/automv.py	Mon Feb 15 17:13:18 2016 +0000
@@ -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()