From patchwork Thu Sep 5 20:07:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [10,of,48,RFC] commitablectx: move __nonzero__ from workingctx From: Sean Farley X-Patchwork-Id: 2348 Message-Id: To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:07:04 -0500 # HG changeset patch # User Sean Farley # Date 1376512123 18000 # Wed Aug 14 15:28:43 2013 -0500 # Node ID c15013ded2f4657cb7922875cf46a066b74973f2 # Parent 85bd92deda9d18097270bf09ac6d0f14ad18bc23 commitablectx: move __nonzero__ from workingctx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -857,10 +857,13 @@ self._extra['branch'] = 'default' def __str__(self): return str(self._parents[0]) + "+" + def __nonzero__(self): + return True + 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. @@ -870,13 +873,10 @@ """ def __init__(self, repo, text="", user=None, date=None, extra=None, changes=None): super(workingctx, self).__init__(repo, text, user, date, extra, changes) - def __nonzero__(self): - return True - def __contains__(self, key): return self._repo.dirstate[key] not in "?r" def _buildflagfunc(self): # Create a fallback function for getting file flags when the