Commits

TK Soh  committed 2eaa4c2

add support for simplemerge in py2exe package

  • Participants
  • Parent commits 3c48355

Comments (0)

Files changed (3)

 
 setup(name="TortoiseHg COM server",
         com_server=["tortoisehg"],
-        console=["hgproc.py"],
+        console=["hgproc.py", "hgutils\simplemerge"],
         options = dict(py2exe=py2exe_options),
         modules="win32com.shell",
         data_files=[(os.path.join('', root),

File simplemerge.bat

+::
+:: Win32 batch file to handle to merge with simplemerge for developement of TortoiseHg
+::
+
+@echo off
+setlocal
+
+:: Look in the registry for TortoiseHg location
+for /f "skip=2 tokens=3*" %%A in (
+    '"reg query "HKEY_CURRENT_USER\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B
+if "%TortoisePath%"=="" (goto :notfound) else (goto :merge)
+
+:merge
+python "%TortoisePath%\hgutils\simplemerge" %*
+goto end
+
+:notfound
+echo hgproc: cannot find TortoiseHg location in the registry.
+
+:end

File tortoise/contextmenu.py

 from mercurial import hg, ui, repo
 from thgutil import *
 
-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
 
         self._run_dialog('diff')
 
     def _merge_simple(self, parent_window):
+        app_path = find_path("simplemerge", get_prog_root(), '.EXE;.BAT')
+        os.environ['HGMERGE'] = ('%s -L my -L other' % shellquote(app_path))
+
         print "HGMERGE = %s" % os.environ['HGMERGE']
-        self._run_dialog('merge', noargs=True, modal=True)
+        self._run_dialog('merge', noargs=True)
 
     def _rollback(self, parent_window):
         targets = self._filenames or [self._folder]