Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45707:035302e6bb38
commit: pass mergestate into `_process_files` instead of re-reading it
Differential Revision: https://phab.mercurial-scm.org/D9193
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 10 Oct 2020 13:15:20 +0530 |
parents | b92887ce8db4 |
children | 60c46cc28bf4 |
comparison
equal
deleted
inserted
replaced
45706:b92887ce8db4 | 45707:035302e6bb38 |
---|---|
129 elif not ctx.files(): | 129 elif not ctx.files(): |
130 repo.ui.debug(b'reusing manifest from p1 (no file change)\n') | 130 repo.ui.debug(b'reusing manifest from p1 (no file change)\n') |
131 mn = p1.manifestnode() | 131 mn = p1.manifestnode() |
132 files = metadata.ChangingFiles() | 132 files = metadata.ChangingFiles() |
133 else: | 133 else: |
134 mn, files = _process_files(tr, ctx, error=error) | 134 mn, files = _process_files(tr, ctx, ms, error=error) |
135 | 135 |
136 if origctx and origctx.manifestnode() == mn: | 136 if origctx and origctx.manifestnode() == mn: |
137 origfiles = origctx.files() | 137 origfiles = origctx.files() |
138 assert files.touched.issubset(origfiles) | 138 assert files.touched.issubset(origfiles) |
139 files.update_touched(origfiles) | 139 files.update_touched(origfiles) |
163 if fname in ctx: | 163 if fname in ctx: |
164 salvaged.append(fname) | 164 salvaged.append(fname) |
165 return salvaged | 165 return salvaged |
166 | 166 |
167 | 167 |
168 def _process_files(tr, ctx, error=False): | 168 def _process_files(tr, ctx, ms, error=False): |
169 repo = ctx.repo() | 169 repo = ctx.repo() |
170 p1 = ctx.p1() | 170 p1 = ctx.p1() |
171 p2 = ctx.p2() | 171 p2 = ctx.p2() |
172 | 172 |
173 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) | 173 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) |
177 mctx = m1ctx.copy() | 177 mctx = m1ctx.copy() |
178 | 178 |
179 m = mctx.read() | 179 m = mctx.read() |
180 m1 = m1ctx.read() | 180 m1 = m1ctx.read() |
181 m2 = m2ctx.read() | 181 m2 = m2ctx.read() |
182 ms = mergestate.mergestate.read(repo) | |
183 | 182 |
184 files = metadata.ChangingFiles() | 183 files = metadata.ChangingFiles() |
185 | 184 |
186 # check in files | 185 # check in files |
187 added = [] | 186 added = [] |