Mercurial > hg
comparison hgext/largefiles/overrides.py @ 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 | f1e6b86da4c0 |
children | 70afc58c32d3 |
comparison
equal
deleted
inserted
replaced
23617:f1e6b86da4c0 | 23618:9dd5dfeaab4c |
---|---|
154 | 154 |
155 def removelargefiles(ui, repo, isaddremove, *pats, **opts): | 155 def removelargefiles(ui, repo, isaddremove, *pats, **opts): |
156 after = opts.get('after') | 156 after = opts.get('after') |
157 if not pats and not after: | 157 if not pats and not after: |
158 raise util.Abort(_('no files specified')) | 158 raise util.Abort(_('no files specified')) |
159 m = scmutil.match(repo[None], pats, opts) | 159 m = composelargefilematcher(scmutil.match(repo[None], pats, opts), |
160 repo[None].manifest()) | |
160 try: | 161 try: |
161 repo.lfstatus = True | 162 repo.lfstatus = True |
162 s = repo.status(match=m, clean=True) | 163 s = repo.status(match=m, clean=True) |
163 finally: | 164 finally: |
164 repo.lfstatus = False | 165 repo.lfstatus = False |