Commits

TK Soh  committed 8d4d146

context: add merging support through simplemerge

  • Participants
  • Parent commits 28942c4

Comments (0)

Files changed (1)

File tortoise/contextmenu.py

 from thgutil import *
 
 GUI_SHELL = 'guishell'
+SIMPLE_MERGE = os.path.join(os.path.dirname(__file__), os.path.pardir, 'hgutils',
+                            'simplemerge')
+os.environ['HGMERGE'] = ('python %s -L my -L other' % shellquote(SIMPLE_MERGE))
 
 S_OK = 0
 S_FALSE = 1
             result.append((_("Update"),
                            _("update working directory"),
                            self._update))
+            result.append((_("Merge"),
+                           _("merge working directory with another revision"),
+                           self._merge_simple))
 
             result.append([])   # separator
 
     def _diff(self, parent_window):
         self._run_dialog('diff')
 
+    def _merge_simple(self, parent_window):
+        print "HGMERGE = %s" % os.environ['HGMERGE']
+        self._run_dialog('merge', True)
+
     def _rollback(self, parent_window):
         targets = self._filenames or [self._folder]
         root = find_root(targets[0])
         import updatedialog
         targets = self._filenames or [self._folder]
         updatedialog.do_update(targets[0])
-        
+
     def _run_program_with_guishell(self, hgcmd, noargs=False):
         exepath = find_path(GUI_SHELL)
         if exepath: