comparison hgext3rd/topic/discovery.py @ 4929:bb2b4f6c99dc

compat: compatibility for cl.nodemap.get vs cl.index.get_rev
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 13 Nov 2019 13:47:55 +0700
parents 48b30ff742cb
children 71cccd216b01
comparison
equal deleted inserted replaced
4928:379ce8ba150d 4929:bb2b4f6c99dc
43 publishednode = [c.node() for c in pushop.outdatedphases] 43 publishednode = [c.node() for c in pushop.outdatedphases]
44 publishedset = repo.revs(b'ancestors(%ln + %ln)', 44 publishedset = repo.revs(b'ancestors(%ln + %ln)',
45 publishednode, 45 publishednode,
46 pushop.remotephases.publicheads) 46 pushop.remotephases.publicheads)
47 47
48 rev = repo.unfiltered().changelog.nodemap.get 48 getrev = compat.getgetrev(repo.unfiltered().changelog)
49 49
50 def remotebranchmap(): 50 def remotebranchmap():
51 # drop topic information from changeset about to be published 51 # drop topic information from changeset about to be published
52 result = collections.defaultdict(list) 52 result = collections.defaultdict(list)
53 for branch, heads in compat.branchmapitems(origremotebranchmap()): 53 for branch, heads in compat.branchmapitems(origremotebranchmap()):
54 if b':' not in branch: 54 if b':' not in branch:
55 result[branch].extend(heads) 55 result[branch].extend(heads)
56 else: 56 else:
57 namedbranch = branch.split(b':', 1)[0] 57 namedbranch = branch.split(b':', 1)[0]
58 for h in heads: 58 for h in heads:
59 r = rev(h) 59 r = getrev(h)
60 if r is not None and r in publishedset: 60 if r is not None and r in publishedset:
61 result[namedbranch].append(h) 61 result[namedbranch].append(h)
62 else: 62 else:
63 result[branch].append(h) 63 result[branch].append(h)
64 for heads in result.values(): 64 for heads in result.values():