# HG changeset patch # User Matt Mackall # Date 2006-09-29 21:01:46 # Node ID e78185746554d088ddec70653834341eaeed5297 # Parent ff15ba23c1cf58267575f3003f490c8b06658b80 Add equality operators to changectx and filectx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -31,6 +31,9 @@ class changectx(object): def __repr__(self): return "" % short(self.node()) + def __eq__(self, other): + return self._rev == other._rev + def changeset(self): try: return self._changeset @@ -126,6 +129,9 @@ class filectx(object): def __repr__(self): return "" % (self.path(), short(self.node())) + def __eq__(self, other): + return self._path == other._path and self._changeid == other._changeid + def filerev(self): return self._filerev def filenode(self): return self._filenode def filelog(self): return self._filelog