Patchwork [09,of,48,RFC] commitablectx: move __str__ from workingctx

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <85bd92deda9d18097270.1378411623@laptop.local>
Download mbox | patch
Permalink /patch/2347/
State Accepted
Commit 09459edfb48b6589dac869cccb46d34e957d1b1a
Headers show

Comments

Sean Farley - Sept. 5, 2013, 8:07 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376511914 18000
#      Wed Aug 14 15:25:14 2013 -0500
# Node ID 85bd92deda9d18097270bf09ac6d0f14ad18bc23
# Parent  aa513e429c79d5267e3072bd8525ea467c42e42a
commitablectx: move __str__ from workingctx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -854,10 +854,13 @@ 
                 raise util.Abort(_('branch name not in UTF-8!'))
             self._extra['branch'] = branch
         if self._extra['branch'] == '':
             self._extra['branch'] = 'default'
 
+    def __str__(self):
+        return str(self._parents[0]) + "+"
+
 class workingctx(commitablectx):
     """A workingctx object makes access to data related to
     the current working directory convenient.
     date - any valid date string or (unixtime, offset), or None.
     user - username string, or None.
@@ -867,13 +870,10 @@ 
     """
     def __init__(self, repo, text="", user=None, date=None, extra=None,
                  changes=None):
         super(workingctx, self).__init__(repo, text, user, date, extra, changes)
 
-    def __str__(self):
-        return str(self._parents[0]) + "+"
-
     def __nonzero__(self):
         return True
 
     def __contains__(self, key):
         return self._repo.dirstate[key] not in "?r"