/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Daniel Watkins
  • Date: 2009-02-07 23:54:41 UTC
  • mto: (3993.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3994.
  • Revision ID: daniel@daniel-watkins.co.uk-20090207235441-igbvmxlrs7nz966p
Changed from option type to helper function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    return revs
100
100
 
101
101
 
102
 
def _parse_one_revision_str(revstr):
103
 
    """Parse the revision string and return a single revision.
104
 
 
105
 
    >>> _parse_one_revision_str('123')
106
 
    <RevisionSpec_revno 123>
107
 
    >>> _parse_one_revision_str('123..124')
108
 
    Traceback (most recent call last):
109
 
      ...
110
 
    RangeInSingleRevisionOption: This command does not accept revision ranges
111
 
    """
112
 
    revs = _parse_revision_str(revstr)
113
 
    if len(revs) > 1:
114
 
        raise errors.RangeInSingleRevisionOption()
115
 
    return revs[0]
116
 
 
117
 
 
118
102
def _parse_change_str(revstr):
119
103
    """Parse the revision string and return a tuple with left-most
120
104
    parent of the revision.
546
530
               type=_parse_revision_str,
547
531
               short_name='r',
548
532
               help='See "help revisionspec" for details.')
549
 
_global_option('1revision',
550
 
               type=_parse_one_revision_str,
551
 
               short_name='r',
552
 
               param_name='revision',
553
 
               help='Select changes introduced by the specified revision.'
554
 
                    ' See also "help revisionspec".')
555
533
_global_option('change',
556
534
               type=_parse_change_str,
557
535
               short_name='c',