From patchwork Thu Sep 5 20:07:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [46, of, 48, RFC] commitablefilectx: move __nonzero__ from workingfilectx From: Sean Farley X-Patchwork-Id: 2384 Message-Id: <2d2d9d92a1d104410d6b.1378411660@laptop.local> To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:07:40 -0500 # HG changeset patch # User Sean Farley # Date 1376590986 18000 # Thu Aug 15 13:23:06 2013 -0500 # Node ID 2d2d9d92a1d104410d6ba7d29517d7d6f311eecd # Parent abc3acd32a7860c73680d15cecf525ec1cca0b8a commitablefilectx: move __nonzero__ from workingfilectx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1200,23 +1200,23 @@ if filelog is not None: self._filelog = filelog if ctx: self._changectx = ctx + def __nonzero__(self): + return True + class workingfilectx(commitablefilectx): """A workingfilectx object makes access to data related to a particular file in the working directory convenient.""" def __init__(self, repo, path, filelog=None, workingctx=None): super(workingfilectx, self).__init__(repo, path, filelog, workingctx) @propertycache def _changectx(self): return workingctx(self._repo) - def __nonzero__(self): - return True - def data(self): return self._repo.wread(self._path) def renamed(self): rp = self._repo.dirstate.copied(self._path) if not rp: