[PATCH 38 of 48 RFC] commitablectx: move flags from workingctx
Sean Farley
sean.michael.farley at gmail.com
Thu Sep 5 20:07:32 UTC 2013
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376515543 18000
# Wed Aug 14 16:25:43 2013 -0500
# Node ID 71c828371ffd75b706a037f860ed82ae5d67d1c0
# Parent 9b3ddba67aec58a5f2d27af04015114de43b7878
commitablectx: move flags from workingctx
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1016,10 +1016,22 @@
return False
def children(self):
return []
+ def flags(self, path):
+ if '_manifest' in self.__dict__:
+ try:
+ return self._manifest.flags(path)
+ except KeyError:
+ return ''
+
+ try:
+ return self._flagfunc(path)
+ except OSError:
+ return ''
+
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.
@@ -1042,22 +1054,10 @@
p = self._repo.dirstate.parents()
if p[1] == nullid:
p = p[:-1]
return [changectx(self._repo, x) for x in p]
- def flags(self, path):
- if '_manifest' in self.__dict__:
- try:
- return self._manifest.flags(path)
- except KeyError:
- return ''
-
- try:
- return self._flagfunc(path)
- except OSError:
- return ''
-
def filectx(self, path, filelog=None):
"""get a file context from the working directory"""
return workingfilectx(self._repo, path, workingctx=self,
filelog=filelog)
More information about the Mercurial-devel
mailing list