_addset: add a __len__ method
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 20 Mar 2014 18:55:28 -0700
changeset 20845 bc95143446e8
parent 20844 2631204d7305
child 20846 b581c5827516
_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.
mercurial/revset.py
--- a/mercurial/revset.py	Wed Mar 19 17:53:45 2014 -0700
+++ b/mercurial/revset.py	Thu Mar 20 18:55:28 2014 -0700
@@ -2464,6 +2464,9 @@
         self._ascending = ascending
         self._genlist = None
 
+    def __len__(self):
+        return len(self._list)
+
     @util.propertycache
     def _list(self):
         if not self._genlist: