diff --git a/gitinspector/blame.py b/gitinspector/blame.py index 902bb03..d284d89 100644 --- a/gitinspector/blame.py +++ b/gitinspector/blame.py @@ -121,13 +121,17 @@ class BlameThread(threading.Thread): PROGRESS_TEXT = N_("Checking how many rows belong to each author (2 of 2): {0:.0f}%") class Blame(object): - def __init__(self, hard, useweeks, changes): + def __init__(self, repo, hard, useweeks, changes): self.blames = {} ls_tree_r = subprocess.Popen(["git", "ls-tree", "--name-only", "-r", interval.get_ref()], bufsize=1, stdout=subprocess.PIPE).stdout lines = ls_tree_r.readlines() ls_tree_r.close() + progress_text = _(PROGRESS_TEXT) + if repo != None: + progress_text = "[%s] " % repo.name + progress_text + for i, row in enumerate(lines): row = row.strip().decode("unicode_escape", "ignore") row = row.encode("latin-1", "replace") @@ -142,7 +146,7 @@ class Blame(object): thread.start() if format.is_interactive_format(): - terminal.output_progress(_(PROGRESS_TEXT), i, len(lines)) + terminal.output_progress(progress_text, i, len(lines)) # Make sure all threads have completed. for i in range(0, NUM_THREADS): diff --git a/gitinspector/changes.py b/gitinspector/changes.py index 0c0cd20..4b95f89 100644 --- a/gitinspector/changes.py +++ b/gitinspector/changes.py @@ -181,7 +181,7 @@ class Changes(object): authors_by_email = {} emails_by_author = {} - def __init__(self, hard): + def __init__(self, repo, hard): self.commits = [] git_log_hashes_r = subprocess.Popen(filter(None, ["git", "rev-list", "--reverse", "--no-merges", interval.get_since(), interval.get_until(), "HEAD"]), bufsize=1, @@ -190,6 +190,10 @@ class Changes(object): git_log_hashes_r.close() if len(lines) > 0: + progress_text = _(PROGRESS_TEXT) + if repo != None: + progress_text = "[%s] " % repo.name + progress_text + self.commits = [None] * (len(lines) // CHANGES_PER_THREAD + 1) first_hash = "" @@ -201,7 +205,7 @@ class Changes(object): first_hash = entry + ".." if format.is_interactive_format(): - terminal.output_progress(_(PROGRESS_TEXT), i, len(lines)) + terminal.output_progress(progress_text, i, len(lines)) else: entry = entry.decode("utf-8", "replace").strip() second_hash = entry diff --git a/gitinspector/gitinspector.py b/gitinspector/gitinspector.py index 13478b2..d8a19be 100644 --- a/gitinspector/gitinspector.py +++ b/gitinspector/gitinspector.py @@ -66,8 +66,9 @@ class Runner(object): for repo in repos: os.chdir(repo.location) - changes = Changes(self.hard) - summed_blames = Blame(self.hard, self.useweeks, changes) + summed_blames + repo = repo if len(repos) > 1 else None + changes = Changes(repo, self.hard) + summed_blames = Blame(repo, self.hard, self.useweeks, changes) + summed_blames summed_changes = changes + summed_changes if self.include_metrics: