Patchwork [6,of,6] shelve: using `targetphase` while unbundling

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 6, 2014, 4:27 a.m.
Message ID <e8c50069c6b8b8ed2c33.1407299254@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5288/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 6, 2014, 4:27 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1407271873 25200
#      Tue Aug 05 13:51:13 2014 -0700
# Node ID e8c50069c6b8b8ed2c336e48c2bc3d2b2b909ed1
# Parent  d11c2e8f86f1de73e2922dbf6a42cc38f61e1bef
shelve: using `targetphase` while unbundling

This remove the last manual phase movement in shelve.
Matt Mackall - Aug. 6, 2014, 7:43 a.m.
On Tue, 2014-08-05 at 21:27 -0700, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1407271873 25200
> #      Tue Aug 05 13:51:13 2014 -0700
> # Node ID e8c50069c6b8b8ed2c336e48c2bc3d2b2b909ed1
> # Parent  d11c2e8f86f1de73e2922dbf6a42cc38f61e1bef
> shelve: using `targetphase` while unbundling

Queued for default, thanks.

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -71,11 +71,12 @@  class shelvedfile(object):
     def applybundle(self):
         fp = self.opener()
         try:
             gen = exchange.readbundle(self.repo.ui, fp, self.fname, self.vfs)
             changegroup.addchangegroup(self.repo, gen, 'unshelve',
-                                       'bundle:' + self.vfs.join(self.fname))
+                                       'bundle:' + self.vfs.join(self.fname),
+                                       targetphase=phases.secret)
         finally:
             fp.close()
 
     def writebundle(self, cg):
         changegroup.writebundle(cg, self.fname, 'HG10UN', self.vfs)
@@ -576,12 +577,10 @@  def unshelve(ui, repo, *shelved, **opts)
             node = cmdutil.commit(ui, repo, commitfunc, [], tempopts)
             tmpwctx = repo[node]
 
         ui.quiet = True
         shelvedfile(repo, basename, 'hg').applybundle()
-        nodes = [ctx.node() for ctx in repo.set('%d:', oldtiprev)]
-        phases.retractboundary(repo, phases.secret, nodes)
 
         ui.quiet = oldquiet
 
         shelvectx = repo['tip']