mercurial/commands.py
changeset 1257 fe7fbfdb066d
parent 1255 e825dfea3823
child 1262 325c07fd2ebd
equal deleted inserted replaced
1255:e825dfea3823 1257:fe7fbfdb066d
   161             return defval
   161             return defval
   162         try:
   162         try:
   163             num = int(val)
   163             num = int(val)
   164             if str(num) != val:
   164             if str(num) != val:
   165                 raise ValueError
   165                 raise ValueError
   166             if num < 0:
   166             if num < 0: num += revcount
   167                 num += revcount
   167             if num < 0: num = 0
   168             if not (0 <= num < revcount):
   168             elif num >= revcount:
   169                 raise ValueError
   169                 raise ValueError
   170         except ValueError:
   170         except ValueError:
   171             try:
   171             try:
   172                 num = repo.changelog.rev(repo.lookup(val))
   172                 num = repo.changelog.rev(repo.lookup(val))
   173             except KeyError:
   173             except KeyError: