##// END OF EJS Templates
unshelve: add support for custom merge tools...
Siddharth Agarwal -
r27021:f2554154 default
parent child Browse files
Show More
@@ -574,6 +574,7 b' def unshelvecontinue(ui, repo, state, op'
574 _('continue an incomplete unshelve operation')),
574 _('continue an incomplete unshelve operation')),
575 ('k', 'keep', None,
575 ('k', 'keep', None,
576 _('keep shelve after unshelving')),
576 _('keep shelve after unshelving')),
577 ('t', 'tool', '', _('specify merge tool')),
577 ('', 'date', '',
578 ('', 'date', '',
578 _('set date for temporary commits (DEPRECATED)'), _('DATE'))],
579 _('set date for temporary commits (DEPRECATED)'), _('DATE'))],
579 _('hg unshelve [SHELVED]'))
580 _('hg unshelve [SHELVED]'))
@@ -620,6 +621,8 b' def unshelve(ui, repo, *shelved, **opts)'
620 if shelved:
621 if shelved:
621 raise error.Abort(_('cannot combine abort/continue with '
622 raise error.Abort(_('cannot combine abort/continue with '
622 'naming a shelved change'))
623 'naming a shelved change'))
624 if abortf and opts.get('tool', False):
625 ui.warn(_('tool option will be ignored\n'))
623
626
624 try:
627 try:
625 state = shelvedstate.load(repo)
628 state = shelvedstate.load(repo)
@@ -648,7 +651,9 b' def unshelve(ui, repo, *shelved, **opts)'
648
651
649 oldquiet = ui.quiet
652 oldquiet = ui.quiet
650 wlock = lock = tr = None
653 wlock = lock = tr = None
654 forcemerge = ui.backupconfig('ui', 'forcemerge')
651 try:
655 try:
656 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'unshelve')
652 wlock = repo.wlock()
657 wlock = repo.wlock()
653 lock = repo.lock()
658 lock = repo.lock()
654
659
@@ -706,6 +711,7 b' def unshelve(ui, repo, *shelved, **opts)'
706 'rev' : [shelvectx.rev()],
711 'rev' : [shelvectx.rev()],
707 'dest' : str(tmpwctx.rev()),
712 'dest' : str(tmpwctx.rev()),
708 'keep' : True,
713 'keep' : True,
714 'tool' : opts.get('tool', ''),
709 })
715 })
710 except error.InterventionRequired:
716 except error.InterventionRequired:
711 tr.close()
717 tr.close()
@@ -744,6 +750,7 b' def unshelve(ui, repo, *shelved, **opts)'
744 if tr:
750 if tr:
745 tr.release()
751 tr.release()
746 lockmod.release(lock, wlock)
752 lockmod.release(lock, wlock)
753 ui.restoreconfig(forcemerge)
747
754
748 @command('shelve',
755 @command('shelve',
749 [('A', 'addremove', None,
756 [('A', 'addremove', None,
@@ -469,6 +469,29 b' set up another conflict between a commit'
469
469
470 if we resolve a conflict while unshelving, the unshelve should succeed
470 if we resolve a conflict while unshelving, the unshelve should succeed
471
471
472 $ hg unshelve --tool :merge-other --keep
473 unshelving change 'default'
474 temporarily committing pending changes (restore with 'hg unshelve --abort')
475 rebasing shelved changes
476 rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
477 merging a/a
478 $ hg parents -q
479 4:33f7f61e6c5e
480 $ hg shelve -l
481 default (*)* changes to 'second' (glob)
482 $ hg status
483 M a/a
484 A foo/foo
485 $ cat a/a
486 a
487 c
488 a
489 $ cat > a/a << EOF
490 > a
491 > c
492 > x
493 > EOF
494
472 $ HGMERGE=true hg unshelve
495 $ HGMERGE=true hg unshelve
473 unshelving change 'default'
496 unshelving change 'default'
474 temporarily committing pending changes (restore with 'hg unshelve --abort')
497 temporarily committing pending changes (restore with 'hg unshelve --abort')
@@ -730,7 +753,8 b' unshelve and conflicts with tracked and '
730 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
753 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
731 $ cat f.orig
754 $ cat f.orig
732 g
755 g
733 $ hg unshelve --abort
756 $ hg unshelve --abort -t false
757 tool option will be ignored
734 rebase aborted
758 rebase aborted
735 unshelve of 'default' aborted
759 unshelve of 'default' aborted
736 $ hg st
760 $ hg st
General Comments 0
You need to be logged in to leave comments. Login now