equal
deleted
inserted
replaced
208 def delete(self): |
208 def delete(self): |
209 for ext in shelvefileextensions: |
209 for ext in shelvefileextensions: |
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 |
216 Handles saving and restoring a shelved state. Ensures that different |
225 Handles saving and restoring a shelved state. Ensures that different |
217 versions of a shelved state are possible and handles them appropriately. |
226 versions of a shelved state are possible and handles them appropriately. |
577 ) |
586 ) |
578 if not node: |
587 if not node: |
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) |
589 if opts[b'keep']: |
595 if opts[b'keep']: |
590 with repo.dirstate.parentchange(): |
596 with repo.dirstate.parentchange(): |
955 text=shelvectx.description(), |
961 text=shelvectx.description(), |
956 extra=shelvectx.extra(), |
962 extra=shelvectx.extra(), |
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) |
964 |
970 |
965 |
971 |