Mercurial > hg
comparison tests/test-largefiles-cache.t @ 23618:9dd5dfeaab4c stable
largefiles: fix a spurious missing file warning with 'remove -A' (issue4053)
The bug report doesn't mention largefiles, but the given recipe doesn't fail
unless the largefiles extension is loaded. The problem only affected normal
files, whether or not any largefiles are committed, and only files that have
not been committed yet. (Files with an 'a' state are dropped from dirstate,
not marked removed.) Further, if the named normal file never existed, the
warning would be printed out twice.
The problem is that the core implementation of remove() calls repo.status(),
which eventually triggers a dirstate.walk(). When the file isn't seen in the
filesystem during the walk, the exception handling finds the file in
dirstate, so it doesn't complain. However, the largefiles implementation
called status() again with all of the original files (including the normal
ones, just dropped). This time, the exception handler doesn't find the file
in dirstate and does complain. This simply excludes the normal files from
the second repo.status() call, which the largefiles extension has no interest
is processing anyway.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 21 Dec 2014 15:04:13 -0500 |
parents | 7731a2281cf0 |
children | 70afc58c32d3 |
comparison
equal
deleted
inserted
replaced
23617:f1e6b86da4c0 | 23618:9dd5dfeaab4c |
---|---|
132 640 | 132 640 |
133 | 133 |
134 $ cd .. | 134 $ cd .. |
135 | 135 |
136 #endif | 136 #endif |
137 | |
138 Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say | |
139 it is missing, but a remove on a nonexistant unknown file still should) | |
140 | |
141 $ cd src | |
142 $ touch x | |
143 $ hg add x | |
144 $ mv x y | |
145 $ hg remove -A x y ENOENT | |
146 ENOENT: * (glob) | |
147 not removing y: file is untracked | |
148 [1] |