hgext3rd/topic/discovery.py
branchmercurial-4.8
changeset 4356 a71f2271ed76
parent 4263 35130e428ebd
child 4540 22cde12d9467
--- a/hgext3rd/topic/discovery.py	Tue Jan 22 10:43:44 2019 -0500
+++ b/hgext3rd/topic/discovery.py	Tue Jan 22 10:46:02 2019 -0500
@@ -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"