changeset 33039:a10f5f6771f6

dagop: raise ProgrammingError if stopdepth < 0 revset.py should never send such a value.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 23 Jun 2017 22:15:22 -0700
parents ce96efec8112
children bdf4227614e2
files mercurial/dagop.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dagop.py	Sat Jun 24 13:48:04 2017 +0900
+++ b/mercurial/dagop.py	Fri Jun 23 22:15:22 2017 -0700
@@ -32,8 +32,10 @@
         startdepth = 0
     if stopdepth is None:
         stopdepth = _maxlogdepth
-    if stopdepth <= 0:
+    if stopdepth == 0:
         return
+    if stopdepth < 0:
+        raise error.ProgrammingError('negative stopdepth')
 
     cl = repo.changelog