Mercurial > hg > hg-git
comparison git_handler.py @ 135:421c992c058b
import_git_objects: add progress indicator
author | Sverre Rabbelier <sverre@rabbelier.nl> |
---|---|
date | Fri, 15 May 2009 00:27:38 +0200 (2009-05-14) |
parents | f2dfb2bed724 |
children | 74385b613bb7 |
comparison
equal
deleted
inserted
replaced
134:324a1ad9212a | 135:421c992c058b |
---|---|
463 | 463 |
464 # sort the commits | 464 # sort the commits |
465 commits = toposort.TopoSort(convert_list).items() | 465 commits = toposort.TopoSort(convert_list).items() |
466 | 466 |
467 # import each of the commits, oldest first | 467 # import each of the commits, oldest first |
468 for csha in commits: | 468 total = len(commits) |
469 magnitude = int(math.log(total, 10)) + 1 if total else 1 | |
470 for i, csha in enumerate(commits): | |
471 if i%100 == 0: | |
472 self.ui.status(_("at: %*d/%d\n") % (magnitude, i, total)) | |
469 commit = convert_list[csha] | 473 commit = convert_list[csha] |
470 if not self.map_hg_get(csha): # it's already here | 474 if not self.map_hg_get(csha): # it's already here |
471 self.import_git_commit(commit) | 475 self.import_git_commit(commit) |
472 else: | 476 else: |
473 self.pseudo_import_git_commit(commit) | 477 self.pseudo_import_git_commit(commit) |