From patchwork Sat Jan 26 04:58:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3, of, 3, follow-up] dagop: check if stopdepth is greater than or equal to maxlogdepth From: Anton Shestakov X-Patchwork-Id: 38064 Message-Id: <60b308740000fef7ed43.1548478701@neuro> To: mercurial-devel@mercurial-scm.org Date: Sat, 26 Jan 2019 12:58:21 +0800 # HG changeset patch # User Anton Shestakov # Date 1548476644 -28800 # Sat Jan 26 12:24:04 2019 +0800 # Node ID 60b308740000fef7ed43891e667119035ccc3250 # Parent 88aef4c81971a828462c22f24e18246116c6715b dagop: check if stopdepth is greater than or equal to maxlogdepth Might prevent off-by-one errors. diff --git a/mercurial/dagop.py b/mercurial/dagop.py --- a/mercurial/dagop.py +++ b/mercurial/dagop.py @@ -221,7 +221,7 @@ def revdescendants(repo, revs, followfir Scan ends at the stopdepth (exlusive) if specified. Revisions found earlier than the startdepth are omitted. """ - if startdepth is None and (stopdepth is None or stopdepth == maxlogdepth): + if startdepth is None and (stopdepth is None or stopdepth >= maxlogdepth): gen = _genrevdescendants(repo, revs, followfirst) else: gen = _genrevdescendantsofdepth(repo, revs, followfirst,