From: Eric S. Raymond Date: Fri, 7 Nov 2014 21:42:10 +0000 (-0500) Subject: Add out-of-bounds revision check. X-Git-Tag: 0.2~39 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=69b30a3f6c6179c6868493aebeeb035d493dcb43;p=src.git Add out-of-bounds revision check. --- diff --git a/src b/src index 295eefe..8068be5 100755 --- a/src +++ b/src @@ -232,6 +232,8 @@ class RCSLog: end = self.symbols[end] else: croak("can't resolve symbol {0} in {1}".format(end, self.name)) + if end > len(self): + croak("{0} has no {1} revision".format(self.name, end)) return range(start, end+1) def help_method(*args): diff --git a/srctest b/srctest index 5ab05b9..781ae37 100755 --- a/srctest +++ b/srctest @@ -97,6 +97,8 @@ src $TESTOPTS log testfile1 >testfile5 diff testfile4 testfile5 check "3-commit log test" -# to do: checkout, tag, fast-export, out-of-bounds revisions. +#src list 5 testfile1 + +# to do: checkout, tag, fast-export # end