# HG changeset patch # User Ryan McElroy # Date 1473069804 25200 # Node ID c4a2ef796c1961d88487f3413e5b25d577e65525 # Parent 9c15c89088fd57212a19e969d8de66491b66c974 add progress to commit discovery phase In large repositories, the commit discovery phase can take minutes. Let's give the user feedback on how long it will take. diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -411,13 +411,27 @@ # CHANGESET CONVERSION METHODS def export_git_objects(self): + self.ui.note(_("finding hg commits to export\n")) repo = self.repo clnode = repo.changelog.node + nodes = (clnode(n) for n in repo) - export = (repo[node] for node in nodes if not hex(node) in + to_export = (repo[node] for node in nodes if not hex(node) in self._map_hg) - export = [ctx for ctx in export - if ctx.extra().get('hg-git', None) != 'octopus'] + + todo_total = len(repo) - len(self._map_hg) + topic = 'find commits to export' + pos = 0 + unit = 'commits' + + export = [] + for ctx in to_export: + item = hex(ctx.node()) + pos += 1 + repo.ui.progress(topic, pos, item, unit, todo_total) + if ctx.extra().get('hg-git', None) != 'octopus': + export.append(ctx) + total = len(export) if not total: return