##// END OF EJS Templates
merge: don't fiddle with name lookups or i18n in hot loops...
Bryan O'Sullivan -
r18640:a8648f32 default
parent child Browse files
Show More
@@ -349,21 +349,28 b' def getremove(repo, mctx, overwrite, arg'
349
349
350 yields tuples for progress updates
350 yields tuples for progress updates
351 """
351 """
352 verbose = repo.ui.verbose
353 unlink = util.unlinkpath
354 wjoin = repo.wjoin
355 fctx = mctx.filectx
356 wwrite = repo.wwrite
352 audit = repo.wopener.audit
357 audit = repo.wopener.audit
353 i = 0
358 i = 0
354 for arg in args:
359 for arg in args:
355 f = arg[0]
360 f = arg[0]
356 if arg[1] == 'r':
361 if arg[1] == 'r':
357 repo.ui.note(_("removing %s\n") % f)
362 if verbose:
363 repo.ui.note(_("removing %s\n") % f)
358 audit(f)
364 audit(f)
359 try:
365 try:
360 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
366 unlink(wjoin(f), ignoremissing=True)
361 except OSError, inst:
367 except OSError, inst:
362 repo.ui.warn(_("update failed to remove %s: %s!\n") %
368 repo.ui.warn(_("update failed to remove %s: %s!\n") %
363 (f, inst.strerror))
369 (f, inst.strerror))
364 else:
370 else:
365 repo.ui.note(_("getting %s\n") % f)
371 if verbose:
366 repo.wwrite(f, mctx.filectx(f).data(), arg[2][0])
372 repo.ui.note(_("getting %s\n") % f)
373 wwrite(f, fctx(f).data(), arg[2][0])
367 if i == 100:
374 if i == 100:
368 yield i, f
375 yield i, f
369 i = 0
376 i = 0
@@ -442,10 +449,13 b' def applyupdates(repo, actions, wctx, mc'
442 if hgsub and hgsub[0] == 'g':
449 if hgsub and hgsub[0] == 'g':
443 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
450 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
444
451
452 _updating = _('updating')
453 _files = _('files')
454 progress = repo.ui.progress
455
445 for i, a in enumerate(actions):
456 for i, a in enumerate(actions):
446 f, m, args, msg = a
457 f, m, args, msg = a
447 repo.ui.progress(_('updating'), z + i + 1, item=f, total=numupdates,
458 progress(_updating, z + i + 1, item=f, total=numupdates, unit=_files)
448 unit=_('files'))
449 if m == "m": # merge
459 if m == "m": # merge
450 if fd == '.hgsubstate': # subrepo states need updating
460 if fd == '.hgsubstate': # subrepo states need updating
451 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
461 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
@@ -490,7 +500,7 b' def applyupdates(repo, actions, wctx, mc'
490 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags)
500 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags)
491 updated += 1
501 updated += 1
492 ms.commit()
502 ms.commit()
493 repo.ui.progress(_('updating'), None, total=numupdates, unit=_('files'))
503 progress(_updating, None, total=numupdates, unit=_files)
494
504
495 return updated, merged, removed, unresolved
505 return updated, merged, removed, unresolved
496
506
General Comments 0
You need to be logged in to leave comments. Login now