Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 19548:730fdcaa791d
basectx: move __ne__ from changectx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Mon, 05 Aug 2013 17:00:32 -0500 |
parents | 0537c0cfd87c |
children | 78155484ae34 |
comparison
equal
deleted
inserted
replaced
19547:0537c0cfd87c | 19548:730fdcaa791d |
---|---|
47 def __eq__(self, other): | 47 def __eq__(self, other): |
48 try: | 48 try: |
49 return type(self) == type(other) and self._rev == other._rev | 49 return type(self) == type(other) and self._rev == other._rev |
50 except AttributeError: | 50 except AttributeError: |
51 return False | 51 return False |
52 | |
53 def __ne__(self, other): | |
54 return not (self == other) | |
52 | 55 |
53 def rev(self): | 56 def rev(self): |
54 return self._rev | 57 return self._rev |
55 def node(self): | 58 def node(self): |
56 return self._node | 59 return self._node |
165 def __hash__(self): | 168 def __hash__(self): |
166 try: | 169 try: |
167 return hash(self._rev) | 170 return hash(self._rev) |
168 except AttributeError: | 171 except AttributeError: |
169 return id(self) | 172 return id(self) |
170 | |
171 def __ne__(self, other): | |
172 return not (self == other) | |
173 | 173 |
174 def __nonzero__(self): | 174 def __nonzero__(self): |
175 return self._rev != nullrev | 175 return self._rev != nullrev |
176 | 176 |
177 @propertycache | 177 @propertycache |