comparison mercurial/context.py @ 20035:cd79d9ab5e42

makememctx: move from patch to context to break import cycle
author Augie Fackler <raf@durin42.com>
date Wed, 06 Nov 2013 22:09:15 -0500
parents d51c4d85ec23
children d0097d5818f9
comparison
equal deleted inserted replaced
20034:1e5b38a919dd 20035:cd79d9ab5e42
192 def dirs(self): 192 def dirs(self):
193 return self._dirs 193 return self._dirs
194 194
195 def dirty(self): 195 def dirty(self):
196 return False 196 return False
197
198 def makememctx(repo, parents, text, user, date, branch, files, store,
199 editor=None):
200 def getfilectx(repo, memctx, path):
201 data, (islink, isexec), copied = store.getfile(path)
202 return memfilectx(path, data, islink=islink, isexec=isexec,
203 copied=copied)
204 extra = {}
205 if branch:
206 extra['branch'] = encoding.fromlocal(branch)
207 ctx = memctx(repo, parents, text, files, getfilectx, user,
208 date, extra)
209 if editor:
210 ctx._text = editor(repo, ctx, [])
211 return ctx
197 212
198 class changectx(basectx): 213 class changectx(basectx):
199 """A changecontext object makes access to data related to a particular 214 """A changecontext object makes access to data related to a particular
200 changeset convenient. It represents a read-only context already present in 215 changeset convenient. It represents a read-only context already present in
201 the repo.""" 216 the repo."""