##// END OF EJS Templates
filemerge: add the function to examine a capability of a internal tool...
FUJIWARA Katsunori -
r39159:4d7b1187 default
parent child Browse files
Show More
@@ -137,6 +137,12 def findexternaltool(ui, tool):
137 137 return procutil.findexe(util.expandpath(exe))
138 138
139 139 def _picktool(repo, ui, path, binary, symlink, changedelete):
140 def hascapability(tool, capability, strict=False):
141 if strict and tool in internals:
142 if internals[tool].capabilities.get(capability):
143 return True
144 return _toolbool(ui, tool, capability)
145
140 146 def supportscd(tool):
141 147 return tool in internals and internals[tool].mergetype == nomerge
142 148
@@ -149,9 +155,9 def _picktool(repo, ui, path, binary, sy
149 155 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
150 156 else: # configured but non-existing tools are more silent
151 157 ui.note(_("couldn't find merge tool %s\n") % tmsg)
152 elif symlink and not _toolbool(ui, tool, "symlink"):
158 elif symlink and not hascapability(tool, "symlink"):
153 159 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
154 elif binary and not _toolbool(ui, tool, "binary"):
160 elif binary and not hascapability(tool, "binary"):
155 161 ui.warn(_("tool %s can't handle binary\n") % tmsg)
156 162 elif changedelete and not supportscd(tool):
157 163 # the nomerge tools are the only tools that support change/delete
General Comments 0
You need to be logged in to leave comments. Login now