largefiles: report the source of copied/moved largefiles in status -C
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 25 Jan 2015 02:45:49 -0500
changeset 24230 23438bceba04
parent 24229 f903689680e6
child 24231 cc5b46f5318d
largefiles: report the source of copied/moved largefiles in status -C Previously, the source was silently skipped because the largefile was in the list of changed files, but the standin was in the copies dictionary. The source is only displayed if the changed file is a key in the copies dictionary.
hgext/largefiles/overrides.py
hgext/largefiles/uisetup.py
tests/test-subrepo-deep-nested-change.t
--- a/hgext/largefiles/overrides.py	Sun Mar 08 00:04:03 2015 -0500
+++ b/hgext/largefiles/overrides.py	Sun Jan 25 02:45:49 2015 -0500
@@ -578,6 +578,15 @@
         repo.wwrite(fcd.path(), fco.data(), fco.flags())
     return 0
 
+def copiespathcopies(orig, ctx1, ctx2):
+    copies = orig(ctx1, ctx2)
+    updated = {}
+
+    for k, v in copies.iteritems():
+        updated[lfutil.splitstandin(k) or k] = lfutil.splitstandin(v) or v
+
+    return updated
+
 # Copy first changes the matchers to match standins instead of
 # largefiles.  Then it overrides util.copyfile in that function it
 # checks if the destination largefile already exists. It also keeps a
--- a/hgext/largefiles/uisetup.py	Sun Mar 08 00:04:03 2015 -0500
+++ b/hgext/largefiles/uisetup.py	Sun Jan 25 02:45:49 2015 -0500
@@ -9,7 +9,7 @@
 '''setup for largefiles extension: uisetup'''
 
 from mercurial import archival, cmdutil, commands, extensions, filemerge, hg, \
-    httppeer, merge, scmutil, sshpeer, wireproto, revset, subrepo
+    httppeer, merge, scmutil, sshpeer, wireproto, revset, subrepo, copies
 from mercurial.i18n import _
 from mercurial.hgweb import hgweb_mod, webcommands
 
@@ -37,6 +37,8 @@
     extensions.wrapfunction(cmdutil, 'remove', overrides.cmdutilremove)
     extensions.wrapfunction(cmdutil, 'forget', overrides.cmdutilforget)
 
+    extensions.wrapfunction(copies, 'pathcopies', overrides.copiespathcopies)
+
     # Subrepos call status function
     entry = extensions.wrapcommand(commands.table, 'status',
                                    overrides.overridestatus)
--- a/tests/test-subrepo-deep-nested-change.t	Sun Mar 08 00:04:03 2015 -0500
+++ b/tests/test-subrepo-deep-nested-change.t	Sun Jan 25 02:45:49 2015 -0500
@@ -419,4 +419,24 @@
   A a.dat
   A a.txt
 
+  $ hg ci -m "add a.*"
+  $ hg mv a.dat b.dat
+  $ hg mv foo/bar/abc foo/bar/def
+  $ hg status -C
+  A b.dat
+    a.dat
+  A foo/bar/def
+    foo/bar/abc
+  R a.dat
+  R foo/bar/abc
+
+  $ hg ci -m "move large and normal"
+  $ hg status -C --rev '.^' --rev .
+  A b.dat
+    a.dat
+  A foo/bar/def
+    foo/bar/abc
+  R a.dat
+  R foo/bar/abc
+
   $ cd ..