hgkw/pretxnkw.py
author Christian Ebert <blacktrash@gmx.net>
Sat, 16 Dec 2006 15:22:56 +0100
branchupdatehook
changeset 17 7aebaf13ea3c
parent 7 e5f131217f87
child 20 6dc2b4268920
permissions -rw-r--r--
Start universal $Hg$ keyword expansion

# $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)