Patchwork [08,of,41] basefilectx: move __str__ from filectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 12, 2013, 4:27 p.m.
Message ID <964844d64ef8fdb02cc5.1376324824@laptop.local>
Download mbox | patch
Permalink /patch/2136/
State Accepted
Commit 964844d64ef8fdb02cc5330f70a1acab158fdfb7
Headers show

Comments

Sean Farley - Aug. 12, 2013, 4:27 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376279130 18000
#      Sun Aug 11 22:45:30 2013 -0500
# Node ID 964844d64ef8fdb02cc5330f70a1acab158fdfb7
# Parent  2c149635c2c56835c152f02043608d803fcb9a63
basefilectx: move __str__ from filectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -453,10 +453,13 @@ 
             return True
         except error.LookupError:
             # file is missing
             return False
 
+    def __str__(self):
+        return "%s@%s" % (self.path(), short(self.node()))
+
 class filectx(basefilectx):
     """A filecontext object makes access to data related to a particular
        filerevision convenient."""
     def __init__(self, repo, path, changeid=None, fileid=None,
                  filelog=None, changectx=None):
@@ -502,13 +505,10 @@ 
             # Linkrevs have several serious troubles with filtering that are
             # complicated to solve. Proper handling of the issue here should be
             # considered when solving linkrev issue are on the table.
             return changectx(self._repo.unfiltered(), self._changeid)
 
-    def __str__(self):
-        return "%s@%s" % (self.path(), short(self.node()))
-
     def __repr__(self):
         return "<filectx %s>" % str(self)
 
     def __hash__(self):
         try: