# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1498081950 -19800 # Node ID daccadd75760193252e0ca5487711e7bafe369ec # Parent 071732d9c210c911924fccdb30daf55185942265 py3: define __bytes__ for basefilectx class The implementation is shamely copied from the __str__ function diff -r 071732d9c210 -r daccadd75760 mercurial/context.py --- a/mercurial/context.py Thu Jun 22 03:20:11 2017 +0530 +++ b/mercurial/context.py Thu Jun 22 03:22:30 2017 +0530 @@ -716,6 +716,12 @@ except error.LookupError: return "%s@???" % self.path() + def __bytes__(self): + try: + return "%s@%s" % (self.path(), self._changectx) + except error.LookupError: + return "%s@???" % self.path() + def __repr__(self): return "<%s %s>" % (type(self).__name__, str(self))