comparison mercurial/context.py @ 19701:f0f8380ec516

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Thu, 15 Aug 2013 13:11:51 -0500
parents 8f48f5969b47
children d25fdd4c2fd1
comparison
equal deleted inserted replaced
19700:8f48f5969b47 19701:f0f8380ec516
1186 self._repo.dirstate.add(dest) 1186 self._repo.dirstate.add(dest)
1187 self._repo.dirstate.copy(source, dest) 1187 self._repo.dirstate.copy(source, dest)
1188 finally: 1188 finally:
1189 wlock.release() 1189 wlock.release()
1190 1190
1191 class workingfilectx(basefilectx): 1191 class commitablefilectx(basefilectx):
1192 """A commitablefilectx provides common functionality for a file context that
1193 wants the ability to commit, e.g. workingfilectx or memfilectx."""
1194 def __init__(self, repo, path, filelog=None, ctx=None):
1195 pass
1196
1197 class workingfilectx(commitablefilectx):
1192 """A workingfilectx object makes access to data related to a particular 1198 """A workingfilectx object makes access to data related to a particular
1193 file in the working directory convenient.""" 1199 file in the working directory convenient."""
1194 def __init__(self, repo, path, filelog=None, workingctx=None): 1200 def __init__(self, repo, path, filelog=None, workingctx=None):
1195 self._repo = repo 1201 self._repo = repo
1196 self._path = path 1202 self._path = path