# HG changeset patch # User Christian Ebert # Date 1166088815 -3600 # Node ID e5f131217f87967ddcc1bb406a445c56807b72bc # Parent 85d1f5bf7cfc27783351eea42dc771ebb1a9fabd Add pretxnkw module for updatehook branch diff -r 85d1f5bf7cfc -r e5f131217f87 hgkw/pretxnkw.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hgkw/pretxnkw.py Thu Dec 14 10:33:35 2006 +0100 @@ -0,0 +1,17 @@ +# $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)