Mercurial > public > mercurial-scm > hg
diff hgext/largefiles/lfcommands.py @ 17823:0fc1ce271ee6
largefiles: fix a traceback in lfconvert if a largefile is missing (issue3519)
The largefile may be missing for various reasons, including that a remote
repository was cloned without the --all-largefiles option. Therefore, it seems
reasonable to attempt to download the missing files and failing that, abort and
indicate the affected file and revision so the user can manually fix the
problem.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 14 Oct 2012 14:44:08 -0400 |
parents | 434e5bd615fc |
children | e16982a74bf7 40185df018d7 |
line wrap: on
line diff
--- a/hgext/largefiles/lfcommands.py Thu Oct 18 16:34:13 2012 -0500 +++ b/hgext/largefiles/lfcommands.py Sun Oct 14 14:44:08 2012 -0400 @@ -141,7 +141,17 @@ hash = fctx.data().strip() path = lfutil.findfile(rsrc, hash) - ### TODO: What if the file is not cached? + + # If one file is missing, likely all files from this rev are + if path is None: + cachelfiles(ui, rsrc, ctx.node()) + path = lfutil.findfile(rsrc, hash) + + if path is None: + raise util.Abort( + _("missing largefile \'%s\' from revision %s") + % (f, node.hex(ctx.node()))) + data = '' fd = None try: