comparison hgext/shelve.py @ 20413:0ac94c0a3a38

shelve: status messages from unshelve It was hard for the user to know what was going on when unshelving - especially if the user had to resolve conflicts and thus got to see the intermediate states. Seeing that pending changes was gone could scare the user, make him panic, and do stuff that really made him lose data. Merging (both when rebasing and with pending changes) also requires some understanding of where in the process you are and what you are merging. To help the user we now show a couple of status messages (when relevant): temporarily committing pending changes (restore with 'hg unshelve --abort') rebasing shelved changes
author Mads Kiilerich <madski@unity3d.com>
date Mon, 10 Feb 2014 00:54:27 +0100
parents e584fc30456b
children 24a443948627
comparison
equal deleted inserted replaced
20412:e584fc30456b 20413:0ac94c0a3a38
535 # to the original wctx. 535 # to the original wctx.
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]
539 if m or a or r or d: 539 if m or a or r or d:
540 ui.status(_("temporarily committing pending changes "
541 "(restore with 'hg unshelve --abort')\n"))
540 def commitfunc(ui, repo, message, match, opts): 542 def commitfunc(ui, repo, message, match, opts):
541 hasmq = util.safehasattr(repo, 'mq') 543 hasmq = util.safehasattr(repo, 'mq')
542 if hasmq: 544 if hasmq:
543 saved, repo.mq.checkapplied = repo.mq.checkapplied, False 545 saved, repo.mq.checkapplied = repo.mq.checkapplied, False
544 546
570 shelvectx = repo['tip'] 572 shelvectx = repo['tip']
571 573
572 # If the shelve is not immediately on top of the commit 574 # If the shelve is not immediately on top of the commit
573 # we'll be merging with, rebase it to be on top. 575 # we'll be merging with, rebase it to be on top.
574 if tmpwctx.node() != shelvectx.parents()[0].node(): 576 if tmpwctx.node() != shelvectx.parents()[0].node():
577 ui.status(_('rebasing shelved changes\n'))
575 try: 578 try:
576 rebase.rebase(ui, repo, **{ 579 rebase.rebase(ui, repo, **{
577 'rev' : [shelvectx.rev()], 580 'rev' : [shelvectx.rev()],
578 'dest' : str(tmpwctx.rev()), 581 'dest' : str(tmpwctx.rev()),
579 'keep' : True, 582 'keep' : True,