# HG changeset patch # User Matt Mackall # Date 1159565384 18000 # Node ID ebdb3f616bc00913509538508b3810df70a90b04 # Parent e78185746554d088ddec70653834341eaeed5297 Add str methods to contexts 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 __str__(self): + return short(self.node()) + def __repr__(self): return "" % short(self.node()) @@ -126,6 +129,9 @@ class filectx(object): else: raise AttributeError, name + def __str__(self): + return "%s@%s" % (self.path(), short(self.node())) + def __repr__(self): return "" % (self.path(), short(self.node()))