topic: use 'hookargs' over 'tr.changes' for flow control
The 'tr.changes' attribute do not exists until 4.2.
--- 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]