Mercurial > evolve
comparison hgext3rd/topic/__init__.py @ 6702:691a9301b51e
topic: drop compatibility for tr.changes[b'phases'] being a dict in hg 5.3
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Wed, 10 Jan 2024 15:39:03 -0300 |
parents | f0cbc19e77ef |
children | 50c0f1e2dfb6 |
comparison
equal
deleted
inserted
replaced
6701:f0cbc19e77ef | 6702:691a9301b51e |
---|---|
480 # Phase movements, we only care about: | 480 # Phase movements, we only care about: |
481 # - publishing changesets (since they lose topic namespace) | 481 # - publishing changesets (since they lose topic namespace) |
482 # - forcefully making changesets draft again | 482 # - forcefully making changesets draft again |
483 # - turning secret changesets draft and making them visible to peers | 483 # - turning secret changesets draft and making them visible to peers |
484 tnsphases = (phases.secret, phases.draft) | 484 tnsphases = (phases.secret, phases.draft) |
485 phasechanges = tr.changes[b'phases'] | 485 for revs, (old, new) in tr.changes[b'phases']: |
486 if isinstance(phasechanges, dict): | |
487 # hg <= 5.3 (fdc802f29b2c) | |
488 phasechanges = [((k,), v) for k, v in phasechanges.items()] | |
489 for revs, (old, new) in phasechanges: | |
490 if old not in tnsphases and new not in tnsphases: | 486 if old not in tnsphases and new not in tnsphases: |
491 # Skip phase movement if there is no phase (old or new) that has | 487 # Skip phase movement if there is no phase (old or new) that has |
492 # visible topic namespace (i.e. draft and secret) | 488 # visible topic namespace (i.e. draft and secret) |
493 continue | 489 continue |
494 revs = [rev for rev in revs if rev < origrepolen] | 490 revs = [rev for rev in revs if rev < origrepolen] |