Mercurial > public > mercurial-scm > hg-stable
diff hgext/largefiles/overrides.py @ 17878:d1d0140287b8 stable
largefiles: don't copy largefiles from working dir to the store while converting
Previously, if one or more largefiles for a repo being converted were not in the
usercache, the convert would abort with a reference to the largefile being
missing (as opposed to the previous patch, where the standin was referenced as
missing). This is because commitctx() tries to copy all largefiles to the
local store, first from the user cache, and if the file isn't found there, from
the working directory. No files will exist in the working directory during a
convert, however. It is not sufficient to force the source repo to be local
before proceeding, because clone and pull do not download largefiles by default.
This is slightly less than ideal because while the conversion will now complete,
it won't be possible to update to revs with missing largefiles unless the user
intervenes manually, because there is no default path pointing back to the
source repo. Ideally these files would be cached during the conversion.
This check could have been done in reposetup.commitctx() instead, but this
ensures the local store directory is created, which is necessary to enable the
standin matcher.
The rm -> 'rm -f' change in the test is to temporarily suppress an error
clearing the cache- as noted, the cache is is not repopulated during convert.
When that is fixed, this can be changed back and the verification errors will
disappear too.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 23 Oct 2012 21:32:19 -0400 |
parents | 1e4eb1faba6e |
children | ba0a1701c81a |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Tue Oct 23 21:07:14 2012 -0400 +++ b/hgext/largefiles/overrides.py Tue Oct 23 21:32:19 2012 -0400 @@ -1113,3 +1113,11 @@ result = orig(ui, repo, file1, *pats, **opts) return result return lfcommands.catlfile(repo, file1, ctx.rev(), opts.get('output')) + +def mercurialsinkbefore(orig, sink): + sink.repo._isconverting = True + orig(sink) + +def mercurialsinkafter(orig, sink): + sink.repo._isconverting = False + orig(sink)