diff -r e9293c5f8bb9 -r 29e4a77b5305 hgext/shelve.py --- a/hgext/shelve.py Tue Nov 13 12:32:05 2018 -0800 +++ b/hgext/shelve.py Tue Nov 13 17:14:47 2018 -0800 @@ -430,8 +430,12 @@ shelvedfile(repo, name, 'shelve').writeinfo(info) bases = list(mutableancestors(repo[node])) shelvedfile(repo, name, 'hg').writebundle(bases, node) + # Create a matcher so that prefetch doesn't attempt to fetch the entire + # repository pointlessly. + match = scmutil.matchfiles(repo, repo[node].files()) with shelvedfile(repo, name, patchextension).opener('wb') as fp: - cmdutil.exportfile(repo, [node], fp, opts=mdiff.diffopts(git=True)) + cmdutil.exportfile(repo, [node], fp, opts=mdiff.diffopts(git=True), + match=match) def _includeunknownfiles(repo, pats, opts, extra): s = repo.status(match=scmutil.match(repo[None], pats, opts),