Mercurial > public > mercurial-scm > hg
comparison mercurial/filemerge.py @ 48577:62682662346c
filemerge: make `labels` a required arg for `_premerge()`
We always pass labels, and it's always a non-empty list, so we can
simplify a bit.
Differential Revision: https://phab.mercurial-scm.org/D12012
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 20 Jan 2022 09:04:39 -0800 |
parents | 1a84758b4fca |
children | 77e24ee8994b |
comparison
equal
deleted
inserted
replaced
48576:1a84758b4fca | 48577:62682662346c |
---|---|
397 return filectx.changectx()[filectx.path()] | 397 return filectx.changectx()[filectx.path()] |
398 else: | 398 else: |
399 return filectx | 399 return filectx |
400 | 400 |
401 | 401 |
402 def _premerge(repo, fcd, fco, fca, toolconf, backup, labels=None): | 402 def _premerge(repo, fcd, fco, fca, toolconf, backup, labels): |
403 tool, toolpath, binary, symlink, scriptfn = toolconf | 403 tool, toolpath, binary, symlink, scriptfn = toolconf |
404 if symlink or fcd.isabsent() or fco.isabsent(): | 404 if symlink or fcd.isabsent() or fco.isabsent(): |
405 return 1 | 405 return 1 |
406 | 406 |
407 ui = repo.ui | 407 ui = repo.ui |
419 _(b"%s.premerge not valid ('%s' is neither boolean nor %s)") | 419 _(b"%s.premerge not valid ('%s' is neither boolean nor %s)") |
420 % (tool, premerge, _valid) | 420 % (tool, premerge, _valid) |
421 ) | 421 ) |
422 | 422 |
423 if premerge: | 423 if premerge: |
424 if not labels: | |
425 labels = _defaultconflictlabels | |
426 if len(labels) < 3: | 424 if len(labels) < 3: |
427 labels.append(b'base') | 425 labels.append(b'base') |
428 mode = b'merge' | 426 mode = b'merge' |
429 if premerge == b'keep-mergediff': | 427 if premerge == b'keep-mergediff': |
430 mode = b'mergediff' | 428 mode = b'mergediff' |