Example #1
0
    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))
Example #2
0
    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))
Example #3
0
 def __init__(self, repo, uri):
     LineCounter.__init__(self, repo, uri)
     self.diffstat = find_program('diffstat')
     if self.diffstat is None:
         raise ExtensionRunError(
             "Error running CommitsLOC extension: " +
             "required diffstat command cannot be found in path")
Example #4
0
    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))
Example #5
0
 def __init__(self, repo, uri):
     LineCounter.__init__(self, repo, uri)
     self.diffstat = find_program('diffstat')
     if self.diffstat is None:
         raise ExtensionRunError("Error running CommitsLOC extension: " +
                                 "required diffstat command cannot be found in path")