##// END OF EJS Templates
commit: pass ChangingFiles object as argument to _process_files...
Pulkit Goyal -
r46300:60c46cc2 default
parent child Browse files
Show More
@@ -114,14 +114,16 b' def _prepare_files(tr, ctx, error=False,'
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 files = metadata.ChangingFiles()
117 ms = mergestate.mergestate.read(repo)
118 ms = mergestate.mergestate.read(repo)
118 salvaged = _get_salvaged(repo, ms, ctx)
119 salvaged = _get_salvaged(repo, ms, ctx)
120 for s in salvaged:
121 files.mark_salvaged(s)
119
122
120 if ctx.manifestnode():
123 if ctx.manifestnode():
121 # reuse an existing manifest revision
124 # reuse an existing manifest revision
122 repo.ui.debug(b'reusing known manifest\n')
125 repo.ui.debug(b'reusing known manifest\n')
123 mn = ctx.manifestnode()
126 mn = ctx.manifestnode()
124 files = metadata.ChangingFiles()
125 files.update_touched(ctx.files())
127 files.update_touched(ctx.files())
126 if writechangesetcopy:
128 if writechangesetcopy:
127 files.update_added(ctx.filesadded())
129 files.update_added(ctx.filesadded())
@@ -129,9 +131,8 b' def _prepare_files(tr, ctx, error=False,'
129 elif not ctx.files():
131 elif not ctx.files():
130 repo.ui.debug(b'reusing manifest from p1 (no file change)\n')
132 repo.ui.debug(b'reusing manifest from p1 (no file change)\n')
131 mn = p1.manifestnode()
133 mn = p1.manifestnode()
132 files = metadata.ChangingFiles()
133 else:
134 else:
134 mn, files = _process_files(tr, ctx, ms, error=error)
135 mn = _process_files(tr, ctx, ms, files, error=error)
135
136
136 if origctx and origctx.manifestnode() == mn:
137 if origctx and origctx.manifestnode() == mn:
137 origfiles = origctx.files()
138 origfiles = origctx.files()
@@ -142,9 +143,6 b' def _prepare_files(tr, ctx, error=False,'
142 files.update_copies_from_p1(ctx.p1copies())
143 files.update_copies_from_p1(ctx.p1copies())
143 files.update_copies_from_p2(ctx.p2copies())
144 files.update_copies_from_p2(ctx.p2copies())
144
145
145 for s in salvaged:
146 files.mark_salvaged(s)
147
148 return mn, files
146 return mn, files
149
147
150
148
@@ -165,7 +163,7 b' def _get_salvaged(repo, ms, ctx):'
165 return salvaged
163 return salvaged
166
164
167
165
168 def _process_files(tr, ctx, ms, error=False):
166 def _process_files(tr, ctx, ms, files, error=False):
169 repo = ctx.repo()
167 repo = ctx.repo()
170 p1 = ctx.p1()
168 p1 = ctx.p1()
171 p2 = ctx.p2()
169 p2 = ctx.p2()
@@ -180,8 +178,6 b' def _process_files(tr, ctx, ms, error=Fa'
180 m1 = m1ctx.read()
178 m1 = m1ctx.read()
181 m2 = m2ctx.read()
179 m2 = m2ctx.read()
182
180
183 files = metadata.ChangingFiles()
184
185 # check in files
181 # check in files
186 added = []
182 added = []
187 removed = list(ctx.removed())
183 removed = list(ctx.removed())
@@ -231,7 +227,7 b' def _process_files(tr, ctx, ms, error=Fa'
231
227
232 mn = _commit_manifest(tr, linkrev, ctx, mctx, m, files.touched, added, drop)
228 mn = _commit_manifest(tr, linkrev, ctx, mctx, m, files.touched, added, drop)
233
229
234 return mn, files
230 return mn
235
231
236
232
237 def _filecommit(
233 def _filecommit(
General Comments 0
You need to be logged in to leave comments. Login now