Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/filemerge.py @ 26893:19c4b93cb7d6
filemerge: move :merge-local/other symlink check to precheck
In upcoming patches we're going to add more checks to the function currently
named _symlinkcheck. This consolidates all those checks.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 08 Nov 2015 23:42:44 -0800 |
parents | 859f453e8b4e |
children | 33eb8a56d0c9 |
comparison
equal
deleted
inserted
replaced
26892:4b966aaadc45 | 26893:19c4b93cb7d6 |
---|---|
306 """ | 306 """ |
307 Generic driver for _imergelocal and _imergeother | 307 Generic driver for _imergelocal and _imergeother |
308 """ | 308 """ |
309 assert localorother is not None | 309 assert localorother is not None |
310 tool, toolpath, binary, symlink = toolconf | 310 tool, toolpath, binary, symlink = toolconf |
311 if symlink: | |
312 repo.ui.warn(_('warning: :merge-%s cannot merge symlinks ' | |
313 'for %s\n') % (localorother, fcd.path())) | |
314 return False, 1 | |
315 a, b, c, back = files | 311 a, b, c, back = files |
316 r = simplemerge.simplemerge(repo.ui, a, b, c, label=labels, | 312 r = simplemerge.simplemerge(repo.ui, a, b, c, label=labels, |
317 localorother=localorother) | 313 localorother=localorother) |
318 return True, r | 314 return True, r |
319 | 315 |
320 @internaltool('merge-local', mergeonly) | 316 @internaltool('merge-local', mergeonly, precheck=_symlinkcheck) |
321 def _imergelocal(*args, **kwargs): | 317 def _imergelocal(*args, **kwargs): |
322 """ | 318 """ |
323 Like :merge, but resolve all conflicts non-interactively in favor | 319 Like :merge, but resolve all conflicts non-interactively in favor |
324 of the local changes.""" | 320 of the local changes.""" |
325 success, status = _imergeauto(localorother='local', *args, **kwargs) | 321 success, status = _imergeauto(localorother='local', *args, **kwargs) |
326 return success, status | 322 return success, status |
327 | 323 |
328 @internaltool('merge-other', mergeonly) | 324 @internaltool('merge-other', mergeonly, precheck=_symlinkcheck) |
329 def _imergeother(*args, **kwargs): | 325 def _imergeother(*args, **kwargs): |
330 """ | 326 """ |
331 Like :merge, but resolve all conflicts non-interactively in favor | 327 Like :merge, but resolve all conflicts non-interactively in favor |
332 of the other changes.""" | 328 of the other changes.""" |
333 success, status = _imergeauto(localorother='other', *args, **kwargs) | 329 success, status = _imergeauto(localorother='other', *args, **kwargs) |