Patchwork [1,of,4,shelve-ext,v3] shelve: rename nodestoprune to nodestoremove

login
register
mail settings
Submitter Kostia Balytskyi
Date April 10, 2017, 11:28 p.m.
Message ID <18d5dc2e81ff328facdd.1491866913@devvm1416.lla2.facebook.com>
Download mbox | patch
Permalink /patch/20097/
State Accepted
Headers show

Comments

Kostia Balytskyi - April 10, 2017, 11:28 p.m.
# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# Date 1491863529 25200
#      Mon Apr 10 15:32:09 2017 -0700
# Node ID 18d5dc2e81ff328facddd7c0294d7301a057504d
# Parent  f6d77af84ef3e936b15634759df2718d5363b78a
shelve: rename nodestoprune to nodestoremove

As per feedback from the community.
Yuya Nishihara - April 12, 2017, 2:34 p.m.
On Mon, 10 Apr 2017 16:28:33 -0700, Kostia Balytskyi wrote:
> # HG changeset patch
> # User Kostia Balytskyi <ikostia@fb.com>
> # Date 1491863529 25200
> #      Mon Apr 10 15:32:09 2017 -0700
> # Node ID 18d5dc2e81ff328facddd7c0294d7301a057504d
> # Parent  f6d77af84ef3e936b15634759df2718d5363b78a
> shelve: rename nodestoprune to nodestoremove
> 
> As per feedback from the community.

Queued this, thanks.

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -187,7 +187,7 @@  class shelvedstate(object):
             wctx = nodemod.bin(fp.readline().strip())
             pendingctx = nodemod.bin(fp.readline().strip())
             parents = [nodemod.bin(h) for h in fp.readline().split()]
-            nodestoprune = [nodemod.bin(h) for h in fp.readline().split()]
+            nodestoremove = [nodemod.bin(h) for h in fp.readline().split()]
             branchtorestore = fp.readline().strip()
             keep = fp.readline().strip() == cls._keep
             activebook = fp.readline().strip()
@@ -202,7 +202,7 @@  class shelvedstate(object):
             obj.wctx = repo[wctx]
             obj.pendingctx = repo[pendingctx]
             obj.parents = parents
-            obj.nodestoprune = nodestoprune
+            obj.nodestoremove = nodestoremove
             obj.branchtorestore = branchtorestore
             obj.keep = keep
             obj.activebookmark = ''
@@ -214,7 +214,7 @@  class shelvedstate(object):
         return obj
 
     @classmethod
-    def save(cls, repo, name, originalwctx, pendingctx, nodestoprune,
+    def save(cls, repo, name, originalwctx, pendingctx, nodestoremove,
              branchtorestore, keep=False, activebook=''):
         fp = repo.vfs(cls._filename, 'wb')
         fp.write('%i\n' % cls._version)
@@ -224,7 +224,7 @@  class shelvedstate(object):
         fp.write('%s\n' %
                  ' '.join([nodemod.hex(p) for p in repo.dirstate.parents()]))
         fp.write('%s\n' %
-                 ' '.join([nodemod.hex(n) for n in nodestoprune]))
+                 ' '.join([nodemod.hex(n) for n in nodestoremove]))
         fp.write('%s\n' % branchtorestore)
         fp.write('%s\n' % (cls._keep if keep else cls._nokeep))
         fp.write('%s\n' % (activebook or cls._noactivebook))
@@ -583,7 +583,7 @@  def unshelveabort(ui, repo, state, opts)
                 raise
 
             mergefiles(ui, repo, state.wctx, state.pendingctx)
-            repair.strip(ui, repo, state.nodestoprune, backup=False,
+            repair.strip(ui, repo, state.nodestoremove, backup=False,
                          topic='shelve')
         finally:
             shelvedstate.clear(repo)
@@ -650,12 +650,13 @@  def unshelvecontinue(ui, repo, state, op
             shelvectx = state.pendingctx
         else:
             # only strip the shelvectx if the rebase produced it
-            state.nodestoprune.append(shelvectx.node())
+            state.nodestoremove.append(shelvectx.node())
 
         mergefiles(ui, repo, state.wctx, shelvectx)
         restorebranch(ui, repo, state.branchtorestore)
 
-        repair.strip(ui, repo, state.nodestoprune, backup=False, topic='shelve')
+        repair.strip(ui, repo, state.nodestoremove, backup=False,
+                     topic='shelve')
         _restoreactivebookmark(repo, state.activebookmark)
         shelvedstate.clear(repo)
         unshelvecleanup(ui, repo, state.name, opts)
@@ -708,9 +709,9 @@  def _rebaserestoredcommit(ui, repo, opts
     except error.InterventionRequired:
         tr.close()
 
-        nodestoprune = [repo.changelog.node(rev)
-                        for rev in xrange(oldtiprev, len(repo))]
-        shelvedstate.save(repo, basename, pctx, tmpwctx, nodestoprune,
+        nodestoremove = [repo.changelog.node(rev)
+                         for rev in xrange(oldtiprev, len(repo))]
+        shelvedstate.save(repo, basename, pctx, tmpwctx, nodestoremove,
                           branchtorestore, opts.get('keep'), activebookmark)
 
         repo.vfs.rename('rebasestate', 'unshelverebasestate')