Patchwork D12012: filemerge: make `labels` a required arg for `_premerge()`

login
register
mail settings
Submitter phabricator
Date Jan. 21, 2022, 11:36 p.m.
Message ID <differential-rev-PHID-DREV-54co3zy5vfmucqyqprml-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50338/
State New
Headers show

Comments

phabricator - Jan. 21, 2022, 11:36 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We always pass labels, and it's always a non-empty list, so we can
  simplify a bit.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12012

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -399,7 +399,7 @@ 
         return filectx
 
 
-def _premerge(repo, fcd, fco, fca, toolconf, backup, labels=None):
+def _premerge(repo, fcd, fco, fca, toolconf, backup, labels):
     tool, toolpath, binary, symlink, scriptfn = toolconf
     if symlink or fcd.isabsent() or fco.isabsent():
         return 1
@@ -421,8 +421,6 @@ 
             )
 
     if premerge:
-        if not labels:
-            labels = _defaultconflictlabels
         if len(labels) < 3:
             labels.append(b'base')
         mode = b'merge'