~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Aaron Bentley
  • Date: 2006-02-22 14:39:42 UTC
  • mto: (2027.1.2 revert-subpath-56549)
  • mto: This revision was merged to the branch mainline in revision 1570.
  • Revision ID: abentley@panoramicfeedback.com-20060222143942-ae72299f2de66767
Fixed build_tree with symlinks

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    BzrError: No namespace registered for string: 'abc'
72
72
    >>> _parse_revision_str('branch:../branch2')
73
73
    [<RevisionSpec_branch branch:../branch2>]
 
74
    >>> _parse_revision_str('branch:../../branch2')
 
75
    [<RevisionSpec_branch branch:../../branch2>]
 
76
    >>> _parse_revision_str('branch:../../branch2..23')
 
77
    [<RevisionSpec_branch branch:../../branch2>, <RevisionSpec_int 23>]
74
78
    """
75
79
    # TODO: Maybe move this into revisionspec.py
76
80
    old_format_re = re.compile('\d*:\d*')
85
89
            else:
86
90
                revs.append(RevisionSpec(None))
87
91
    else:
88
 
        next_prefix = None
89
 
        for x in revstr.split('..'):
90
 
            if not x:
91
 
                revs.append(RevisionSpec(None))
92
 
            elif x[-1] == ':':
93
 
                # looks like a namespace:.. has happened
94
 
                next_prefix = x + '..'
95
 
            else:
96
 
                if next_prefix is not None:
97
 
                    x = next_prefix + x
98
 
                revs.append(RevisionSpec(x))
99
 
                next_prefix = None
100
 
        if next_prefix is not None:
101
 
            revs.append(RevisionSpec(next_prefix))
 
92
        sep = re.compile("\\.\\.(?!/)")
 
93
        for x in sep.split(revstr):
 
94
            revs.append(RevisionSpec(x or None))
102
95
    return revs
103
96
 
104
97
 
191
184
_global_option('version')
192
185
_global_option('email')
193
186
_global_option('update')
194
 
_global_option('long', help='Use detailed log format')
195
 
_global_option('short', help='Use moderately short log format')
196
 
_global_option('line', help='Use log format with one line per revision')
 
187
_global_option('log-format', type=str, help="Use this log format")
 
188
_global_option('long', help='Use detailed log format. Same as --log-format long')
 
189
_global_option('short', help='Use moderately short log format. Same as --log-format short')
 
190
_global_option('line', help='Use log format with one line per revision. Same as --log-format line')
197
191
_global_option('root', type=str)
198
192
_global_option('no-backup')
199
193
_global_option('merge-type', type=_parse_merge_type)