##// END OF EJS Templates
phase-shelve: Extract function for _optimized_match for re-use
Jason R. Coombs -
r50320:35c9f0bc default
parent child Browse files
Show More
@@ -210,6 +210,15 b' class Shelf:'
210 self.vfs.tryunlink(self.name + b'.' + ext)
210 self.vfs.tryunlink(self.name + b'.' + ext)
211
211
212
212
213 def _optimized_match(repo, node):
214 """
215 Create a matcher so that prefetch doesn't attempt to fetch
216 the entire repository pointlessly, and as an optimisation
217 for movedirstate, if needed.
218 """
219 return scmutil.matchfiles(repo, repo[node].files())
220
221
213 class shelvedstate:
222 class shelvedstate:
214 """Handle persistence during unshelving operations.
223 """Handle persistence during unshelving operations.
215
224
@@ -579,10 +588,7 b' def _docreatecmd(ui, repo, pats, opts):'
579 _nothingtoshelvemessaging(ui, repo, pats, opts)
588 _nothingtoshelvemessaging(ui, repo, pats, opts)
580 return 1
589 return 1
581
590
582 # Create a matcher so that prefetch doesn't attempt to fetch
591 match = _optimized_match(repo, node)
583 # the entire repository pointlessly, and as an optimisation
584 # for movedirstate, if needed.
585 match = scmutil.matchfiles(repo, repo[node].files())
586 _shelvecreatedcommit(repo, node, name, match)
592 _shelvecreatedcommit(repo, node, name, match)
587
593
588 ui.status(_(b'shelved as %s\n') % name)
594 ui.status(_(b'shelved as %s\n') % name)
@@ -957,7 +963,7 b' def _createunshelvectx(ui, repo, shelvec'
957 user=shelvectx.user(),
963 user=shelvectx.user(),
958 )
964 )
959 if snode:
965 if snode:
960 m = scmutil.matchfiles(repo, repo[snode].files())
966 m = _optimized_match(repo, snode)
961 _shelvecreatedcommit(repo, snode, basename, m)
967 _shelvecreatedcommit(repo, snode, basename, m)
962
968
963 return newnode, bool(snode)
969 return newnode, bool(snode)
General Comments 0
You need to be logged in to leave comments. Login now