Patchwork [07,of,12] merge: drop deprecated support for accessing `updateresult` fields by index

login
register
mail settings
Submitter Matt Harbison
Date May 11, 2018, 5:11 a.m.
Message ID <5c36273e830d02439eb1.1526015480@Envy>
Download mbox | patch
Permalink /patch/31496/
State Accepted
Headers show

Comments

Matt Harbison - May 11, 2018, 5:11 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1526003785 14400
#      Thu May 10 21:56:25 2018 -0400
# Node ID 5c36273e830d02439eb17cd6f9a1d72b1ccdb911
# Parent  2510563dd5b28a1dbe26cae22cb8964cc73eaeaa
merge: drop deprecated support for accessing `updateresult` fields by index

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1490,27 +1490,6 @@  class updateresult(object):
         return (not self.updatedcount and not self.mergedcount
                 and not self.removedcount and not self.unresolvedcount)
 
-    # TODO remove container emulation once consumers switch to new API.
-
-    def __getitem__(self, x):
-        util.nouideprecwarn('access merge.update() results by name instead of '
-                            'index', '4.6', 2)
-        if x == 0:
-            return self.updatedcount
-        elif x == 1:
-            return self.mergedcount
-        elif x == 2:
-            return self.removedcount
-        elif x == 3:
-            return self.unresolvedcount
-        else:
-            raise IndexError('can only access items 0-3')
-
-    def __len__(self):
-        util.nouideprecwarn('access merge.update() results by name instead of '
-                            'index', '4.6', 2)
-        return 4
-
 def applyupdates(repo, actions, wctx, mctx, overwrite, labels=None):
     """apply the merge action list to the working directory