##// END OF EJS Templates
shelve: rename stripnodes to nodestoprune...
Kostia Balytskyi -
r31555:7c7d3ad7 default
parent child Browse files
Show More
@@ -184,7 +184,7 b' class shelvedstate(object):'
184 wctx = nodemod.bin(fp.readline().strip())
184 wctx = nodemod.bin(fp.readline().strip())
185 pendingctx = nodemod.bin(fp.readline().strip())
185 pendingctx = nodemod.bin(fp.readline().strip())
186 parents = [nodemod.bin(h) for h in fp.readline().split()]
186 parents = [nodemod.bin(h) for h in fp.readline().split()]
187 stripnodes = [nodemod.bin(h) for h in fp.readline().split()]
187 nodestoprune = [nodemod.bin(h) for h in fp.readline().split()]
188 branchtorestore = fp.readline().strip()
188 branchtorestore = fp.readline().strip()
189 keep = fp.readline().strip() == cls._keep
189 keep = fp.readline().strip() == cls._keep
190 except (ValueError, TypeError) as err:
190 except (ValueError, TypeError) as err:
@@ -198,7 +198,7 b' class shelvedstate(object):'
198 obj.wctx = repo[wctx]
198 obj.wctx = repo[wctx]
199 obj.pendingctx = repo[pendingctx]
199 obj.pendingctx = repo[pendingctx]
200 obj.parents = parents
200 obj.parents = parents
201 obj.stripnodes = stripnodes
201 obj.nodestoprune = nodestoprune
202 obj.branchtorestore = branchtorestore
202 obj.branchtorestore = branchtorestore
203 obj.keep = keep
203 obj.keep = keep
204 except error.RepoLookupError as err:
204 except error.RepoLookupError as err:
@@ -207,7 +207,7 b' class shelvedstate(object):'
207 return obj
207 return obj
208
208
209 @classmethod
209 @classmethod
210 def save(cls, repo, name, originalwctx, pendingctx, stripnodes,
210 def save(cls, repo, name, originalwctx, pendingctx, nodestoprune,
211 branchtorestore, keep=False):
211 branchtorestore, keep=False):
212 fp = repo.vfs(cls._filename, 'wb')
212 fp = repo.vfs(cls._filename, 'wb')
213 fp.write('%i\n' % cls._version)
213 fp.write('%i\n' % cls._version)
@@ -217,7 +217,7 b' class shelvedstate(object):'
217 fp.write('%s\n' %
217 fp.write('%s\n' %
218 ' '.join([nodemod.hex(p) for p in repo.dirstate.parents()]))
218 ' '.join([nodemod.hex(p) for p in repo.dirstate.parents()]))
219 fp.write('%s\n' %
219 fp.write('%s\n' %
220 ' '.join([nodemod.hex(n) for n in stripnodes]))
220 ' '.join([nodemod.hex(n) for n in nodestoprune]))
221 fp.write('%s\n' % branchtorestore)
221 fp.write('%s\n' % branchtorestore)
222 fp.write('%s\n' % (cls._keep if keep else cls._nokeep))
222 fp.write('%s\n' % (cls._keep if keep else cls._nokeep))
223 fp.close()
223 fp.close()
@@ -562,7 +562,7 b' def unshelveabort(ui, repo, state, opts)'
562 raise
562 raise
563
563
564 mergefiles(ui, repo, state.wctx, state.pendingctx)
564 mergefiles(ui, repo, state.wctx, state.pendingctx)
565 repair.strip(ui, repo, state.stripnodes, backup=False,
565 repair.strip(ui, repo, state.nodestoprune, backup=False,
566 topic='shelve')
566 topic='shelve')
567 finally:
567 finally:
568 shelvedstate.clear(repo)
568 shelvedstate.clear(repo)
@@ -633,12 +633,12 b' def unshelvecontinue(ui, repo, state, op'
633 shelvectx = state.pendingctx
633 shelvectx = state.pendingctx
634 else:
634 else:
635 # only strip the shelvectx if the rebase produced it
635 # only strip the shelvectx if the rebase produced it
636 state.stripnodes.append(shelvectx.node())
636 state.nodestoprune.append(shelvectx.node())
637
637
638 mergefiles(ui, repo, state.wctx, shelvectx)
638 mergefiles(ui, repo, state.wctx, shelvectx)
639 restorebranch(ui, repo, state.branchtorestore)
639 restorebranch(ui, repo, state.branchtorestore)
640
640
641 repair.strip(ui, repo, state.stripnodes, backup=False, topic='shelve')
641 repair.strip(ui, repo, state.nodestoprune, backup=False, topic='shelve')
642 shelvedstate.clear(repo)
642 shelvedstate.clear(repo)
643 unshelvecleanup(ui, repo, state.name, opts)
643 unshelvecleanup(ui, repo, state.name, opts)
644 ui.status(_("unshelve of '%s' complete\n") % state.name)
644 ui.status(_("unshelve of '%s' complete\n") % state.name)
@@ -690,9 +690,9 b' def _rebaserestoredcommit(ui, repo, opts'
690 except error.InterventionRequired:
690 except error.InterventionRequired:
691 tr.close()
691 tr.close()
692
692
693 stripnodes = [repo.changelog.node(rev)
693 nodestoprune = [repo.changelog.node(rev)
694 for rev in xrange(oldtiprev, len(repo))]
694 for rev in xrange(oldtiprev, len(repo))]
695 shelvedstate.save(repo, basename, pctx, tmpwctx, stripnodes,
695 shelvedstate.save(repo, basename, pctx, tmpwctx, nodestoprune,
696 branchtorestore, opts.get('keep'))
696 branchtorestore, opts.get('keep'))
697
697
698 repo.vfs.rename('rebasestate', 'unshelverebasestate')
698 repo.vfs.rename('rebasestate', 'unshelverebasestate')
General Comments 0
You need to be logged in to leave comments. Login now