From patchwork Thu Sep 5 20:06:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [03, of, 48, RFC] basefilectx: use basectx __str__ instead of duplicating logic From: Sean Farley X-Patchwork-Id: 2341 Message-Id: <242d2cb12423330b4ef6.1378411617@laptop.local> To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:06:57 -0500 # HG changeset patch # User Sean Farley # Date 1376591477 18000 # Thu Aug 15 13:31:17 2013 -0500 # Node ID 242d2cb12423330b4ef6d8c26a5b1efa69d7fbae # Parent 82e46067545bd19bb2f566059d425ec4fe108768 basefilectx: use basectx __str__ instead of duplicating logic This change allows us to only rely on one place to convert a context to a string which will help eliminate duplicate code in context.py diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -454,11 +454,11 @@ except error.LookupError: # file is missing return False def __str__(self): - return "%s@%s" % (self.path(), short(self.node())) + return "%s@%s" % (self.path(), self._changectx) def __repr__(self): return "<%s %s>" % (type(self).__name__, str(self)) def __hash__(self):