Mercurial > public > mercurial-scm > hg-stable
diff mercurial/patch.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 | 1184edaead7a |
children | 9f1d4323c749 |
line wrap: on
line diff
--- a/mercurial/patch.py Wed Nov 06 16:48:06 2013 -0500 +++ b/mercurial/patch.py Wed Nov 06 22:09:15 2013 -0500 @@ -16,7 +16,6 @@ from i18n import _ from node import hex, short import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, error -import context gitre = re.compile('diff --git a/(.*) b/(.*)') @@ -1441,21 +1440,6 @@ backend = repobackend(ui, repo, ctx, store) return patchbackend(ui, backend, patchobj, strip, files, eolmode) -def makememctx(repo, parents, text, user, date, branch, files, store, - editor=None): - def getfilectx(repo, memctx, path): - data, (islink, isexec), copied = store.getfile(path) - return context.memfilectx(path, data, islink=islink, isexec=isexec, - copied=copied) - extra = {} - if branch: - extra['branch'] = encoding.fromlocal(branch) - ctx = context.memctx(repo, parents, text, files, getfilectx, user, - date, extra) - if editor: - ctx._text = editor(repo, ctx, []) - return ctx - def patch(ui, repo, patchname, strip=1, files=None, eolmode='strict', similarity=0): """Apply <patchname> to the working directory.