[PATCH 10 of 36] context: use type(self).__name__ to instead of hardcoding class name

Augie Fackler raf at durin42.com
Wed Aug 7 13:26:49 CDT 2013


On Wed, Aug 07, 2013 at 01:13:10PM -0500, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley at gmail.com>
> # Date 1375485848 18000
> #      Fri Aug 02 18:24:08 2013 -0500
> # Node ID d5f3b9240f8d6596e97917a18bf870d60fe7fe88
> # Parent  8d5fbb6e08357ca42b140eaea1d3aaa72d10aec5
> context: use type(self).__name__ to instead of hardcoding class name
>
> diff --git a/mercurial/context.py b/mercurial/context.py
> --- a/mercurial/context.py
> +++ b/mercurial/context.py
> @@ -40,11 +40,11 @@
>
>      def __int__(self):
>          return self.rev()
>
>      def __repr__(self):
> -        return "<changectx %s>" % str(self)
> +        return "<%s %s>" % (type(self).__name__, str(self))

Hah, or this. I think I'd fold this into the previous patch.

>
>      def rev(self):
>          return self._rev
>      def node(self):
>          return self._node
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list