Show More
@@ -526,13 +526,13 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 |
|
|
529 | pctx = repo['.'] | |
530 |
tmpwctx = |
|
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 |
# ...-> |
|
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 |
|
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 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, |
|
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 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, |
|
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