# HG changeset patch # User Anton Shestakov # Date 1691091161 10800 # Node ID 44bc900ba5dbc5c4fc97b5296122c0c89d6ce219 # Parent b0cbad4d841f3f1263901b4cb199160aece37093 topic: compatibility for tr.changes[b'phases'] in hg 5.3 and older tr.changes[b'phases'] used to be a dict keyed with revnums, but now it's a list of tuples where the first element is a range() of revnums. In this patch, instead of properly converting the data (i.e. grouping revisions into ranges), we just wrap every individual revnum into a 1-tuple. This is not ideal, but good enough for the existing code below. diff -r b0cbad4d841f -r 44bc900ba5db hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Mon Jul 31 16:47:42 2023 -0300 +++ b/hgext3rd/topic/__init__.py Thu Aug 03 16:32:41 2023 -0300 @@ -463,7 +463,11 @@ # - forcefully making changesets draft again # - turning secret changesets draft and making them visible to peers tnsphases = (phases.secret, phases.draft) - for revs, (old, new) in tr.changes[b'phases']: + phasechanges = tr.changes[b'phases'] + if isinstance(phasechanges, dict): + # hg <= 5.3 (fdc802f29b2c) + phasechanges = [((k,), v) for k, v in phasechanges.items()] + for revs, (old, new) in phasechanges: if old not in tnsphases and new not in tnsphases: # Skip phase movement if there is no phase (old or new) that has # visible topic namespace (i.e. draft and secret)