##// END OF EJS Templates
extdiff: add labels, read diff arguments from [merge-tools]...
Steve Borho -
r11184:7d99eddd default
parent child Browse files
Show More
@@ -6,6 +6,7 b' kdiff3.regkey=Software\\KDiff3'
6 kdiff3.regappend=\kdiff3.exe
6 kdiff3.regappend=\kdiff3.exe
7 kdiff3.fixeol=True
7 kdiff3.fixeol=True
8 kdiff3.gui=True
8 kdiff3.gui=True
9 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
9
10
10 gvimdiff.args=--nofork -d -g -O $local $other $base
11 gvimdiff.args=--nofork -d -g -O $local $other $base
11 gvimdiff.regkey=Software\Vim\GVim
12 gvimdiff.regkey=Software\Vim\GVim
@@ -19,14 +20,17 b' gpyfm.gui=True'
19
20
20 meld.gui=True
21 meld.gui=True
21 meld.args=--label='local' $local --label='base' $base --label='other' $other
22 meld.args=--label='local' $local --label='base' $base --label='other' $other
23 meld.diffargs=-a --label='$plabel1' $parent --label='$clabel' $child
22
24
23 tkdiff.args=$local $other -a $base -o $output
25 tkdiff.args=$local $other -a $base -o $output
24 tkdiff.gui=True
26 tkdiff.gui=True
25 tkdiff.priority=-8
27 tkdiff.priority=-8
28 tkdiff.diffargs=-L '$plabel1' $parent -L '$clabel' $child
26
29
27 xxdiff.args=--show-merged-pane --exit-with-merge-status --title1 local --title2 base --title3 other --merged-filename $output --merge $local $base $other
30 xxdiff.args=--show-merged-pane --exit-with-merge-status --title1 local --title2 base --title3 other --merged-filename $output --merge $local $base $other
28 xxdiff.gui=True
31 xxdiff.gui=True
29 xxdiff.priority=-8
32 xxdiff.priority=-8
33 xxdiff.diffargs=--title1 '$plabel1' $parent --title2 '$clabel' $child
30
34
31 diffmerge.regkey=Software\SourceGear\SourceGear DiffMerge\
35 diffmerge.regkey=Software\SourceGear\SourceGear DiffMerge\
32 diffmerge.regname=Location
36 diffmerge.regname=Location
@@ -34,6 +38,7 b' diffmerge.priority=-7'
34 diffmerge.args=-nosplash -merge -title1=local -title2=merged -title3=other $local $base $other -result=$output
38 diffmerge.args=-nosplash -merge -title1=local -title2=merged -title3=other $local $base $other -result=$output
35 diffmerge.checkchanged=True
39 diffmerge.checkchanged=True
36 diffmerge.gui=True
40 diffmerge.gui=True
41 diffmerge.diffargs=--nosplash --title1='$plabel1' --title2='$clabel' $parent $child
37
42
38 p4merge.args=$base $local $other $output
43 p4merge.args=$base $local $other $output
39 p4merge.regkey=Software\Perforce\Environment
44 p4merge.regkey=Software\Perforce\Environment
@@ -41,16 +46,19 b' p4merge.regname=P4INSTROOT'
41 p4merge.regappend=\p4merge.exe
46 p4merge.regappend=\p4merge.exe
42 p4merge.gui=True
47 p4merge.gui=True
43 p4merge.priority=-8
48 p4merge.priority=-8
49 p4merge.diffargs=$parent $child
44
50
45 tortoisemerge.args=/base:$base /mine:$local /theirs:$other /merged:$output
51 tortoisemerge.args=/base:$base /mine:$local /theirs:$other /merged:$output
46 tortoisemerge.regkey=Software\TortoiseSVN
52 tortoisemerge.regkey=Software\TortoiseSVN
47 tortoisemerge.checkchanged=True
53 tortoisemerge.checkchanged=True
48 tortoisemerge.gui=True
54 tortoisemerge.gui=True
49 tortoisemerge.priority=-8
55 tortoisemerge.priority=-8
56 tortoisemerge.diffargs=/base:$parent /mine:$child /basename:'$plabel1' /minename:'$clabel'
50
57
51 ecmerge.args=$base $local $other --mode=merge3 --title0=base --title1=local --title2=other --to=$output
58 ecmerge.args=$base $local $other --mode=merge3 --title0=base --title1=local --title2=other --to=$output
52 ecmerge.regkey=Software\Elli\xc3\xa9 Computing\Merge
59 ecmerge.regkey=Software\Elli\xc3\xa9 Computing\Merge
53 ecmerge.gui=True
60 ecmerge.gui=True
61 ecmerge.diffargs=$parent $child --mode=diff2 --title1='$plabel1' --title2='$clabel'
54
62
55 filemerge.executable=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge
63 filemerge.executable=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge
56 filemerge.args=-left $other -right $local -ancestor $base -merge $output
64 filemerge.args=-left $other -right $local -ancestor $base -merge $output
@@ -62,12 +70,14 b' beyondcompare3.regkey=Software\\Scooter S'
62 beyondcompare3.regname=ExePath
70 beyondcompare3.regname=ExePath
63 beyondcompare3.gui=True
71 beyondcompare3.gui=True
64 beyondcompare3.priority=-2
72 beyondcompare3.priority=-2
73 beyondcompare3.diffargs=/lro /lefttitle='$plabel1' /righttitle='$clabel' /solo /expandall $parent $child
65
74
66 ; Linux version of Beyond Compare
75 ; Linux version of Beyond Compare
67 bcompare.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo
76 bcompare.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo
68 bcompare.premerge=False
77 bcompare.premerge=False
69 bcompare.gui=True
78 bcompare.gui=True
70 bcompare.priority=-1
79 bcompare.priority=-1
80 bcompare.diffargs=-lro -lefttitle='$plabel1' -righttitle='$clabel' -solo -expandall $parent $child
71
81
72 winmerge.args=/e /x /wl /ub /dl other /dr local $other $local $output
82 winmerge.args=/e /x /wl /ub /dl other /dr local $other $local $output
73 winmerge.regkey=Software\Thingamahoochie\WinMerge
83 winmerge.regkey=Software\Thingamahoochie\WinMerge
@@ -75,6 +85,7 b' winmerge.regname=Executable'
75 winmerge.checkchanged=True
85 winmerge.checkchanged=True
76 winmerge.gui=True
86 winmerge.gui=True
77 winmerge.priority=-10
87 winmerge.priority=-10
88 winmerge.diffargs=/r /e /x /ub /wl /dl '$plabel1' /dr '$clabel' $parent $child
78
89
79 araxis.regkey=SOFTWARE\Classes\TypeLib\{46799e0a-7bd1-4330-911c-9660bb964ea2}\7.0\HELPDIR
90 araxis.regkey=SOFTWARE\Classes\TypeLib\{46799e0a-7bd1-4330-911c-9660bb964ea2}\7.0\HELPDIR
80 araxis.regappend=\ConsoleCompare.exe
91 araxis.regappend=\ConsoleCompare.exe
@@ -84,3 +95,9 b' araxis.premerge=False'
84 araxis.checkconflict=True
95 araxis.checkconflict=True
85 araxis.binary=True
96 araxis.binary=True
86 araxis.gui=True
97 araxis.gui=True
98 araxis.diffargs=/2 /wait /title1:"$plabel1" /title2:"$clabel" $parent $child
99
100 diffuse.priority=-3
101 diffuse.args=$local $base $other
102 diffuse.gui=True
103 diffuse.diffargs=$parent $child
@@ -35,6 +35,22 b' you do not need to type "hg extdiff -p k'
35 # your .vimrc
35 # your .vimrc
36 vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)'
36 vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)'
37
37
38 Tool arguments can include variables that are expanded at runtime:
39
40 $parent1, $plabel1 - filename, descriptive label of first parent
41 $child, $clabel - filename, descriptive label of child revision
42 $parent2, $plabel2 - filename, descriptive label of second parent
43 $parent is an alias for $parent1.
44
45 The extdiff extension will look in your [diff-tools] and [merge-tools]
46 sections for diff tool arguments, when none are specified in [extdiff].
47
48 [extdiff]
49 kdiff3 =
50
51 [diff-tools]
52 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
53
38 You can use -I/-X and list of file or directory names like normal "hg
54 You can use -I/-X and list of file or directory names like normal "hg
39 diff" command. The extdiff extension makes snapshots of only needed
55 diff" command. The extdiff extension makes snapshots of only needed
40 files, so running the external diff program will actually be pretty
56 files, so running the external diff program will actually be pretty
@@ -133,18 +149,23 b' def dodiff(ui, repo, diffcmd, diffopts, '
133 # Always make a copy of node1a (and node1b, if applicable)
149 # Always make a copy of node1a (and node1b, if applicable)
134 dir1a_files = mod_a | rem_a | ((mod_b | add_b) - add_a)
150 dir1a_files = mod_a | rem_a | ((mod_b | add_b) - add_a)
135 dir1a = snapshot(ui, repo, dir1a_files, node1a, tmproot)[0]
151 dir1a = snapshot(ui, repo, dir1a_files, node1a, tmproot)[0]
152 rev1a = '@%d' % repo[node1a].rev()
136 if do3way:
153 if do3way:
137 dir1b_files = mod_b | rem_b | ((mod_a | add_a) - add_b)
154 dir1b_files = mod_b | rem_b | ((mod_a | add_a) - add_b)
138 dir1b = snapshot(ui, repo, dir1b_files, node1b, tmproot)[0]
155 dir1b = snapshot(ui, repo, dir1b_files, node1b, tmproot)[0]
156 rev1b = '@%d' % repo[node1b].rev()
139 else:
157 else:
140 dir1b = None
158 dir1b = None
159 rev1b = ''
141
160
142 fns_and_mtime = []
161 fns_and_mtime = []
143
162
144 # If node2 in not the wc or there is >1 change, copy it
163 # If node2 in not the wc or there is >1 change, copy it
145 dir2root = ''
164 dir2root = ''
165 rev2 = ''
146 if node2:
166 if node2:
147 dir2 = snapshot(ui, repo, modadd, node2, tmproot)[0]
167 dir2 = snapshot(ui, repo, modadd, node2, tmproot)[0]
168 rev2 = '@%d' % repo[node2].rev()
148 elif len(common) > 1:
169 elif len(common) > 1:
149 #we only actually need to get the files to copy back to
170 #we only actually need to get the files to copy back to
150 #the working dir in this case (because the other cases
171 #the working dir in this case (because the other cases
@@ -156,23 +177,32 b' def dodiff(ui, repo, diffcmd, diffopts, '
156 dir2 = ''
177 dir2 = ''
157 dir2root = repo.root
178 dir2root = repo.root
158
179
180 label1a = rev1a
181 label1b = rev1b
182 label2 = rev2
183
159 # If only one change, diff the files instead of the directories
184 # If only one change, diff the files instead of the directories
160 # Handle bogus modifies correctly by checking if the files exist
185 # Handle bogus modifies correctly by checking if the files exist
161 if len(common) == 1:
186 if len(common) == 1:
162 common_file = util.localpath(common.pop())
187 common_file = util.localpath(common.pop())
163 dir1a = os.path.join(dir1a, common_file)
188 dir1a = os.path.join(dir1a, common_file)
189 label1a = common_file + rev1a
164 if not os.path.isfile(os.path.join(tmproot, dir1a)):
190 if not os.path.isfile(os.path.join(tmproot, dir1a)):
165 dir1a = os.devnull
191 dir1a = os.devnull
166 if do3way:
192 if do3way:
167 dir1b = os.path.join(dir1b, common_file)
193 dir1b = os.path.join(dir1b, common_file)
194 label1b = common_file + rev1b
168 if not os.path.isfile(os.path.join(tmproot, dir1b)):
195 if not os.path.isfile(os.path.join(tmproot, dir1b)):
169 dir1b = os.devnull
196 dir1b = os.devnull
170 dir2 = os.path.join(dir2root, dir2, common_file)
197 dir2 = os.path.join(dir2root, dir2, common_file)
198 label2 = common_file + rev2
171
199
172 # Function to quote file/dir names in the argument string.
200 # Function to quote file/dir names in the argument string.
173 # When not operating in 3-way mode, an empty string is
201 # When not operating in 3-way mode, an empty string is
174 # returned for parent2
202 # returned for parent2
175 replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b, child=dir2)
203 replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b,
204 plabel1=label1a, plabel2=label1b,
205 clabel=label2, child=dir2)
176 def quote(match):
206 def quote(match):
177 key = match.group()[1:]
207 key = match.group()[1:]
178 if not do3way and key == 'parent2':
208 if not do3way and key == 'parent2':
@@ -180,7 +210,7 b' def dodiff(ui, repo, diffcmd, diffopts, '
180 return util.shellquote(replace[key])
210 return util.shellquote(replace[key])
181
211
182 # Match parent2 first, so 'parent1?' will match both parent1 and parent
212 # Match parent2 first, so 'parent1?' will match both parent1 and parent
183 regex = '\$(parent2|parent1?|child)'
213 regex = '\$(parent2|parent1?|child|plabel1|plabel2|clabel)'
184 if not do3way and not re.search(regex, args):
214 if not do3way and not re.search(regex, args):
185 args += ' $parent1 $child'
215 args += ' $parent1 $child'
186 args = re.sub(regex, quote, args)
216 args = re.sub(regex, quote, args)
@@ -252,6 +282,12 b' def uisetup(ui):'
252 path = diffopts.pop(0)
282 path = diffopts.pop(0)
253 else:
283 else:
254 path, diffopts = cmd, []
284 path, diffopts = cmd, []
285 # look for diff arguments in [diff-tools] then [merge-tools]
286 if diffopts == []:
287 args = ui.config('diff-tools', cmd+'.diffargs') or \
288 ui.config('merge-tools', cmd+'.diffargs')
289 if args:
290 diffopts = shlex.split(args)
255 def save(cmd, path, diffopts):
291 def save(cmd, path, diffopts):
256 '''use closure to save diff command to use'''
292 '''use closure to save diff command to use'''
257 def mydiff(ui, repo, *pats, **opts):
293 def mydiff(ui, repo, *pats, **opts):
General Comments 0
You need to be logged in to leave comments. Login now