def run (self, repo, repo_uri): profiler_start("Running BlameJob for %s@%s", (self.path,self.rev)) def blame_line (line, p): p.feed (line) repo_type = repo.get_type () if repo_type == 'cvs': # CVS paths contain the module stuff uri = repo.get_uri_for_path (repo_uri) module = uri[len (repo.get_uri ()):].strip ('/') if module != '.': path = self.path[len (module):].strip ('/') else: path = self.path.strip ('/') else: path = self.path.strip ('/') filename = os.path.basename (self.path) p = create_parser (repo.get_type (), self.path) out = self.get_content_handler() p.set_output_device (out) wid = repo.add_watch (BLAME, blame_line, p) try: repo.blame (os.path.join (repo_uri, path), self.rev) self.collect_results(out) except RepositoryCommandError, e: self.failed = True printerr ("Command %s returned %d (%s)", (e.cmd, e.returncode, e.error))