shelve: repo['.'] is not a wctx but a pctx
authorMads Kiilerich <madski@unity3d.com>
Mon, 07 Apr 2014 23:10:20 +0200
changeset 20958 df33c9014430
parent 20956 dbf0fa39a5b8
child 20959 b6e0616d08cb
shelve: repo['.'] is not a wctx but a pctx Don't confuse hackers!
hgext/shelve.py
--- a/hgext/shelve.py	Fri Apr 04 16:41:51 2014 -0700
+++ b/hgext/shelve.py	Mon Apr 07 23:10:20 2014 +0200
@@ -526,13 +526,13 @@
         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 @@
 
                 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 @@
                 # 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,