changeset 6786:ae01e2b10419 stable

topic: compatibility for RemotePhasesSummary.public_heads
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 17 May 2024 15:59:34 +0400
parents cf1e854f50e9
children 9638df99836f
files hgext3rd/topic/discovery.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/discovery.py	Fri May 17 15:07:04 2024 +0400
+++ b/hgext3rd/topic/discovery.py	Fri May 17 15:59:34 2024 +0400
@@ -89,9 +89,11 @@
     else:
         origremotebranchmap = remote.branchmap
     publishednode = [c.node() for c in pushop.outdatedphases]
-    publishedset = repo.revs(b'ancestors(%ln + %ln)',
-                             publishednode,
-                             pushop.remotephases.publicheads)
+    if util.safehasattr(pushop.remotephases, 'publicheads'):
+        # hg <= 6.7 (22cc679a7312)
+        publishedset = repo.revs(b'ancestors(%ln + %ln)', publishednode, pushop.remotephases.publicheads)
+    else:
+        publishedset = repo.revs(b'ancestors(%ln + %ld)', publishednode, pushop.remotephases.public_heads)
 
     publishing = (b'phases' not in remote.listkeys(b'namespaces')
                   or bool(remote.listkeys(b'phases').get(b'publishing', False)))