Mercurial > hg
comparison mercurial/revlog.py @ 43536:bf6fa330e0a5
index: use `index.has_node` in `revlog.addgroup`
Differential Revision: https://phab.mercurial-scm.org/D7328
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 03 Nov 2019 00:49:55 +0100 |
parents | 8b533de0429d |
children | bd87114ce341 |
comparison
equal
deleted
inserted
replaced
43535:8b533de0429d | 43536:bf6fa330e0a5 |
---|---|
2304 link = linkmapper(linknode) | 2304 link = linkmapper(linknode) |
2305 flags = flags or REVIDX_DEFAULT_FLAGS | 2305 flags = flags or REVIDX_DEFAULT_FLAGS |
2306 | 2306 |
2307 nodes.append(node) | 2307 nodes.append(node) |
2308 | 2308 |
2309 if node in self.nodemap: | 2309 if self.index.has_node(node): |
2310 self._nodeduplicatecallback(transaction, node) | 2310 self._nodeduplicatecallback(transaction, node) |
2311 # this can happen if two branches make the same change | 2311 # this can happen if two branches make the same change |
2312 continue | 2312 continue |
2313 | 2313 |
2314 for p in (p1, p2): | 2314 for p in (p1, p2): |
2315 if p not in self.nodemap: | 2315 if not self.index.has_node(p): |
2316 raise error.LookupError( | 2316 raise error.LookupError( |
2317 p, self.indexfile, _(b'unknown parent') | 2317 p, self.indexfile, _(b'unknown parent') |
2318 ) | 2318 ) |
2319 | 2319 |
2320 if deltabase not in self.nodemap: | 2320 if not self.index.has_node(deltabase): |
2321 raise error.LookupError( | 2321 raise error.LookupError( |
2322 deltabase, self.indexfile, _(b'unknown delta base') | 2322 deltabase, self.indexfile, _(b'unknown delta base') |
2323 ) | 2323 ) |
2324 | 2324 |
2325 baserev = self.rev(deltabase) | 2325 baserev = self.rev(deltabase) |