Beispiel #1
0
def find_commit(commit, series, mode="rb"):
    """
    Caller must chdir to where the entries in series can be found.
    """
    for name in filter_series(series):
        patch = Patch(open(name, mode="rb"))
        found = False
        if commit in [firstword(value)
                      for value in patch.get("Git-commit")
                      if value]:
            found = True
            yield name, patch
        patch.writeback()
        if found:
            return
    raise exc.KSNotFound()
Beispiel #2
0
def find_commit(commit, series, mode="rb"):
    """
    commit: unabbreviated git commit id
    series: list of lines from series.conf
    mode: mode to open the patch files in, should be "rb" or "r+b"

    Caller must chdir to where the entries in series can be found.

    Returns patch.Patch instances
    """
    for name in filter_series(series):
        patch = Patch(open(name, mode=mode))
        found = False
        if commit in [
                firstword(value) for value in patch.get("Git-commit") if value
        ]:
            found = True
            yield name, patch
        patch.writeback()
        if found:
            return
    raise exc.KSNotFound()
Beispiel #3
0
def find_commit(commit, series, mode="rb"):
    """
    commit: unabbreviated git commit id
    series: list of lines from series.conf
    mode: mode to open the patch files in, should be "rb" or "r+b"

    Caller must chdir to where the entries in series can be found.

    Returns patch.Patch instances
    """
    for name in filter_series(series):
        patch = Patch(open(name, mode=mode))
        found = False
        if commit in [firstword(value)
                      for value in patch.get("Git-commit")
                      if value]:
            found = True
            yield name, patch
        patch.writeback()
        if found:
            return
    raise exc.KSNotFound()