Mercurial > hg
diff hgext/lfs/__init__.py @ 35922:0b79f99fd7b0
lfs: prefetch lfs blobs when applying merge updates
In addition to merge, this method ultimately gets called by many commands:
- backout
- bisect
- clone
- fetch
- graft
- import (without --bypass)
- pull -u
- rebase
- strip
- share
- transplant
- unbundle
- update
Additionally, it's also called by histedit, shelve, unshelve, and split, but it
seems that the related blobs should always be available locally for these.
For `hg update`, it happens after the normal argument checking and pre-update
hook processing, and remote corruption is detected prior to manipulating the
working directory. Other commands could use this treatment (archive, cat,
revert, etc), but this covers so many of the frequently used bulk commands, it
seems like a good starting point.
Losing the verbose message that prints the file name before a corrupt blob
aborts the command is a little sad, because there's no easy way to go from oid
to file name. I'd like to change that message to list the file name so it looks
cleaner and less cryptic, but the pointer object is nowhere near where it needs
to be to do this. So punt on that for now.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 03 Feb 2018 21:26:12 -0500 |
parents | 6bd2846a82e8 |
children | d857cad588e4 |
line wrap: on
line diff
--- a/hgext/lfs/__init__.py Sat Jan 27 14:53:16 2018 -0500 +++ b/hgext/lfs/__init__.py Sat Feb 03 21:26:12 2018 -0500 @@ -137,6 +137,7 @@ fileset, hg, localrepo, + merge, minifileset, node, pycompat, @@ -331,6 +332,8 @@ wrapfunction(hg, 'clone', wrapper.hgclone) wrapfunction(hg, 'postshare', wrapper.hgpostshare) + wrapfunction(merge, 'applyupdates', wrapper.mergemodapplyupdates) + # Make bundle choose changegroup3 instead of changegroup2. This affects # "hg bundle" command. Note: it does not cover all bundle formats like # "packed1". Using "packed1" with lfs will likely cause trouble.