From patchwork Thu Sep 5 20:07:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [44, of, 48, RFC] commitablefilectx: add a class that will be used for mutable file contexts From: Sean Farley X-Patchwork-Id: 2382 Message-Id: <4bee0401bfe496be4aea.1378411658@laptop.local> To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:07:38 -0500 # HG changeset patch # User Sean Farley # Date 1376590311 18000 # Thu Aug 15 13:11:51 2013 -0500 # Node ID 4bee0401bfe496be4aea50a0ff61df1aff8f814a # Parent 337d91d1d8fa975f2e0589d87c716cabfea98592 commitablefilectx: add a class that will be used for mutable file contexts Just like commitablectx, this will serve as a common place for code that will be shared between workingfilectx and memfilectx. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1186,11 +1186,17 @@ self._repo.dirstate.add(dest) self._repo.dirstate.copy(source, dest) finally: wlock.release() -class workingfilectx(basefilectx): +class commitablefilectx(basefilectx): + """A commitablefilectx provides common functionality for a file context that + wants the ability to commit, e.g. workingfilectx or memfilectx.""" + def __init__(self, repo, path, filelog=None, ctx=None): + pass + +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): self._repo = repo self._path = path