# HG changeset patch # User Matt Mackall # Date 2006-09-22 21:12:39 # Node ID 6719b3dd7d504606725ae172afccce93864aca68 # Parent a5e4c8172acedff548ff7ebe69b9540351306aea context: add __repr__ methods diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -28,6 +28,9 @@ class changectx(object): self._node = self._repo.lookup(changeid) self._rev = self._repo.changelog.rev(self._node) + def __repr__(self): + return "" % short(self.node()) + def changeset(self): try: return self._changeset @@ -120,6 +123,9 @@ class filectx(object): else: raise AttributeError, name + def __repr__(self): + return "" % (self.path(), short(self.node())) + def filerev(self): return self._filerev def filenode(self): return self._filenode def filelog(self): return self._filelog