Mercurial > public > mercurial-scm > hg-stable
diff tests/test-largefiles.t @ 17658:a02c1ffddae9 stable
largefiles: handle commit -A properly, after a --large commit (issue3542)
Previous to this, 'commit -A' would add as normal files, files that were already
committed as largefiles, resulting in files being listed twice by 'status -A'.
It also missed when (only) a largefile was deleted, even though status reported
it as '!'. This also has the side effect of properly reporting the state of the
affected largefiles in the post commit hook after a remove that also affected a
normal file (the largefiles used to be 'R', now are properly absent).
Since scmutil.addremove() is called both by the ui command (after some trivial
argument validation) and during the commit process when -A is specified, it
seems like a more appropriate method to wrap than the addremove command.
Currently, a repo is only enabled to use largefiles after an add that explicitly
identifies some file as large, and a subsequent commit. Therefore, this patch
only changes behavior after such a largefile enabling commit.
Note that in the test, if the final commit had a '-v', 'removing large8' would
be printed twice. Both of these originate in removelargefiles(). The first
print is in verbose mode after traversing remove + forget, the second is because
the '_isaddremove' attr is set and 'after' is not.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 30 Jul 2012 20:56:41 -0400 |
parents | 6e2ab601be3f |
children | ae57920ac188 |
line wrap: on
line diff
--- a/tests/test-largefiles.t Tue Sep 18 19:46:15 2012 +0900 +++ b/tests/test-largefiles.t Mon Jul 30 20:56:41 2012 -0400 @@ -543,6 +543,33 @@ C sub2/large6 C sub2/large7 +Test commit -A (issue 3542) + $ echo large8 > large8 + $ hg add --large large8 + $ hg ci -Am 'this used to add large8 as normal and commit both' + Invoking status precommit hook + A large8 + Invoking status postcommit hook + C large8 + C normal + C normal3 + C sub/large4 + C sub/normal4 + C sub2/large6 + C sub2/large7 + $ rm large8 + $ hg ci -Am 'this used to not notice the rm' + removing large8 + Invoking status precommit hook + R large8 + Invoking status postcommit hook + C normal + C normal3 + C sub/large4 + C sub/normal4 + C sub2/large6 + C sub2/large7 + Test that a standin can't be added as a large file $ touch large @@ -588,8 +615,19 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: removed large + changeset: 13:0a3e75774479 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: this used to add large8 as normal and commit both + + changeset: 14:84f3d378175c + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: this used to not notice the rm + searching for changes largefiles to upload: + large8 large foo