# HG changeset patch # User Matt Harbison # Date 1422171949 18000 # Node ID 23438bceba046281e98b5bc5f3e5ac8482b2725f # Parent f903689680e66ecfee1a1cae99d4d719f81c2a93 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. diff -r f903689680e6 -r 23438bceba04 hgext/largefiles/overrides.py --- 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 diff -r f903689680e6 -r 23438bceba04 hgext/largefiles/uisetup.py --- 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) diff -r f903689680e6 -r 23438bceba04 tests/test-subrepo-deep-nested-change.t --- 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 ..