def graft_branch(branch):

    repo_check()

    log = []

    try:
        msg = repo.git.execute([git, 'merge', '--no-ff', branch])
        log.append(msg)
    except GitCommandError as why:
        log = repo.git.execute([git,'merge', '--abort'])
        abort('Merge failed. Reverting.',
              log='{0}\n{1}'.format(why, log), type='merge')


    out = repo.git.execute([git, 'branch', '-D', branch])
    log.append(out)
    return '\n'.join(log)
Open the log, emit a record and close the log.
dataset/ETHPy150Open kennethreitz/legit/legit/scm.py/graft_branch--crossover with--dataset/ETHPy150Open munki/munki/code/apps/Managed Software Center/Managed Software Center/msclog.py/FleetingFileHandler.emit