~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

Merged mailine

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