Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 25619:833fa28cd949
revset: use a baseset in _notpublic()
The '_notpublic()' internal revset was "returning" a set. That was wrong. We now
return a 'baseset' as appropriate. This has no effect on performance in most case,
because we do the exact same operation than what the combination with a
'fullreposet' was doing. This as a small effect on some operation when combined
with other set, because we now apply the filtering in all cases. I think the
correctness is worth the impact on some corner cases. The optimizer should take
care of these corner cases anyway.
revset #0: not public()
plain min max first last reverse
0) 0.000465 0.000491 0.000495 0.000500 0.000494 0.000479
1) 0.000484 0.000503 0.000498 0.000505 0.000504 0.000491
revset #1: (tip~1000::) - public()
plain min max first last reverse
0) 0.002765 0.001742 0.002767 0.001730 0.002761 0.002782
1) 0.002847 0.001777 0.002776 0.001741 0.002764 0.002858
revset #2: not public() and branch("default")
plain min max first last reverse
0) 0.012104 0.011138 0.011189 0.011138 0.011166 0.011578
1) 0.011387 94% 0.011738 105% 0.014220 127% 0.011223 0.011184 0.012077
revset #3: (not public() - obsolete())
plain min max first last reverse
0) 0.000583 0.000556 0.000552 0.000555 0.000552 0.000610
1) 0.000613 105% 0.000559 0.000557 0.000573 0.000558 0.000613
revset #4: head() - public()
plain min max first last reverse
0) 0.010869 0.010800 0.011547 0.010843 0.010891 0.010891
1) 0.011031 0.011497 106% 0.011087 0.011100 0.011100 0.011085
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 10 Jun 2015 19:58:27 -0700 |
parents | 97528adbf74b |
children | 5f87f2305ad0 |
comparison
equal
deleted
inserted
replaced
25618:04335b430061 | 25619:833fa28cd949 |
---|---|
1516 repo._phasecache.loadphaserevs(repo) # ensure phase's sets are loaded | 1516 repo._phasecache.loadphaserevs(repo) # ensure phase's sets are loaded |
1517 if repo._phasecache._phasesets: | 1517 if repo._phasecache._phasesets: |
1518 s = set() | 1518 s = set() |
1519 for u in repo._phasecache._phasesets[1:]: | 1519 for u in repo._phasecache._phasesets[1:]: |
1520 s.update(u) | 1520 s.update(u) |
1521 # XXX we should turn this into a baseset instead of a set, smartset may | 1521 s = baseset(s - repo.changelog.filteredrevs) |
1522 # do some optimisations from the fact this is a baseset. | 1522 s.sort() |
1523 return subset & s | 1523 return subset & s |
1524 else: | 1524 else: |
1525 phase = repo._phasecache.phase | 1525 phase = repo._phasecache.phase |
1526 target = phases.public | 1526 target = phases.public |
1527 condition = lambda r: phase(repo, r) != target | 1527 condition = lambda r: phase(repo, r) != target |