diff -r a0e783d26e81 -r d6d3cf5fda6f mercurial/changegroup.py --- a/mercurial/changegroup.py Fri Jan 08 10:58:04 2016 -0800 +++ b/mercurial/changegroup.py Tue Jan 05 17:37:59 2016 -0800 @@ -411,10 +411,12 @@ if changesets > 0: if 'node' not in tr.hookargs: tr.hookargs['node'] = hex(cl.node(clstart)) + tr.hookargs['node_last'] = hex(cl.node(clend - 1)) hookargs = dict(tr.hookargs) else: hookargs = dict(tr.hookargs) hookargs['node'] = hex(cl.node(clstart)) + hookargs['node_last'] = hex(cl.node(clend - 1)) repo.hook('pretxnchangegroup', throw=True, **hookargs) added = [cl.node(r) for r in xrange(clstart, clend)] @@ -461,6 +463,7 @@ for n in added: args = hookargs.copy() args['node'] = hex(n) + del args['node_last'] repo.hook("incoming", **args) newheads = [h for h in repo.heads() if h not in oldheads]