Patchwork [18,of,48,RFC] commitablectx: move user from workingctx

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <ab2af026ad1aa11afa88.1378411632@laptop.local>
Download mbox | patch
Permalink /patch/2356/
State Accepted
Commit 84249d49f37c1d1e47133f1bde3568bbd23718d4
Headers show

Comments

Sean Farley - Sept. 5, 2013, 8:07 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376513844 18000
#      Wed Aug 14 15:57:24 2013 -0500
# Node ID ab2af026ad1aa11afa88f43c45067f5e6422bd3e
# Parent  275fafe6656b04af2fb0f7ea2f04ff7b8d5ce05c
commitablectx: move user from workingctx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -955,10 +955,13 @@ 
         if clean:
             self._clean = stat[6]
         self._status = stat[:4]
         return stat
 
+    def user(self):
+        return self._user or self._repo.ui.username()
+
 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.
@@ -985,12 +988,10 @@ 
         p = self._repo.dirstate.parents()
         if p[1] == nullid:
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
 
-    def user(self):
-        return self._user or self._repo.ui.username()
     def date(self):
         return self._date
     def description(self):
         return self._text
     def files(self):