##// END OF EJS Templates
windows: add a method to convert Unix style command lines to Windows style...
windows: add a method to convert Unix style command lines to Windows style This started as a copy/paste of `os.path.expandvars()`, but limited to a given dictionary of variables, converting `foo = foo + bar` to `foo += bar`, and adding 'b' string prefixes. Then code was added to make sure that a value being substituted in wouldn't itself be expanded by cmd.exe. But that left inconsistent results between `$var1` and `%var1%` when its value was '%foo%'- since neither were touched, `$var1` wouldn't expand but `%var1%` would. So instead, this just converts the Unix style to Windows style (if the variable exists, because Windows will leave `%missing%` as-is), and lets cmd.exe do its thing. I then dropped the %% -> % conversion (because Windows doesn't do this), and added the ability to escape the '$' with '\'. The escape character is dropped, for consistency with shell handling. After everything seemed stable and working, running the whole test suite flagged a problem near the end of test-bookmarks.t:1069. The problem is cmd.exe won't pass empty variables to its child, so defined but empty variables are now skipped. I can't think of anything better, and it seems like a pre-existing violation of the documentation, which calls out that HG_OLDNODE is empty on bookmark creation. Future additions could potentially be replacing strong quotes with double quotes (cmd.exe doesn't know what to do with the former), escaping a double quote, and some tilde expansion via os.path.expanduser(). I've got some doubts about replacing the strong quotes in case sh.exe is run, but it seems like the right thing to do the vast majority of the time. The original form of this was discussed about a year ago[1]. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/100735.html

File last commit:

r35926:a9802c9e default
r38502:3efadf23 default
Show More
mergetools.rc
146 lines | 5.9 KiB | text/x-stsrc | TextLexer
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 # Some default global settings for common merge tools
[merge-tools]
Kyle Lippincott
merge: use operation-provided labels (ex: dest/source) in several merge-tools...
r35926 kdiff3.args=--auto --L1 $labelbase --L2 $labellocal --L3 $labelother $base $local $other -o $output
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 kdiff3.regkey=Software\KDiff3
kdiff3.regkeyalt=Software\Wow6432Node\KDiff3
kdiff3.regappend=\kdiff3.exe
kdiff3.fixeol=True
kdiff3.gui=True
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 kdiff3.diffargs=--L1 $plabel1 --L2 $clabel $parent $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
gvimdiff.args=--nofork -d -g -O $local $other $base
gvimdiff.regkey=Software\Vim\GVim
gvimdiff.regkeyalt=Software\Wow6432Node\Vim\GVim
gvimdiff.regname=path
gvimdiff.priority=-9
gvimdiff.diffargs=--nofork -d -g -O $parent $child
vimdiff.args=$local $other $base -c 'redraw | echomsg "hg merge conflict, type \":cq\" to abort vimdiff"'
vimdiff.check=changed
vimdiff.priority=-10
merge.check=conflicts
merge.priority=-100
gpyfm.gui=True
meld.gui=True
Kyle Lippincott
merge: use operation-provided labels (ex: dest/source) in several merge-tools...
r35926 meld.args=--label=$labellocal $local --label='merged' $base --label=$labelother $other -o $output
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 meld.check=changed
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 meld.diffargs=-a --label=$plabel1 $parent --label=$clabel $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
tkdiff.args=$local $other -a $base -o $output
tkdiff.gui=True
tkdiff.priority=-8
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 tkdiff.diffargs=-L $plabel1 $parent -L $clabel $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
Kyle Lippincott
merge: use operation-provided labels (ex: dest/source) in several merge-tools...
r35926 xxdiff.args=--show-merged-pane --exit-with-merge-status --title1 $labellocal --title2 $labelbase --title3 $labelother --merged-filename $output --merge $local $base $other
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 xxdiff.gui=True
xxdiff.priority=-8
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 xxdiff.diffargs=--title1 $plabel1 $parent --title2 $clabel $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
diffmerge.regkey=Software\SourceGear\SourceGear DiffMerge\
diffmerge.regkeyalt=Software\Wow6432Node\SourceGear\SourceGear DiffMerge\
diffmerge.regname=Location
diffmerge.priority=-7
Kyle Lippincott
merge: use operation-provided labels (ex: dest/source) in several merge-tools...
r35926 diffmerge.args=-nosplash -merge -title1=$labellocal -title2=merged -title3=$labelother $local $base $other -result=$output
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 diffmerge.check=changed
diffmerge.gui=True
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 diffmerge.diffargs=--nosplash --title1=$plabel1 --title2=$clabel $parent $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
p4merge.args=$base $local $other $output
p4merge.regkey=Software\Perforce\Environment
p4merge.regkeyalt=Software\Wow6432Node\Perforce\Environment
p4merge.regname=P4INSTROOT
p4merge.regappend=\p4merge.exe
p4merge.gui=True
p4merge.priority=-8
p4merge.diffargs=$parent $child
p4mergeosx.executable = /Applications/p4merge.app/Contents/MacOS/p4merge
p4mergeosx.args = $base $local $other $output
p4mergeosx.gui = True
p4mergeosx.priority=-8
p4mergeosx.diffargs=$parent $child
tortoisemerge.args=/base:$base /mine:$local /theirs:$other /merged:$output
tortoisemerge.regkey=Software\TortoiseSVN
tortoisemerge.regkeyalt=Software\Wow6432Node\TortoiseSVN
tortoisemerge.check=changed
tortoisemerge.gui=True
tortoisemerge.priority=-8
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 tortoisemerge.diffargs=/base:$parent /mine:$child /basename:$plabel1 /minename:$clabel
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
Kyle Lippincott
merge: use operation-provided labels (ex: dest/source) in several merge-tools...
r35926 ecmerge.args=$base $local $other --mode=merge3 --title0=$labelbase --title1=$labellocal --title2=$labelother --to=$output
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 ecmerge.regkey=Software\Elli\xc3\xa9 Computing\Merge
ecmerge.regkeyalt=Software\Wow6432Node\Elli\xc3\xa9 Computing\Merge
ecmerge.gui=True
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 ecmerge.diffargs=$parent $child --mode=diff2 --title1=$plabel1 --title2=$clabel
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
# editmerge is a small script shipped in contrib.
# It needs this config otherwise it behaves the same as internal:local
editmerge.args=$output
editmerge.check=changed
editmerge.premerge=keep
filemerge.executable=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge
filemerge.args=-left $other -right $local -ancestor $base -merge $output
filemerge.gui=True
Mads Kiilerich
mergetools.rc: find OSX FileMerge in the new location inside Xcode 4.3
r26733 filemergexcode.executable=/Applications/Xcode.app/Contents/Applications/FileMerge.app/Contents/MacOS/FileMerge
filemergexcode.args=-left $other -right $local -ancestor $base -merge $output
filemergexcode.gui=True
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 ; Windows version of Beyond Compare
Kyle Lippincott
merge: use operation-provided labels (ex: dest/source) in several merge-tools...
r35926 beyondcompare3.args=$local $other $base $output /ro /lefttitle=$labellocal /centertitle=$labelbase /righttitle=$labelother /automerge /reviewconflicts /solo
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 beyondcompare3.regkey=Software\Scooter Software\Beyond Compare 3
beyondcompare3.regname=ExePath
beyondcompare3.gui=True
beyondcompare3.priority=-2
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 beyondcompare3.diffargs=/lro /lefttitle=$plabel1 /righttitle=$clabel /solo /expandall $parent $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
; Linux version of Beyond Compare
bcompare.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo
bcompare.gui=True
bcompare.priority=-1
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 bcompare.diffargs=-lro -lefttitle=$plabel1 -righttitle=$clabel -solo -expandall $parent $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
Mads Kiilerich
merge-tools: configuration for Beyond Compare on OS X...
r24179 ; OS X version of Beyond Compare
bcomposx.executable = /Applications/Beyond Compare.app/Contents/MacOS/bcomp
bcomposx.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo
bcomposx.gui=True
bcomposx.priority=-1
bcomposx.diffargs=-lro -lefttitle=$plabel1 -righttitle=$clabel -solo -expandall $parent $child
Kyle Lippincott
merge: use operation-provided labels (ex: dest/source) in several merge-tools...
r35926 winmerge.args=/e /x /wl /ub /dl $labelother /dr $labellocal $other $local $output
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143 winmerge.regkey=Software\Thingamahoochie\WinMerge
winmerge.regkeyalt=Software\Wow6432Node\Thingamahoochie\WinMerge\
winmerge.regname=Executable
winmerge.check=changed
winmerge.gui=True
winmerge.priority=-10
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 winmerge.diffargs=/r /e /x /ub /wl /dl $plabel1 /dr $clabel $parent $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
araxis.regkey=SOFTWARE\Classes\TypeLib\{46799e0a-7bd1-4330-911c-9660bb964ea2}\7.0\HELPDIR
araxis.regappend=\ConsoleCompare.exe
araxis.priority=-2
araxis.args=/3 /a2 /wait /merge /title1:"Other" /title2:"Base" /title3:"Local :"$local $other $base $local $output
araxis.checkconflict=True
araxis.binary=True
araxis.gui=True
Mads Kiilerich
mergetools: drop incorrect quoting of diffargs variables...
r23968 araxis.diffargs=/2 /wait /title1:$plabel1 /title2:$clabel $parent $child
Mads Kiilerich
config: move mergetools configuration from contrib to default configuration...
r23143
diffuse.priority=-3
diffuse.args=$local $base $other
diffuse.gui=True
diffuse.diffargs=$parent $child
UltraCompare.regkey=Software\Microsoft\Windows\CurrentVersion\App Paths\UC.exe
UltraCompare.regkeyalt=Software\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\UC.exe
UltraCompare.args = $base $local $other -title1 base -title3 other
UltraCompare.priority = -2
UltraCompare.gui = True
UltraCompare.binary = True
UltraCompare.check = conflicts,changed
UltraCompare.diffargs=$child $parent -title1 $clabel -title2 $plabel1