##// END OF EJS Templates
shelve: repo['.'] is not a wctx but a pctx...
Mads Kiilerich -
r20958:df33c901 default
parent child Browse files
Show More
@@ -526,13 +526,13 b' def unshelve(ui, repo, *shelved, **opts)'
526 tr = repo.transaction('unshelve', report=lambda x: None)
526 tr = repo.transaction('unshelve', report=lambda x: None)
527 oldtiprev = len(repo)
527 oldtiprev = len(repo)
528
528
529 wctx = repo['.']
529 pctx = repo['.']
530 tmpwctx = wctx
530 tmpwctx = pctx
531 # The goal is to have a commit structure like so:
531 # The goal is to have a commit structure like so:
532 # ...-> wctx -> tmpwctx -> shelvectx
532 # ...-> pctx -> tmpwctx -> shelvectx
533 # where tmpwctx is an optional commit with the user's pending changes
533 # where tmpwctx is an optional commit with the user's pending changes
534 # and shelvectx is the unshelved changes. Then we merge it all down
534 # and shelvectx is the unshelved changes. Then we merge it all down
535 # to the original wctx.
535 # to the original pctx.
536
536
537 # Store pending changes in a commit
537 # Store pending changes in a commit
538 m, a, r, d = repo.status()[:4]
538 m, a, r, d = repo.status()[:4]
@@ -587,7 +587,7 b' def unshelve(ui, repo, *shelved, **opts)'
587
587
588 stripnodes = [repo.changelog.node(rev)
588 stripnodes = [repo.changelog.node(rev)
589 for rev in xrange(oldtiprev, len(repo))]
589 for rev in xrange(oldtiprev, len(repo))]
590 shelvedstate.save(repo, basename, wctx, tmpwctx, stripnodes)
590 shelvedstate.save(repo, basename, pctx, tmpwctx, stripnodes)
591
591
592 util.rename(repo.join('rebasestate'),
592 util.rename(repo.join('rebasestate'),
593 repo.join('unshelverebasestate'))
593 repo.join('unshelverebasestate'))
@@ -602,7 +602,7 b' def unshelve(ui, repo, *shelved, **opts)'
602 # rebase was a no-op, so it produced no child commit
602 # rebase was a no-op, so it produced no child commit
603 shelvectx = tmpwctx
603 shelvectx = tmpwctx
604
604
605 mergefiles(ui, repo, wctx, shelvectx)
605 mergefiles(ui, repo, pctx, shelvectx)
606 shelvedstate.clear(repo)
606 shelvedstate.clear(repo)
607
607
608 # The transaction aborting will strip all the commits for us,
608 # The transaction aborting will strip all the commits for us,
General Comments 0
You need to be logged in to leave comments. Login now