hgext/shelve.py
changeset 27021 f2554154509f
parent 27020 cc2049184ece
child 27092 156985f2dec0
--- a/hgext/shelve.py	Wed Nov 18 15:18:16 2015 -0800
+++ b/hgext/shelve.py	Wed Nov 18 15:11:23 2015 -0800
@@ -574,6 +574,7 @@
            _('continue an incomplete unshelve operation')),
           ('k', 'keep', None,
            _('keep shelve after unshelving')),
+          ('t', 'tool', '', _('specify merge tool')),
           ('', 'date', '',
            _('set date for temporary commits (DEPRECATED)'), _('DATE'))],
          _('hg unshelve [SHELVED]'))
@@ -620,6 +621,8 @@
         if shelved:
             raise error.Abort(_('cannot combine abort/continue with '
                                'naming a shelved change'))
+        if abortf and opts.get('tool', False):
+            ui.warn(_('tool option will be ignored\n'))
 
         try:
             state = shelvedstate.load(repo)
@@ -648,7 +651,9 @@
 
     oldquiet = ui.quiet
     wlock = lock = tr = None
+    forcemerge = ui.backupconfig('ui', 'forcemerge')
     try:
+        ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'unshelve')
         wlock = repo.wlock()
         lock = repo.lock()
 
@@ -706,6 +711,7 @@
                     'rev' : [shelvectx.rev()],
                     'dest' : str(tmpwctx.rev()),
                     'keep' : True,
+                    'tool' : opts.get('tool', ''),
                 })
             except error.InterventionRequired:
                 tr.close()
@@ -744,6 +750,7 @@
         if tr:
             tr.release()
         lockmod.release(lock, wlock)
+        ui.restoreconfig(forcemerge)
 
 @command('shelve',
          [('A', 'addremove', None,