[Updated] D11353: dirstate: drop the `_otherparent` method

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Fri Aug 27 12:41:00 UTC 2021


Closed by commit rHG496a8e383aeb: dirstate: drop the `_otherparent` method (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11353?vs=30069&id=30111

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11353/new/

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -729,10 +729,8 @@
                 # (see `merged_removed` and `from_p2_removed`)
                 if entry.merged_removed or entry.from_p2_removed:
                     source = self._map.copymap.get(f)
-                    if entry.merged_removed:
-                        self._otherparent(f)
-                    elif entry.from_p2_removed:
-                        self._otherparent(f)
+                    self._addpath(f, from_p2=True)
+                    self._map.copymap.pop(f, None)
                     if source is not None:
                         self.copy(source, f)
                     return
@@ -741,19 +739,6 @@
         self._addpath(f, possibly_dirty=True)
         self._map.copymap.pop(f, None)
 
-    def _otherparent(self, f):
-        if not self.in_merge:
-            msg = _(b"setting %r to other parent only allowed in merges") % f
-            raise error.Abort(msg)
-        entry = self._map.get(f)
-        if entry is not None and entry.tracked:
-            # merge-like
-            self._addpath(f, merged=True)
-        else:
-            # add-like
-            self._addpath(f, from_p2=True)
-        self._map.copymap.pop(f, None)
-
     def _add(self, filename):
         """internal function to mark a file as added"""
         self._addpath(filename, added=True)



To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210827/feec63c7/attachment-0002.html>


More information about the Mercurial-patches mailing list