示例#1
0
def lighttransaction(repo):
    # full fledged transactions have two serious issues:
    # 1. they may cause infite loops through hooks
    #    that run commands
    # 2. they are really expensive performance wise
    #
    # lighttransaction avoids certain hooks from being
    # executed, doesn't check repo locks, doesn't check
    # abandoned tr's (since we only record info) and doesn't
    # do any tag handling
    vfsmap = {"shared": repo.sharedvfs, "local": repo.localvfs}
    tr = transaction.transaction(repo.ui.warn, repo.localvfs, vfsmap,
                                 "undolog/tr.journal", "undolog/tr.undo")
    return tr
示例#2
0
def newtransaction():
    # A transaction is required to write revlogs
    report = lambda msg: None
    return transaction.transaction(report, tvfs, {"plain": tvfs}, b"journal")