Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 20845:bc95143446e8
_addset: add a __len__ method
Back in the time where repo.revs(...) returned a list, calling `len(...)` on the
result was quite common. We reinstall this on _addset.
There is absolutely no easy way to test this from the command line. The commands
using this in the evolve extension will eventually land into core.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 20 Mar 2014 18:55:28 -0700 |
parents | 47d43e2323c5 |
children | 876c17336b4e |
comparison
equal
deleted
inserted
replaced
20844:2631204d7305 | 20845:bc95143446e8 |
---|---|
2462 self._r2 = revs2 | 2462 self._r2 = revs2 |
2463 self._iter = None | 2463 self._iter = None |
2464 self._ascending = ascending | 2464 self._ascending = ascending |
2465 self._genlist = None | 2465 self._genlist = None |
2466 | 2466 |
2467 def __len__(self): | |
2468 return len(self._list) | |
2469 | |
2467 @util.propertycache | 2470 @util.propertycache |
2468 def _list(self): | 2471 def _list(self): |
2469 if not self._genlist: | 2472 if not self._genlist: |
2470 self._genlist = baseset(self._iterator()) | 2473 self._genlist = baseset(self._iterator()) |
2471 return self._genlist | 2474 return self._genlist |