Show More
@@ -43,14 +43,16 b' def _picktool(repo, ui, path, binary, sy' | |||
|
43 | 43 | return False |
|
44 | 44 | |
|
45 | 45 | # HGMERGE takes precedence |
|
46 |
|
|
|
47 | return os.environ.get("HGMERGE") | |
|
46 | hgmerge = os.environ.get("HGMERGE") | |
|
47 | if hgmerge: | |
|
48 | return (hgmerge, hgmerge) | |
|
48 | 49 | |
|
49 | 50 | # then patterns |
|
50 | 51 | for pat, tool in ui.configitems("merge-patterns"): |
|
51 | 52 | mf = util.matcher(repo.root, "", [pat], [], [])[1] |
|
52 | 53 | if mf(path) and check(tool, pat, symlink, False): |
|
53 |
|
|
|
54 | toolpath = _findtool(ui, tool) | |
|
55 | return (tool, '"' + toolpath + '"') | |
|
54 | 56 | |
|
55 | 57 | # then merge tools |
|
56 | 58 | tools = {} |
@@ -63,10 +65,12 b' def _picktool(repo, ui, path, binary, sy' | |||
|
63 | 65 | if ui.config("ui", "merge"): |
|
64 | 66 | tools.insert(0, (None, ui.config("ui", "merge"))) # highest priority |
|
65 | 67 | tools.append((None, "hgmerge")) # the old default, if found |
|
66 | tools.append((None, "internal:merge")) # internal merge as last resort | |
|
67 | 68 | for p,t in tools: |
|
68 | if _findtool(ui, t) and check(t, None, symlink, binary): | |
|
69 | return t | |
|
69 | toolpath = _findtool(ui, t) | |
|
70 | if toolpath and check(t, None, symlink, binary): | |
|
71 | return (t, '"' + toolpath + '"') | |
|
72 | # internal merge as last resort | |
|
73 | return (not (symlink or binary) and "internal:merge" or None, None) | |
|
70 | 74 | |
|
71 | 75 | def _eoltype(data): |
|
72 | 76 | "Guess the EOL type of a file" |
@@ -124,7 +128,7 b' def filemerge(repo, fw, fd, fo, wctx, mc' | |||
|
124 | 128 | fca = fcm.ancestor(fco) or repo.filectx(fw, fileid=nullrev) |
|
125 | 129 | binary = isbin(fcm) or isbin(fco) or isbin(fca) |
|
126 | 130 | symlink = fcm.islink() or fco.islink() |
|
127 | tool = _picktool(repo, ui, fw, binary, symlink) | |
|
131 | tool, toolpath = _picktool(repo, ui, fw, binary, symlink) | |
|
128 | 132 | ui.debug(_("picked tool '%s' for %s (binary %s symlink %s)\n") % |
|
129 | 133 | (tool, fw, binary, symlink)) |
|
130 | 134 | |
@@ -177,7 +181,6 b' def filemerge(repo, fw, fd, fo, wctx, mc' | |||
|
177 | 181 | if tool == "internal:merge": |
|
178 | 182 | r = simplemerge.simplemerge(a, b, c, label=['local', 'other']) |
|
179 | 183 | else: |
|
180 | toolpath = _findtool(ui, tool) | |
|
181 | 184 | args = _toolstr(ui, tool, "args", '$local $base $other') |
|
182 | 185 | if "$output" in args: |
|
183 | 186 | out, a = a, back # read input from backup, write to original |
General Comments 0
You need to be logged in to leave comments.
Login now