~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Michael Ellerman
  • Date: 2005-12-10 22:11:13 UTC
  • mto: This revision was merged to the branch mainline in revision 1528.
  • Revision ID: michael@ellerman.id.au-20051210221113-99ca561aaab4661e
Simplify handling of DivergedBranches in cmd_pull()

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>]
78
74
    """
79
75
    # TODO: Maybe move this into revisionspec.py
80
76
    old_format_re = re.compile('\d*:\d*')
89
85
            else:
90
86
                revs.append(RevisionSpec(None))
91
87
    else:
92
 
        sep = re.compile("\\.\\.(?!/)")
93
 
        for x in sep.split(revstr):
94
 
            revs.append(RevisionSpec(x or None))
 
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))
95
102
    return revs
96
103
 
97
104
 
184
191
_global_option('version')
185
192
_global_option('email')
186
193
_global_option('update')
187
 
_global_option('long', help='Use detailed log format')
188
 
_global_option('short', help='Use moderately short log format')
189
 
_global_option('line', help='Use log format with one line per revision')
 
194
_global_option('long')
190
195
_global_option('root', type=str)
191
196
_global_option('no-backup')
192
197
_global_option('merge-type', type=_parse_merge_type)
196
201
               ' default.')
197
202
_global_option('reprocess', help='Reprocess to reduce spurious conflicts')
198
203
_global_option('kind', type=str)
199
 
_global_option('dry-run',
200
 
               help="show what would be done, but don't actually do anything")
201
204
 
202
205
 
203
206
def _global_short(short_name, long_name):