From patchwork Thu Sep 5 20:07:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [38,of,48,RFC] commitablectx: move flags from workingctx From: Sean Farley X-Patchwork-Id: 2376 Message-Id: <71c828371ffd75b706a0.1378411652@laptop.local> To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:07:32 -0500 # HG changeset patch # User Sean Farley # 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)