Patchwork [3,of,3,follow-up] dagop: check if stopdepth is greater than or equal to maxlogdepth

login
register
mail settings
Submitter Anton Shestakov
Date Jan. 26, 2019, 4:58 a.m.
Message ID <60b308740000fef7ed43.1548478701@neuro>
Download mbox | patch
Permalink /patch/38064/
State Accepted
Headers show

Comments

Anton Shestakov - Jan. 26, 2019, 4:58 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# 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.

Patch

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,