def __init__(self, repo, uri): LineCounter.__init__(self, repo, uri) self.commit_pattern = re.compile("^(\w+) ") self.file_pattern = re.compile("^(\d+)\s+(\d+)\s+([^\s].*)$") # Dictionary for storing added, removed pairs, keyed by commit. self.lines = {} # Dictionary for storing list of paths, keyed by commit. self.paths = {} # Dictionary for storing added, removed pairs, keyed by commit. # and path self.lines_files = {} # Run git command self.git = find_program('git') if self.git is None: raise ExtensionRunError("Error running CommitsLOCDet extension: " + "required git command cannot be found in path") cmd = [self.git, 'log', '--all', '--topo-order', '--numstat', '--pretty=oneline'] c = Command(cmd, uri) try: c.run(parser_out_func=self.__parse_line) except CommandError, e: if e.error: printerr("Error running git log command: %s", (e.error,)) raise ExtensionRunError("Error running " + "CommitsLOCDet extension: %s", str(e))
def __init__(self, repo, uri): LineCounter.__init__(self, repo, uri) self.commit_pattern = re.compile("^(\w+) ") self.file_pattern = re.compile("^(\d+)\s+(\d+)\s+([^\s].*)$") # Dictionary for storing added, removed pairs, keyed by commit. self.lines = {} # Dictionary for storing list of paths, keyed by commit. self.paths = {} # Dictionary for storing added, removed pairs, keyed by commit. # and path self.lines_files = {} # Run git command self.git = find_program('git') if self.git is None: raise ExtensionRunError ("Error running CommitsLOCDet extension: " + \ "required git command cannot be found in path") cmd = [ self.git, 'log', '--all', '--topo-order', '--numstat', '--pretty=oneline' ] c = Command(cmd, uri) try: c.run(parser_out_func=self.__parse_line) except CommandError, e: if e.error: printerr("Error running git log command: %s", (e.error, )) raise ExtensionRunError( "Error running " + "CommitsLOCDet extension: %s", str(e))
def __init__(self, repo, uri): LineCounter.__init__(self, repo, uri) self.git = find_program('git') if self.git is None: raise ExtensionRunError("Error running CommitsLOC extension: " + "required git command cannot be found in path") self.lines = {} cmd = [self.git, 'log', '--all', '--topo-order', '--shortstat', '--pretty=oneline', 'origin'] c = Command(cmd, uri) try: c.run(parser_out_func=self.__parse_line) except CommandError, e: if e.error: printerr("Error running git log command: %s", (e.error,)) raise ExtensionRunError("Error running CommitsLOC extension: %s", str(e))