hgkw/pretxnkw.py
author Christian Ebert <blacktrash@gmx.net>
Sun, 17 Dec 2006 10:57:55 +0100
branchupdatehook
changeset 25 aa3fbe81e9ad
parent 20 6dc2b4268920
child 26 bda0dec1aaf1
permissions -rw-r--r--
Make wwritekw() and all vars local

# $Hg$

import kwexpander

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

    if hooktype != 'pretxncommit':
        # bail out with error
        return True

    tip = repo.changelog.tip()
    modified, added = repo.status()[:2]
    candidates = modified + added
    # TODO: check whether we need parent1&2 like in updatekw

    return kwexpander.expandkw(ui, repo,
            tip, args['node'][0:12], candidates, update=False)