Patchwork D8264: gitlog: implement __iter__ on changelog

login
register
mail settings
Submitter phabricator
Date March 7, 2020, 10:45 p.m.
Message ID <differential-rev-PHID-DREV-c3sfv7t4zyg7h7ucwvrg-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45614/
State Superseded
Headers show

Comments

phabricator - March 7, 2020, 10:45 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This allows `hg phase --force --draft -r .` to work, for example.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8264

AFFECTED FILES
  hgext/git/gitlog.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/git/gitlog.py b/hgext/git/gitlog.py
--- a/hgext/git/gitlog.py
+++ b/hgext/git/gitlog.py
@@ -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