~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Martin Pool
  • Date: 2005-09-02 02:05:26 UTC
  • Revision ID: mbp@sourcefrog.net-20050902020526-0ab28bd5a998df70
- fix off-by-one in 'bzr log -r'

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
    
163
163
    if start_revision is None:
164
164
        start_revision = 1
165
 
    elif start_revision < 1 or start_revision >= len(which_revs):
 
165
    elif not (1 <= start_revision <= len(which_revs)):
166
166
        raise InvalidRevisionNumber(start_revision)
167
167
    
168
168
    if end_revision is None:
169
169
        end_revision = len(which_revs)
170
 
    elif end_revision < 1 or end_revision >= len(which_revs):
 
170
    elif not (1 <= end_revision <= len(which_revs)):
171
171
        raise InvalidRevisionNumber(end_revision)
172
172
 
173
173
    # list indexes are 0-based; revisions are 1-based