hgext3rd/topic/discovery.py
changeset 4263 35130e428ebd
parent 4194 cae466b70bf1
child 4540 22cde12d9467
--- a/hgext3rd/topic/discovery.py	Mon Nov 19 02:25:37 2018 +0000
+++ b/hgext3rd/topic/discovery.py	Mon Nov 19 02:27:13 2018 +0000
@@ -33,32 +33,30 @@
     publishedset = ()
     remotebranchmap = None
     origremotebranchmap = remote.branchmap
-    # < hg-4.4 do not have a --publish flag anyway
-    if util.safehasattr(pushop, 'remotephases'):
-        publishednode = [c.node() for c in pushop.outdatedphases]
-        publishedset = repo.revs('ancestors(%ln + %ln)',
-                                 publishednode,
-                                 pushop.remotephases.publicheads)
+    publishednode = [c.node() for c in pushop.outdatedphases]
+    publishedset = repo.revs('ancestors(%ln + %ln)',
+                             publishednode,
+                             pushop.remotephases.publicheads)
 
-        rev = repo.unfiltered().changelog.nodemap.get
+    rev = repo.unfiltered().changelog.nodemap.get
 
-        def remotebranchmap():
-            # drop topic information from changeset about to be published
-            result = collections.defaultdict(list)
-            for branch, heads in origremotebranchmap().iteritems():
-                if ':' not in branch:
-                    result[branch].extend(heads)
-                else:
-                    namedbranch = branch.split(':', 1)[0]
-                    for h in heads:
-                        r = rev(h)
-                        if r is not None and r in publishedset:
-                            result[namedbranch].append(h)
-                        else:
-                            result[branch].append(h)
-            for heads in result.itervalues():
-                heads.sort()
-            return result
+    def remotebranchmap():
+        # drop topic information from changeset about to be published
+        result = collections.defaultdict(list)
+        for branch, heads in origremotebranchmap().iteritems():
+            if ':' not in branch:
+                result[branch].extend(heads)
+            else:
+                namedbranch = branch.split(':', 1)[0]
+                for h in heads:
+                    r = rev(h)
+                    if r is not None and r in publishedset:
+                        result[namedbranch].append(h)
+                    else:
+                        result[branch].append(h)
+        for heads in result.itervalues():
+            heads.sort()
+        return result
 
     class repocls(repo.__class__):
         # awful hack to see branch as "branch:topic"