Show More
@@ -2060,6 +2060,22 b' def memfilefromctx(ctx):' | |||
|
2060 | 2060 | |
|
2061 | 2061 | return getfilectx |
|
2062 | 2062 | |
|
2063 | def memfilefrompatch(patchstore): | |
|
2064 | """Given a patch (e.g. patchstore object) return a memfilectx | |
|
2065 | ||
|
2066 | This is a convenience method for building a memctx based on a patchstore. | |
|
2067 | """ | |
|
2068 | def getfilectx(repo, memctx, path): | |
|
2069 | data, mode, copied = patchstore.getfile(path) | |
|
2070 | if data is None: | |
|
2071 | return None | |
|
2072 | islink, isexec = mode | |
|
2073 | return memfilectx(repo, path, data, islink=islink, | |
|
2074 | isexec=isexec, copied=copied, | |
|
2075 | memctx=memctx) | |
|
2076 | ||
|
2077 | return getfilectx | |
|
2078 | ||
|
2063 | 2079 | class memctx(committablectx): |
|
2064 | 2080 | """Use memctx to perform in-memory commits via localrepo.commitctx(). |
|
2065 | 2081 |
General Comments 0
You need to be logged in to leave comments.
Login now