diff -r e825dfea3823 -r fe7fbfdb066d mercurial/commands.py --- a/mercurial/commands.py Wed Sep 14 22:32:12 2005 -0700 +++ b/mercurial/commands.py Thu Sep 15 00:04:29 2005 -0700 @@ -163,9 +163,9 @@ num = int(val) if str(num) != val: raise ValueError - if num < 0: - num += revcount - if not (0 <= num < revcount): + if num < 0: num += revcount + if num < 0: num = 0 + elif num >= revcount: raise ValueError except ValueError: try: