comparison mercurial/commit.py @ 45706:b92887ce8db4

commit: move salvaged calculation a bit earlier in the function This helps us initialize mergestate before and now we can pass it into `_process_files()` instead of re-reading it there. Differential Revision: https://phab.mercurial-scm.org/D9192
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 10 Oct 2020 13:12:11 +0530
parents 61454026fa04
children 035302e6bb38
comparison
equal deleted inserted replaced
45705:61454026fa04 45706:b92887ce8db4
112 def _prepare_files(tr, ctx, error=False, origctx=None): 112 def _prepare_files(tr, ctx, error=False, origctx=None):
113 repo = ctx.repo() 113 repo = ctx.repo()
114 p1 = ctx.p1() 114 p1 = ctx.p1()
115 115
116 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) 116 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo)
117 ms = mergestate.mergestate.read(repo)
118 salvaged = _get_salvaged(repo, ms, ctx)
117 119
118 if ctx.manifestnode(): 120 if ctx.manifestnode():
119 # reuse an existing manifest revision 121 # reuse an existing manifest revision
120 repo.ui.debug(b'reusing known manifest\n') 122 repo.ui.debug(b'reusing known manifest\n')
121 mn = ctx.manifestnode() 123 mn = ctx.manifestnode()
138 140
139 if writechangesetcopy: 141 if writechangesetcopy:
140 files.update_copies_from_p1(ctx.p1copies()) 142 files.update_copies_from_p1(ctx.p1copies())
141 files.update_copies_from_p2(ctx.p2copies()) 143 files.update_copies_from_p2(ctx.p2copies())
142 144
143 ms = mergestate.mergestate.read(repo)
144 salvaged = _get_salvaged(ctx.repo(), ms, ctx)
145 for s in salvaged: 145 for s in salvaged:
146 files.mark_salvaged(s) 146 files.mark_salvaged(s)
147 147
148 return mn, files 148 return mn, files
149 149