changeset 8051:8a4a8020c38f

vcs: fix __eq__ to return false if types are different Follow up to ae12fabba699.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 26 Dec 2019 04:51:47 +0100
parents 804dc8c6d204
children 838bdb265025
files kallithea/lib/vcs/backends/base.py kallithea/lib/vcs/nodes.py
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/vcs/backends/base.py	Thu Dec 26 01:44:25 2019 +0100
+++ b/kallithea/lib/vcs/backends/base.py	Thu Dec 26 04:51:47 2019 +0100
@@ -374,6 +374,8 @@
         return u'%s:%s' % (self.revision, self.short_id)
 
     def __eq__(self, other):
+        if type(self) is not type(other):
+            return False
         return self.raw_id == other.raw_id
 
     def __json__(self, with_file_list=False):
--- a/kallithea/lib/vcs/nodes.py	Thu Dec 26 01:44:25 2019 +0100
+++ b/kallithea/lib/vcs/nodes.py	Thu Dec 26 04:51:47 2019 +0100
@@ -144,6 +144,8 @@
     kind = property(_get_kind, _set_kind)
 
     def __eq__(self, other):
+        if type(self) is not type(other):
+            return False
         if self._kind != other._kind:
             return False
         if self.path != other.path: