Patchwork [3,of,6,misc] shelve: repo['.'] is not a wctx but a pctx

login
register
mail settings
Submitter Mads Kiilerich
Date April 7, 2014, 9:11 p.m.
Message ID <6f9338816a38cacf8aea.1396905095@mk-desktop>
Download mbox | patch
Permalink /patch/4248/
State Accepted
Commit df33c901443051a1af58123957218b98220898df
Headers show

Comments

Mads Kiilerich - April 7, 2014, 9:11 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1396905020 -7200
#      Mon Apr 07 23:10:20 2014 +0200
# Node ID 6f9338816a38cacf8aeaa89059311b35752134bd
# Parent  578f5c46a3389f5096c05822f868c08905e23fb7
shelve: repo['.'] is not a wctx but a pctx

Don't confuse hackers!

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -526,13 +526,13 @@  def unshelve(ui, repo, *shelved, **opts)
         tr = repo.transaction('unshelve', report=lambda x: None)
         oldtiprev = len(repo)
 
-        wctx = repo['.']
-        tmpwctx = wctx
+        pctx = repo['.']
+        tmpwctx = pctx
         # The goal is to have a commit structure like so:
-        # ...-> wctx -> tmpwctx -> shelvectx
+        # ...-> pctx -> tmpwctx -> shelvectx
         # where tmpwctx is an optional commit with the user's pending changes
         # and shelvectx is the unshelved changes. Then we merge it all down
-        # to the original wctx.
+        # to the original pctx.
 
         # Store pending changes in a commit
         m, a, r, d = repo.status()[:4]
@@ -587,7 +587,7 @@  def unshelve(ui, repo, *shelved, **opts)
 
                 stripnodes = [repo.changelog.node(rev)
                               for rev in xrange(oldtiprev, len(repo))]
-                shelvedstate.save(repo, basename, wctx, tmpwctx, stripnodes)
+                shelvedstate.save(repo, basename, pctx, tmpwctx, stripnodes)
 
                 util.rename(repo.join('rebasestate'),
                             repo.join('unshelverebasestate'))
@@ -602,7 +602,7 @@  def unshelve(ui, repo, *shelved, **opts)
                 # rebase was a no-op, so it produced no child commit
                 shelvectx = tmpwctx
 
-        mergefiles(ui, repo, wctx, shelvectx)
+        mergefiles(ui, repo, pctx, shelvectx)
         shelvedstate.clear(repo)
 
         # The transaction aborting will strip all the commits for us,