# HG changeset patch # User Christian Ebert # Date 1166280147 -3600 # Node ID 6dc2b42689208e3d41e7a52111b49e819bb507e3 # Parent d1f478aa61c58f9ee7b884442acc635eedd1a0ab Simplify for $Hg$ expansion scheme diff -r d1f478aa61c5 -r 6dc2b4268920 hgkw/pretxnkw.py --- a/hgkw/pretxnkw.py Sat Dec 16 15:38:25 2006 +0100 +++ b/hgkw/pretxnkw.py Sat Dec 16 15:42:27 2006 +0100 @@ -1,17 +1,18 @@ -# $Hg: pretxnkw.py,v$ +# $Hg$ -from hgkw import kwexpander +import kwexpander -def pretxnkw(ui=None, repo=None, hooktype='', **args): +def pretxnkw(ui, repo, 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': + if hooktype != 'pretxncommit': # bail out with error return True - modified, added = repo.status()[1:3] + 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, repo.changelog.tip(), node) + return kwexpander.expandkw(ui, repo, + tip, args['node'][0:12], candidates, update=False)