##// END OF EJS Templates
fix: add progress bar for number of file revisions processed...
Danny Hooper -
r38555:a3be09e2 default
parent child Browse files
Show More
@@ -162,22 +162,25 b' def fix(ui, repo, *pats, **opts):'
162 filedata = collections.defaultdict(dict)
162 filedata = collections.defaultdict(dict)
163 replacements = {}
163 replacements = {}
164 commitorder = sorted(revstofix, reverse=True)
164 commitorder = sorted(revstofix, reverse=True)
165 for rev, path, newdata in results:
165 with ui.makeprogress(topic=_('fixing'), unit=_('files'),
166 if newdata is not None:
166 total=sum(numitems.values())) as progress:
167 filedata[rev][path] = newdata
167 for rev, path, newdata in results:
168 numitems[rev] -= 1
168 progress.increment(item=path)
169 # Apply the fixes for this and any other revisions that are ready
169 if newdata is not None:
170 # and sitting at the front of the queue. Using a loop here prevents
170 filedata[rev][path] = newdata
171 # the queue from being blocked by the first revision to be ready out
171 numitems[rev] -= 1
172 # of order.
172 # Apply the fixes for this and any other revisions that are
173 while commitorder and not numitems[commitorder[-1]]:
173 # ready and sitting at the front of the queue. Using a loop here
174 rev = commitorder.pop()
174 # prevents the queue from being blocked by the first revision to
175 ctx = repo[rev]
175 # be ready out of order.
176 if rev == wdirrev:
176 while commitorder and not numitems[commitorder[-1]]:
177 writeworkingdir(repo, ctx, filedata[rev], replacements)
177 rev = commitorder.pop()
178 else:
178 ctx = repo[rev]
179 replacerev(ui, repo, ctx, filedata[rev], replacements)
179 if rev == wdirrev:
180 del filedata[rev]
180 writeworkingdir(repo, ctx, filedata[rev], replacements)
181 else:
182 replacerev(ui, repo, ctx, filedata[rev], replacements)
183 del filedata[rev]
181
184
182 replacements = {prec: [succ] for prec, succ in replacements.iteritems()}
185 replacements = {prec: [succ] for prec, succ in replacements.iteritems()}
183 scmutil.cleanupnodes(repo, replacements, 'fix', fixphase=True)
186 scmutil.cleanupnodes(repo, replacements, 'fix', fixphase=True)
General Comments 0
You need to be logged in to leave comments. Login now