Mercurial > evolve
comparison hgext/evolve.py @ 1377:01bdeb847f81 stable
evolve: avoid creating changectx object in _precursors
The repo lookups and object creations have a significant performance overhead.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 18 Jun 2015 16:13:15 -0700 |
parents | 8bb2e04cc18c |
children | a127f0f3bf5f |
comparison
equal
deleted
inserted
replaced
1376:8bb2e04cc18c | 1377:01bdeb847f81 |
---|---|
409 def _precursors(repo, s): | 409 def _precursors(repo, s): |
410 """Precursor of a changeset""" | 410 """Precursor of a changeset""" |
411 cs = set() | 411 cs = set() |
412 nm = repo.changelog.nodemap | 412 nm = repo.changelog.nodemap |
413 markerbysubj = repo.obsstore.precursors | 413 markerbysubj = repo.obsstore.precursors |
414 node = repo.changelog.node | |
414 for r in s: | 415 for r in s: |
415 for p in markerbysubj.get(repo[r].node(), ()): | 416 for p in markerbysubj.get(node(r), ()): |
416 pr = nm.get(p[0]) | 417 pr = nm.get(p[0]) |
417 if pr is not None: | 418 if pr is not None: |
418 cs.add(pr) | 419 cs.add(pr) |
419 return cs | 420 return cs |
420 | 421 |