hgkw/pretxnkw.py
author Christian Ebert <blacktrash@gmx.net>
Thu, 14 Dec 2006 10:33:35 +0100
branchupdatehook
changeset 7 e5f131217f87
child 20 6dc2b4268920
permissions -rw-r--r--
Add pretxnkw module for updatehook branch

# $Hg: pretxnkw.py,v$

from hgkw import kwexpander

def pretxnkw(ui=None, repo=None, hooktype='', **args):
    '''Important: returns False on success, True on failure.'''

    node = args['node'][0:12]

    if not ui or not repo or not node or hooktype != 'pretxncommit':
        # bail out with error
        return True

    modified, added = repo.status()[1:3]
    candidates = modified + added

    return kwexpander.expandkw(ui, repo, repo.changelog.tip(), node)