Patchwork [30,of,48,RFC] commitablectx: move branch from workingctx

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <4994a1d0234f83a81983.1378411644@laptop.local>
Download mbox | patch
Permalink /patch/2368/
State Accepted
Commit 54b3b4821bfb613441b598a5af4ec5ee379c8ac4
Headers show

Comments

Sean Farley - Sept. 5, 2013, 8:07 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376515382 18000
#      Wed Aug 14 16:23:02 2013 -0500
# Node ID 4994a1d0234f83a81983f67972d9410ac74da6f8
# Parent  f1a22f9501eb519d76c98351fa1c7ac6717461e7
commitablectx: move branch from workingctx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -985,10 +985,12 @@ 
         assert self._ignored is not None  # must call status first
         return self._ignored
     def clean(self):
         assert self._clean is not None  # must call status first
         return self._clean
+    def branch(self):
+        return encoding.tolocal(self._extra['branch'])
 
 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.
@@ -1012,12 +1014,10 @@ 
         p = self._repo.dirstate.parents()
         if p[1] == nullid:
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
 
-    def branch(self):
-        return encoding.tolocal(self._extra['branch'])
     def closesbranch(self):
         return 'close' in self._extra
     def extra(self):
         return self._extra