Mercurial > public > mercurial-scm > hg
comparison mercurial/filemerge.py @ 22707:38e0363dcbe0
filemerge: switch the default name for internal tools from internal:x to :x
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Sun, 28 Sep 2014 17:15:28 +0200 |
parents | ad25986c4cd3 |
children | b405dd6c90bf |
comparison
equal
deleted
inserted
replaced
22706:ad25986c4cd3 | 22707:38e0363dcbe0 |
---|---|
23 internals = {} | 23 internals = {} |
24 | 24 |
25 def internaltool(name, trymerge, onfailure=None): | 25 def internaltool(name, trymerge, onfailure=None): |
26 '''return a decorator for populating internal merge tool table''' | 26 '''return a decorator for populating internal merge tool table''' |
27 def decorator(func): | 27 def decorator(func): |
28 fullname = 'internal:' + name | 28 fullname = ':' + name |
29 func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip() | 29 func.__doc__ = "``%s``\n" % fullname + func.__doc__.strip() |
30 internals[fullname] = func | 30 internals[fullname] = func |
31 internals[':' + name] = func | 31 internals['internal:' + name] = func |
32 func.trymerge = trymerge | 32 func.trymerge = trymerge |
33 func.onfailure = onfailure | 33 func.onfailure = onfailure |
34 return func | 34 return func |
35 return decorator | 35 return decorator |
36 | 36 |
110 toolpath = _findtool(ui, t) | 110 toolpath = _findtool(ui, t) |
111 return (t, util.shellquote(toolpath)) | 111 return (t, util.shellquote(toolpath)) |
112 | 112 |
113 # internal merge or prompt as last resort | 113 # internal merge or prompt as last resort |
114 if symlink or binary: | 114 if symlink or binary: |
115 return "internal:prompt", None | 115 return ":prompt", None |
116 return "internal:merge", None | 116 return ":merge", None |
117 | 117 |
118 def _eoltype(data): | 118 def _eoltype(data): |
119 "Guess the EOL type of a file" | 119 "Guess the EOL type of a file" |
120 if '\0' in data: # binary | 120 if '\0' in data: # binary |
121 return None | 121 return None |
215 files. It will fail if there are any conflicts and leave markers in | 215 files. It will fail if there are any conflicts and leave markers in |
216 the partially merged file. Markers will have two sections, one for each side | 216 the partially merged file. Markers will have two sections, one for each side |
217 of merge.""" | 217 of merge.""" |
218 tool, toolpath, binary, symlink = toolconf | 218 tool, toolpath, binary, symlink = toolconf |
219 if symlink: | 219 if symlink: |
220 repo.ui.warn(_('warning: internal:merge cannot merge symlinks ' | 220 repo.ui.warn(_('warning: internal :merge cannot merge symlinks ' |
221 'for %s\n') % fcd.path()) | 221 'for %s\n') % fcd.path()) |
222 return False, 1 | 222 return False, 1 |
223 r = _premerge(repo, toolconf, files, labels=labels) | 223 r = _premerge(repo, toolconf, files, labels=labels) |
224 if r: | 224 if r: |
225 a, b, c, back = files | 225 a, b, c, back = files |
245 labels.append('base') | 245 labels.append('base') |
246 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels) | 246 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels) |
247 | 247 |
248 @internaltool('tagmerge', True, | 248 @internaltool('tagmerge', True, |
249 _("automatic tag merging of %s failed! " | 249 _("automatic tag merging of %s failed! " |
250 "(use 'hg resolve --tool internal:merge' or another merge " | 250 "(use 'hg resolve --tool :merge' or another merge " |
251 "tool of your choice)\n")) | 251 "tool of your choice)\n")) |
252 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): | 252 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
253 """ | 253 """ |
254 Uses the internal tag merge algorithm (experimental). | 254 Uses the internal tag merge algorithm (experimental). |
255 """ | 255 """ |