Exemplo n.º 1
0
def parse_commit_log(name, content, releases, get_head_fn):
    """
    Parses the given commit log
    :param name: str, package name
    :param content: list, directory paths
    :param releases: list, releases
    :param get_head_fn: function
    :return: dict, changelog
    """
    log = ""
    raw_log = ""
    for path, _ in content:
        log += "\n".join(
            changelog(repository=GitRepos(path),
                      tag_filter_regexp=r"v?\d+\.\d+(\.\d+)?"))
        raw_log += "\n" + subprocess.check_output([
            "git", "-C", path, "--no-pager", "log", "--decorate"
        ]).decode("utf-8")
        shutil.rmtree(path)
    log = parse(name, log, releases, get_head_fn)

    return log, raw_log
Exemplo n.º 2
0
 def simple_changelog(self):
     ## Currifyed main function
     return lambda **kw: gitchangelog.changelog(
         repository=self.repos, output_engine=simple_renderer, **kw)
Exemplo n.º 3
0
def test_changelog_group_by_type():
    gitlogs = gitlog_parser(log)
    markdown = changelog(view='type', gitlogs=gitlogs)
    print(markdown)
Exemplo n.º 4
0
def test_changelog_group_by_scope():
    gitlogs = gitlog_parser(log)
    markdown = changelog(view='scope', gitlogs=gitlogs)
    print(markdown)
    assert 'add ssh mark' in markdown
Exemplo n.º 5
0
 def changelog(self):
     ## Currifyed main function
     return lambda **kw: gitchangelog.changelog(repository=self.repos, **kw)
Exemplo n.º 6
0
 def simple_changelog(self):
     ## Currifyed main function
     return lambda **kw: gitchangelog.changelog(
         repository=self.repos, output_engine=simple_renderer, **kw)
Exemplo n.º 7
0
 def changelog(self):
     ## Currifyed main function
     return lambda **kw: gitchangelog.changelog(
         repository=self.repos, **kw)