# HG changeset patch # User Pierre-Yves David # Date 1513041418 -3600 # Node ID 3675fe74521d7a1172b234c8833ba611ad4834ec # Parent 703e8398ac57ba62bf9179fa9d63f7bfe662f608 topic: use 'hookargs' over 'tr.changes' for flow control The 'tr.changes' attribute do not exists until 4.2. diff -r 703e8398ac57 -r 3675fe74521d hgext3rd/topic/flow.py --- a/hgext3rd/topic/flow.py Tue Dec 12 01:27:12 2017 +0100 +++ b/hgext3rd/topic/flow.py Tue Dec 12 02:16:58 2017 +0100 @@ -32,13 +32,14 @@ def rejectuntopicedchangeset(repo, tr): """Reject the push if there are changeset without topic""" - if not tr.changes['revs']: # no new revs + if 'node' not in tr.hookargs: # no new revs return + startnode = node.bin(tr.hookargs['node']) + mode = repo.ui.config('experimental', 'topic-mode.server', 'ignore') - revs = list(tr.changes['revs']) - untopiced = repo.revs('not public() and (%ld:) - hidden() - topic()', revs) + untopiced = repo.revs('not public() and (%n:) - hidden() - topic()', startnode) if untopiced: num = len(untopiced) fnode = repo[untopiced.first()].hex()[:10]