14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
# TODO: For things like --diff-prefix, we want a way to customize the display
18
# of the option argument.
20
22
import bzrlib.commands
21
23
from bzrlib.trace import warning, mutter
22
24
from bzrlib.revisionspec import RevisionSpec
25
from bzrlib.errors import BzrCommandError
25
28
def _parse_revision_str(revstr):
70
73
BzrError: No namespace registered for string: 'abc'
71
74
>>> _parse_revision_str('branch:../branch2')
72
75
[<RevisionSpec_branch branch:../branch2>]
76
>>> _parse_revision_str('branch:../../branch2')
77
[<RevisionSpec_branch branch:../../branch2>]
78
>>> _parse_revision_str('branch:../../branch2..23')
79
[<RevisionSpec_branch branch:../../branch2>, <RevisionSpec_int 23>]
74
81
# TODO: Maybe move this into revisionspec.py
75
82
old_format_re = re.compile('\d*:\d*')
85
92
revs.append(RevisionSpec(None))
88
for x in revstr.split('..'):
90
revs.append(RevisionSpec(None))
92
# looks like a namespace:.. has happened
93
next_prefix = x + '..'
95
if next_prefix is not None:
97
revs.append(RevisionSpec(x))
99
if next_prefix is not None:
100
revs.append(RevisionSpec(next_prefix))
94
sep = re.compile("\\.\\.(?!/)")
95
for x in sep.split(revstr):
96
revs.append(RevisionSpec(x or None))
162
160
Option.OPTIONS[name] = Option(name, **kwargs)
164
162
_global_option('all')
165
_global_option('clobber')
163
_global_option('overwrite', help='Ignore differences between branches and '
164
'overwrite unconditionally')
166
165
_global_option('basis', type=str)
166
_global_option('bound')
167
167
_global_option('diff-options', type=str)
168
168
_global_option('help',
169
169
help='show help message')
173
173
_global_option('forward')
174
174
_global_option('message', type=unicode)
175
175
_global_option('no-recurse')
176
_global_option('prefix', type=str,
177
help='Set prefixes to added to old and new filenames, as '
178
'two values separated by a colon.')
176
179
_global_option('profile',
177
180
help='show performance profiling information')
178
181
_global_option('revision', type=_parse_revision_str)
179
_global_option('short')
180
182
_global_option('show-ids',
181
183
help='show internal object ids')
182
184
_global_option('timezone',
184
186
help='display timezone as local, original, or utc')
187
_global_option('unbound')
185
188
_global_option('verbose',
186
189
help='display more information')
187
190
_global_option('version')
188
191
_global_option('email')
189
192
_global_option('update')
190
_global_option('long')
193
_global_option('log-format', type=str, help="Use this log format")
194
_global_option('long', help='Use detailed log format. Same as --log-format long')
195
_global_option('short', help='Use moderately short log format. Same as --log-format short')
196
_global_option('line', help='Use log format with one line per revision. Same as --log-format line')
191
197
_global_option('root', type=str)
192
198
_global_option('no-backup')
193
_global_option('merge-type', type=_parse_merge_type)
199
_global_option('merge-type', type=_parse_merge_type,
200
help='Select a particular merge algorithm')
194
201
_global_option('pattern', type=str)
195
202
_global_option('quiet')
196
_global_option('remember')
203
_global_option('remember', help='Remember the specified location as a'
205
_global_option('reprocess', help='Reprocess to reduce spurious conflicts')
206
_global_option('kind', type=str)
207
_global_option('dry-run',
208
help="show what would be done, but don't actually do anything")
199
211
def _global_short(short_name, long_name):