Patchwork [1,of,5,V2] upgrade: implement '__ne__' on 'improvement' class

login
register
mail settings
Submitter Pierre-Yves David
Date April 17, 2017, 11:42 a.m.
Message ID <49c2ac7c9a542808367b.1492429331@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20250/
State Accepted
Headers show

Comments

Pierre-Yves David - April 17, 2017, 11:42 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1492427242 -7200
#      Mon Apr 17 13:07:22 2017 +0200
# Node ID 49c2ac7c9a542808367b28d6c03d424a0fce1077
# Parent  3c77f03f16b386940c60af36d6a3ad83bee37ad4
# EXP-Topic upgraderepo
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 49c2ac7c9a54
upgrade: implement '__ne__' on 'improvement' class

The pythonomicon request its implementation.

Patch

diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -144,6 +144,9 @@  class improvement(object):
             return NotImplemented
         return self.name == other.name
 
+    def __ne__(self, other):
+        return not self == other
+
 def finddeficiencies(repo):
     """returns a list of deficiencies that the repo suffer from"""
     newreporeqs = localrepo.newreporequirements(repo)