Patchwork [31,of,48,RFC] commitablectx: move closesbranch from workingctx

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <2f615119bfe6364ed69c.1378411645@laptop.local>
Download mbox | patch
Permalink /patch/2369/
State Accepted
Commit 21e1068109a72692f233132f7cf0d61dc6e14fc1
Headers show

Comments

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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -987,10 +987,12 @@ 
     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'])
+    def closesbranch(self):
+        return 'close' in self._extra
 
 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.
@@ -1014,12 +1016,10 @@ 
         p = self._repo.dirstate.parents()
         if p[1] == nullid:
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
 
-    def closesbranch(self):
-        return 'close' in self._extra
     def extra(self):
         return self._extra
 
     def tags(self):
         t = []