Mercurial > hg
comparison mercurial/context.py @ 25303:b7876b8fa063
patch: add 'extra' argument to makememctx
The uncommit command in evolve needs to create memory context with given
extra parameters. This patch allows us to do that instead of always giving them
an empty value and having to override it afterwards.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Fri, 22 May 2015 13:06:45 -0700 |
parents | 472a685a4961 |
children | 95c271356a66 |
comparison
equal
deleted
inserted
replaced
25302:bcb17d7dbec2 | 25303:b7876b8fa063 |
---|---|
338 | 338 |
339 return r | 339 return r |
340 | 340 |
341 | 341 |
342 def makememctx(repo, parents, text, user, date, branch, files, store, | 342 def makememctx(repo, parents, text, user, date, branch, files, store, |
343 editor=None): | 343 editor=None, extra=None): |
344 def getfilectx(repo, memctx, path): | 344 def getfilectx(repo, memctx, path): |
345 data, mode, copied = store.getfile(path) | 345 data, mode, copied = store.getfile(path) |
346 if data is None: | 346 if data is None: |
347 return None | 347 return None |
348 islink, isexec = mode | 348 islink, isexec = mode |
349 return memfilectx(repo, path, data, islink=islink, isexec=isexec, | 349 return memfilectx(repo, path, data, islink=islink, isexec=isexec, |
350 copied=copied, memctx=memctx) | 350 copied=copied, memctx=memctx) |
351 extra = {} | 351 if extra is None: |
352 extra = {} | |
352 if branch: | 353 if branch: |
353 extra['branch'] = encoding.fromlocal(branch) | 354 extra['branch'] = encoding.fromlocal(branch) |
354 ctx = memctx(repo, parents, text, files, getfilectx, user, | 355 ctx = memctx(repo, parents, text, files, getfilectx, user, |
355 date, extra, editor) | 356 date, extra, editor) |
356 return ctx | 357 return ctx |