Mercurial > hg > easyhg
changeset 272:256138a4ed0e
* Add easyhg-merge.bat and use it. (This isn't necessary if hg has been properly configured, as the Tortoise distribution has)
author | Chris Cannam |
---|---|
date | Tue, 25 Jan 2011 16:12:23 +0000 |
parents | d98c642fc66f |
children | cc95394e2392 |
files | easyhg-merge.bat settingsdialog.cpp |
diffstat | 2 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/easyhg-merge.bat Tue Jan 25 16:12:23 2011 +0000 @@ -0,0 +1,22 @@ +@echo off +setlocal enableextensions +setlocal enabledelayedexpansion +set mypath=%~dp0 +set kdiff=kdiff3.exe +set found= +set SEARCH=%mypath%;%PATH% +:loop +for /F "delims=; tokens=1*" %%e in ("%SEARCH%") do ( + if exist "%%e\%kdiff%" ( + set found=%%e\%kdiff% + goto done; + ) + set SEARCH=%%f +) +if not "%SEARCH%"=="" goto loop; +:done +if "%found%"=="" ( + echo. "Failed to find kdiff.exe in path" +) else ( + "%found%" "%~2" "%~1" "%~3" -o "%~1" +)
--- a/settingsdialog.cpp Thu Jan 20 13:56:01 2011 +0000 +++ b/settingsdialog.cpp Tue Jan 25 16:12:23 2011 +0000 @@ -261,7 +261,11 @@ QString diff = settings.value("extdiffbinary", "").toString(); if (diff == "") { QStringList bases; +#ifdef Q_OS_WIN32 + bases << "easyhg-extdiff.bat"; +#else bases << "easyhg-extdiff.sh"; +#endif bases << "kompare" << "kdiff3" << "meld"; bool found = false; foreach (QString base, bases) { @@ -287,7 +291,11 @@ } QString merge; QStringList bases; +#ifdef Q_OS_WIN32 + bases << "easyhg-merge.bat"; +#else bases << "easyhg-merge.sh"; +#endif // NB it's not a good idea to add other tools here, as command // line argument ordering varies. Configure them through hgrc // instead