Show More
@@ -461,6 +461,12 b' class basefilectx(object):' | |||||
461 | def __repr__(self): |
|
461 | def __repr__(self): | |
462 | return "<%s %s>" % (type(self).__name__, str(self)) |
|
462 | return "<%s %s>" % (type(self).__name__, str(self)) | |
463 |
|
463 | |||
|
464 | def __hash__(self): | |||
|
465 | try: | |||
|
466 | return hash((self._path, self._filenode)) | |||
|
467 | except AttributeError: | |||
|
468 | return id(self) | |||
|
469 | ||||
464 | class filectx(basefilectx): |
|
470 | class filectx(basefilectx): | |
465 | """A filecontext object makes access to data related to a particular |
|
471 | """A filecontext object makes access to data related to a particular | |
466 | filerevision convenient.""" |
|
472 | filerevision convenient.""" | |
@@ -510,12 +516,6 b' class filectx(basefilectx):' | |||||
510 | # considered when solving linkrev issue are on the table. |
|
516 | # considered when solving linkrev issue are on the table. | |
511 | return changectx(self._repo.unfiltered(), self._changeid) |
|
517 | return changectx(self._repo.unfiltered(), self._changeid) | |
512 |
|
518 | |||
513 | def __hash__(self): |
|
|||
514 | try: |
|
|||
515 | return hash((self._path, self._filenode)) |
|
|||
516 | except AttributeError: |
|
|||
517 | return id(self) |
|
|||
518 |
|
||||
519 | def __eq__(self, other): |
|
519 | def __eq__(self, other): | |
520 | try: |
|
520 | try: | |
521 | return (self._path == other._path |
|
521 | return (self._path == other._path |
General Comments 0
You need to be logged in to leave comments.
Login now