gitlog: implement __iter__ on changelog
authorAugie Fackler <raf@durin42.com>
Sat, 07 Mar 2020 17:44:55 -0500
changeset 44481 8b5f5d8ad783
parent 44480 f19491aae641
child 44482 21893ff382cd
gitlog: implement __iter__ on changelog This allows `hg phase --force --draft -r .` to work, for example. Differential Revision: https://phab.mercurial-scm.org/D8264
hgext/git/gitlog.py
--- a/hgext/git/gitlog.py	Sat Mar 07 17:42:40 2020 -0500
+++ b/hgext/git/gitlog.py	Sat Mar 07 17:44:55 2020 -0500
@@ -103,6 +103,9 @@
         except error.LookupError:
             return False
 
+    def __iter__(self):
+        return iter(pycompat.xrange(len(self)))
+
     @property
     def filteredrevs(self):
         # TODO: we should probably add a refs/hg/ namespace for hidden