Mercurial > evolve
comparison hgext/evolve.py @ 1073:f15f02007a0b
obshash: resist to unknown revision during discovery
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 27 Aug 2014 12:02:53 +0200 |
parents | 1639810c11c2 |
children | 442ab25f4747 |
comparison
equal
deleted
inserted
replaced
1072:1639810c11c2 | 1073:f15f02007a0b |
---|---|
2236 from mercurial import setdiscovery | 2236 from mercurial import setdiscovery |
2237 | 2237 |
2238 def _obshash(repo, nodes): | 2238 def _obshash(repo, nodes): |
2239 hashs = _obsrelsethashtree(repo) | 2239 hashs = _obsrelsethashtree(repo) |
2240 nm = repo.changelog.nodemap | 2240 nm = repo.changelog.nodemap |
2241 return [hashs[nm.get(n)][1] for n in nodes] | 2241 revs = [nm.get(n) for n in nodes] |
2242 return [r is None and nullid or hashs[r][1] for r in revs] | |
2242 | 2243 |
2243 def srv_obshash(repo, proto, nodes): | 2244 def srv_obshash(repo, proto, nodes): |
2244 return wireproto.encodelist(_obshash(repo, wireproto.decodelist(nodes))) | 2245 return wireproto.encodelist(_obshash(repo, wireproto.decodelist(nodes))) |
2245 | 2246 |
2246 @eh.addattr(localrepo.localpeer, 'evoext_obshash') | 2247 @eh.addattr(localrepo.localpeer, 'evoext_obshash') |