Patchwork [01,of,13] mergestate: rename addpath() -> addpathonflict() to prevent confusion

login
register
mail settings
Submitter Pulkit Goyal
Date July 17, 2020, 8:59 a.m.
Message ID <66fb1ff9343a4d73b44c.1594976362@workspace>
Download mbox | patch
Permalink /patch/46775/
State Accepted
Headers show

Comments

Pulkit Goyal - July 17, 2020, 8:59 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1594286098 -19800
#      Thu Jul 09 14:44:58 2020 +0530
# Node ID 66fb1ff9343a4d73b44c4314d88176e283a7839d
# Parent  33524b6bef53fffcb34708e927c2b53f08fea736
# EXP-Topic mergestate-refactor
mergestate: rename addpath() -> addpathonflict() to prevent confusion

addpath() seems to imply that we are adding a new path/entry to the mergestate.

Differential Revision: https://phab.mercurial-scm.org/D8715

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1264,7 +1264,7 @@  def applyupdates(
         else:
             s(_(b"the remote file has been renamed to %s\n") % f1)
         s(_(b"resolve manually then use 'hg resolve --mark %s'\n") % f)
-        ms.addpath(f, f1, fo)
+        ms.addpathconflict(f, f1, fo)
         progress.increment(item=f)
 
     # When merging in-memory, we can't support worker processes, so set the
diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -540,7 +540,7 @@  class mergestate(object):
         self._stateextras[fd] = {b'ancestorlinknode': hex(fca.node())}
         self._dirty = True
 
-    def addpath(self, path, frename, forigin):
+    def addpathconflict(self, path, frename, forigin):
         """add a new conflicting path to the merge state
         path:    the path that conflicts
         frename: the filename the conflicting file was renamed to