diff -r 75db6a9d0b54 -r a71f2271ed76 hgext3rd/topic/discovery.py --- 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"