Patchwork ancestor: remove extra generator from lazyancestors.__iter__()

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 10, 2018, 1:15 p.m.
Message ID <4eee6e03686df30cacc8.1536585319@mimosa>
Download mbox | patch
Permalink /patch/34454/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 10, 2018, 1:15 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1536580638 -32400
#      Mon Sep 10 20:57:18 2018 +0900
# Node ID 4eee6e03686df30cacc8d78f9bd37d4628e478d6
# Parent  43d92d68ac889eed34e6223bdc0298bc4f056592
ancestor: remove extra generator from lazyancestors.__iter__()
Augie Fackler - Sept. 12, 2018, 9:16 p.m.
> On Sep 10, 2018, at 09:15, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org <mailto:yuya@tcha.org>>
> # Date 1536580638 -32400
> #      Mon Sep 10 20:57:18 2018 +0900
> # Node ID 4eee6e03686df30cacc8d78f9bd37d4628e478d6
> # Parent  43d92d68ac889eed34e6223bdc0298bc4f056592
> ancestor: remove extra generator from lazyancestors.__iter__()

queued, thanks

Patch

diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
--- a/mercurial/ancestor.py
+++ b/mercurial/ancestor.py
@@ -335,9 +335,8 @@  class lazyancestors(object):
 
         If inclusive is True, the source revisions are also yielded. The
         reverse revision number order is still enforced."""
-        for rev in _lazyancestorsiter(self._parentrevs, self._initrevs,
-                                      self._stoprev, self._inclusive):
-            yield rev
+        return _lazyancestorsiter(self._parentrevs, self._initrevs,
+                                  self._stoprev, self._inclusive)
 
     def __contains__(self, target):
         """Test whether target is an ancestor of self._initrevs."""