Patchwork [12,of,48,RFC] commitablectx: move _buildflagfunc from workingctx

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <b2af4914ffef7e865b2d.1378411626@laptop.local>
Download mbox | patch
Permalink /patch/2350/
State Accepted
Commit 8120ea4b87f5e0be26924f99f0d14562b1e3fa15
Headers show

Comments

Sean Farley - Sept. 5, 2013, 8:07 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376512188 18000
#      Wed Aug 14 15:29:48 2013 -0500
# Node ID b2af4914ffef7e865b2d0eff97c4de0afdbdb58b
# Parent  4b7681f0c4a49fc5b8a4310b8e40d81c77c0a255
commitablectx: move _buildflagfunc from workingctx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -863,23 +863,10 @@ 
         return True
 
     def __contains__(self, key):
         return self._repo.dirstate[key] not in "?r"
 
-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.
-    extra - a dictionary of extra values, or None.
-    changes - a list of file lists as returned by localrepo.status()
-               or None to use the repository status.
-    """
-    def __init__(self, repo, text="", user=None, date=None, extra=None,
-                 changes=None):
-        super(workingctx, self).__init__(repo, text, user, date, extra, changes)
-
     def _buildflagfunc(self):
         # Create a fallback function for getting file flags when the
         # filesystem doesn't support them
 
         copiesget = self._repo.dirstate.copies().get
@@ -908,10 +895,23 @@ 
                     return fl1
                 return '' # punt for conflicts
 
         return func
 
+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.
+    extra - a dictionary of extra values, or None.
+    changes - a list of file lists as returned by localrepo.status()
+               or None to use the repository status.
+    """
+    def __init__(self, repo, text="", user=None, date=None, extra=None,
+                 changes=None):
+        super(workingctx, self).__init__(repo, text, user, date, extra, changes)
+
     @propertycache
     def _flagfunc(self):
         return self._repo.dirstate.flagfunc(self._buildflagfunc)
 
     @propertycache