hgext/fastannotate/commands.py
changeset 40838 901f6ef670ca
parent 40295 fa88170c10bb
child 42057 566daffc607d
equal deleted inserted replaced
40837:64051af15596 40838:901f6ef670ca
   259         if opts.get('REV'):
   259         if opts.get('REV'):
   260             raise error.Abort(_('--rev cannot be used for client'))
   260             raise error.Abort(_('--rev cannot be used for client'))
   261         repo.prefetchfastannotate(paths)
   261         repo.prefetchfastannotate(paths)
   262     else:
   262     else:
   263         # server, or full repo
   263         # server, or full repo
       
   264         progress = ui.makeprogress(_('building'), total=len(paths))
   264         for i, path in enumerate(paths):
   265         for i, path in enumerate(paths):
   265             ui.progress(_('building'), i, total=len(paths))
   266             progress.update(i)
   266             with facontext.annotatecontext(repo, path) as actx:
   267             with facontext.annotatecontext(repo, path) as actx:
   267                 try:
   268                 try:
   268                     if actx.isuptodate(rev):
   269                     if actx.isuptodate(rev):
   269                         continue
   270                         continue
   270                     actx.annotate(rev, rev)
   271                     actx.annotate(rev, rev)
   279                     except Exception as ex:
   280                     except Exception as ex:
   280                         # possibly a bug, but should not stop us from building
   281                         # possibly a bug, but should not stop us from building
   281                         # cache for other files.
   282                         # cache for other files.
   282                         ui.warn(_('fastannotate: %s: failed to '
   283                         ui.warn(_('fastannotate: %s: failed to '
   283                                   'build cache: %r\n') % (path, ex))
   284                                   'build cache: %r\n') % (path, ex))
   284         # clear the progress bar
   285         progress.complete()
   285         ui.write()