Mercurial > public > mercurial-scm > hg
comparison mercurial/branchmap.py @ 51530:50850689d3c0
branchcache: gather new obsolete revision in a set
This is part of a series to more clearly split the update in two step. This
will allow us to introduce a fast path during update in a future changeset.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 06 Mar 2024 16:09:42 +0100 |
parents | a0ef462cf1a4 |
children | 767b62cb728e |
comparison
equal
deleted
inserted
replaced
51529:a0ef462cf1a4 | 51530:50850689d3c0 |
---|---|
286 cl = repo.changelog | 286 cl = repo.changelog |
287 # Faster than using ctx.obsolete() | 287 # Faster than using ctx.obsolete() |
288 obsrevs = obsolete.getrevs(repo, b'obsolete') | 288 obsrevs = obsolete.getrevs(repo, b'obsolete') |
289 # collect new branch entries | 289 # collect new branch entries |
290 newbranches = {} | 290 newbranches = {} |
291 obs_ignored = set() | |
291 getbranchinfo = repo.revbranchcache().branchinfo | 292 getbranchinfo = repo.revbranchcache().branchinfo |
292 max_rev = -1 | 293 max_rev = -1 |
293 for r in revgen: | 294 for r in revgen: |
294 max_rev = max(max_rev, r) | 295 max_rev = max(max_rev, r) |
295 if r in obsrevs: | 296 if r in obsrevs: |
296 # We ignore obsolete changesets as they shouldn't be | 297 # We ignore obsolete changesets as they shouldn't be |
297 # considered heads. | 298 # considered heads. |
299 obs_ignored.add(r) | |
298 continue | 300 continue |
299 branch, closesbranch = getbranchinfo(r) | 301 branch, closesbranch = getbranchinfo(r) |
300 newbranches.setdefault(branch, []).append(r) | 302 newbranches.setdefault(branch, []).append(r) |
301 if closesbranch: | 303 if closesbranch: |
302 self._closednodes.add(cl.node(r)) | 304 self._closednodes.add(cl.node(r)) |