Mercurial > hg
comparison hgext/shelve.py @ 22042:8d99c107b041
shelve: use `targetphase` while unbundling
This removes the last manual phase movement in shelve.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 05 Aug 2014 13:51:13 -0700 |
parents | 122fa73657c6 |
children | 445472225ccd |
comparison
equal
deleted
inserted
replaced
22041:97f86ce79abe | 22042:8d99c107b041 |
---|---|
71 def applybundle(self): | 71 def applybundle(self): |
72 fp = self.opener() | 72 fp = self.opener() |
73 try: | 73 try: |
74 gen = exchange.readbundle(self.repo.ui, fp, self.fname, self.vfs) | 74 gen = exchange.readbundle(self.repo.ui, fp, self.fname, self.vfs) |
75 changegroup.addchangegroup(self.repo, gen, 'unshelve', | 75 changegroup.addchangegroup(self.repo, gen, 'unshelve', |
76 'bundle:' + self.vfs.join(self.fname)) | 76 'bundle:' + self.vfs.join(self.fname), |
77 targetphase=phases.secret) | |
77 finally: | 78 finally: |
78 fp.close() | 79 fp.close() |
79 | 80 |
80 def writebundle(self, cg): | 81 def writebundle(self, cg): |
81 changegroup.writebundle(cg, self.fname, 'HG10UN', self.vfs) | 82 changegroup.writebundle(cg, self.fname, 'HG10UN', self.vfs) |
577 node = cmdutil.commit(ui, repo, commitfunc, [], tempopts) | 578 node = cmdutil.commit(ui, repo, commitfunc, [], tempopts) |
578 tmpwctx = repo[node] | 579 tmpwctx = repo[node] |
579 | 580 |
580 ui.quiet = True | 581 ui.quiet = True |
581 shelvedfile(repo, basename, 'hg').applybundle() | 582 shelvedfile(repo, basename, 'hg').applybundle() |
582 nodes = [ctx.node() for ctx in repo.set('%d:', oldtiprev)] | |
583 phases.retractboundary(repo, phases.secret, nodes) | |
584 | 583 |
585 ui.quiet = oldquiet | 584 ui.quiet = oldquiet |
586 | 585 |
587 shelvectx = repo['tip'] | 586 shelvectx = repo['tip'] |
588 | 587 |