Mercurial > evolve
comparison hgext/inhibit.py @ 1535:f6d10432499d
inhibit: use dirty revset trick to speedup the inhibit search space.
See documentation for details. I'm a bit sad about this changesets.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 17 Nov 2015 20:25:15 -0800 |
parents | 9a78ed4b9765 |
children | ef5da2310398 |
comparison
equal
deleted
inserted
replaced
1534:9a78ed4b9765 | 1535:f6d10432499d |
---|---|
127 obsolete revision only are created. | 127 obsolete revision only are created. |
128 """ | 128 """ |
129 if not _inhibitenabled(repo): | 129 if not _inhibitenabled(repo): |
130 return | 130 return |
131 | 131 |
132 newinhibit = repo.revs('::%ln and obsolete()', nodes) | 132 # we add (non public()) as a lower boundary to |
133 # - use the C code in 3.6 (no ancestors in C as this is written) | |
134 # - restrict the search space. Otherwise, the ancestors can spend a lot of | |
135 # time iterating if you have a check very low in the repo. We do not need | |
136 # to iterate over tens of thousand of public revisions with higher | |
137 # revision number | |
138 # | |
139 # In addition, the revset logic could be made significantly smarter here. | |
140 newinhibit = repo.revs('(not public())::%ln and obsolete()', nodes) | |
133 if newinhibit: | 141 if newinhibit: |
134 node = repo.changelog.node | 142 node = repo.changelog.node |
135 lock = tr = None | 143 lock = tr = None |
136 try: | 144 try: |
137 lock = repo.lock() | 145 lock = repo.lock() |