From 62409395e260ad01f9ae7b84869f5516ef80c7aa Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Sat, 16 Nov 2013 00:20:02 -0500 Subject: output dependencies as soon as they're found --- git-deps | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/git-deps b/git-deps index 8afff0f..7614ffa 100755 --- a/git-deps +++ b/git-deps @@ -50,28 +50,28 @@ class CLIDependencyListener(DependencyListener): too long for useful output if recursion is enabled. """ - def dependent_done(self, dependent, dependencies): - dependent_sha = dependent.hex - - for dependency_sha in dependencies: - if self.options.recurse: - if self.options.log: - print("%s depends on:" % dependent_sha) - else: - print("%s %s" % (dependent_sha, dependency_sha)) - else: - if not self.options.log: - print(dependency_sha) + def new_dependency(self, dependent, dependency, path, line_num): + dependent_sha = dependent.hex + dependency_sha = dependency.hex + if self.options.recurse: if self.options.log: - cmd = [ 'git', '--no-pager', '-c', 'color.ui=always', 'log', '-n1', dependency_sha ] - print(subprocess.check_output(cmd)) - # dependency = detector.get_commit(dependency_sha) - # print(dependency.message + "\n") - - # for path in self.dependencies[dependency]: - # print(" %s" % path) - # print(" %s" % ", ".join(sorted(self.dependencies[dependency][path].keys()))) + print("%s depends on:" % dependent_sha) + else: + print("%s %s" % (dependent_sha, dependency_sha)) + else: + if not self.options.log: + print(dependency_sha) + + if self.options.log: + cmd = [ 'git', '--no-pager', '-c', 'color.ui=always', 'log', '-n1', dependency_sha ] + print(subprocess.check_output(cmd)) + # dependency = detector.get_commit(dependency_sha) + # print(dependency.message + "\n") + + # for path in self.dependencies[dependency]: + # print(" %s" % path) + # print(" %s" % ", ".join(sorted(self.dependencies[dependency][path].keys()))) class DependencyDetector(object): """Class for automatically detecting dependencies between git commits. -- cgit