##// END OF EJS Templates
shelve: refactor _shelvecreatedcommit's match object into calling site...
Jordi Gutiérrez Hermoso -
r42179:9b78bbb7 default
parent child Browse files
Show More
@@ -420,14 +420,11 b' def _nothingtoshelvemessaging(ui, repo, '
420 420 else:
421 421 ui.status(_("nothing changed\n"))
422 422
423 def _shelvecreatedcommit(repo, node, name):
423 def _shelvecreatedcommit(repo, node, name, match):
424 424 info = {'node': nodemod.hex(node)}
425 425 shelvedfile(repo, name, 'shelve').writeinfo(info)
426 426 bases = list(mutableancestors(repo[node]))
427 427 shelvedfile(repo, name, 'hg').writebundle(bases, node)
428 # Create a matcher so that prefetch doesn't attempt to fetch the entire
429 # repository pointlessly.
430 match = scmutil.matchfiles(repo, repo[node].files())
431 428 with shelvedfile(repo, name, patchextension).opener('wb') as fp:
432 429 cmdutil.exportfile(repo, [node], fp, opts=mdiff.diffopts(git=True),
433 430 match=match)
@@ -501,7 +498,10 b' def _docreatecmd(ui, repo, pats, opts):'
501 498 _nothingtoshelvemessaging(ui, repo, pats, opts)
502 499 return 1
503 500
504 _shelvecreatedcommit(repo, node, name)
501 # Create a matcher so that prefetch doesn't attempt to fetch
502 # the entire repository pointlessly
503 match = scmutil.matchfiles(repo, repo[node].files())
504 _shelvecreatedcommit(repo, node, name, match)
505 505
506 506 if ui.formatted():
507 507 desc = stringutil.ellipsis(desc, ui.termwidth())
General Comments 0
You need to be logged in to leave comments. Login now