How to use the pydriller.utils.hyperblame.HyperBlameCommit function in PyDriller

To help you get started, we’ve selected a few PyDriller examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ishepard / pydriller / pydriller / utils / hyperblame.py View on Github external
while i < len(lines):
            # Read a commit line and parse it.
            line = lines[i]
            i += 1
            if not line.strip():
                continue
            commitline = line.split()
            commithash = commitline[0]
            lineno_then = int(commitline[1])
            lineno_now = int(commitline[2])

            try:
                commit = commits[commithash]
            except KeyError:
                commit = HyperBlameCommit(commithash)
                commits[commithash] = commit

            # Read commit details until we find a context line.
            while i < len(lines):
                line = lines[i]
                i += 1
                if line.startswith('\t'):
                    break

                try:
                    key, value = line.split(' ', 1)
                except ValueError:
                    key = line
                    value = True
                setattr(commit, key.replace('-', '_'), value)