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.
22
from bzrlib.trace import warning
20
import bzrlib.commands
21
from bzrlib.trace import warning, mutter
23
22
from bzrlib.revisionspec import RevisionSpec
24
23
from bzrlib.errors import BzrCommandError
72
71
BzrError: No namespace registered for string: 'abc'
73
72
>>> _parse_revision_str('branch:../branch2')
74
73
[<RevisionSpec_branch branch:../branch2>]
75
>>> _parse_revision_str('branch:../../branch2')
76
[<RevisionSpec_branch branch:../../branch2>]
77
>>> _parse_revision_str('branch:../../branch2..23')
78
[<RevisionSpec_branch branch:../../branch2>, <RevisionSpec_int 23>]
80
75
# TODO: Maybe move this into revisionspec.py
81
76
old_format_re = re.compile('\d*:\d*')
91
86
revs.append(RevisionSpec(None))
93
sep = re.compile("\\.\\.(?!/)")
94
for x in sep.split(revstr):
95
revs.append(RevisionSpec(x or None))
89
for x in revstr.split('..'):
91
revs.append(RevisionSpec(None))
93
# looks like a namespace:.. has happened
94
next_prefix = x + '..'
96
if next_prefix is not None:
98
revs.append(RevisionSpec(x))
100
if next_prefix is not None:
101
revs.append(RevisionSpec(next_prefix))
162
168
_global_option('overwrite', help='Ignore differences between branches and '
163
169
'overwrite unconditionally')
164
170
_global_option('basis', type=str)
165
_global_option('bound')
166
171
_global_option('diff-options', type=str)
167
172
_global_option('help',
168
173
help='show help message')
172
177
_global_option('forward')
173
178
_global_option('message', type=unicode)
174
179
_global_option('no-recurse')
175
_global_option('prefix', type=str,
176
help='Set prefixes to added to old and new filenames, as '
177
'two values separated by a colon.')
178
180
_global_option('profile',
179
181
help='show performance profiling information')
180
182
_global_option('revision', type=_parse_revision_str)
183
_global_option('short')
181
184
_global_option('show-ids',
182
185
help='show internal object ids')
183
186
_global_option('timezone',
185
188
help='display timezone as local, original, or utc')
186
_global_option('unbound')
187
189
_global_option('verbose',
188
190
help='display more information')
189
191
_global_option('version')
190
192
_global_option('email')
191
193
_global_option('update')
192
_global_option('log-format', type=str, help="Use this log format")
193
_global_option('long', help='Use detailed log format. Same as --log-format long')
194
_global_option('short', help='Use moderately short log format. Same as --log-format short')
195
_global_option('line', help='Use log format with one line per revision. Same as --log-format line')
194
_global_option('long')
196
195
_global_option('root', type=str)
197
196
_global_option('no-backup')
198
_global_option('merge-type', type=_parse_merge_type,
199
help='Select a particular merge algorithm')
197
_global_option('merge-type', type=_parse_merge_type)
200
198
_global_option('pattern', type=str)
201
199
_global_option('quiet')
202
200
_global_option('remember', help='Remember the specified location as a'
204
202
_global_option('reprocess', help='Reprocess to reduce spurious conflicts')
205
_global_option('kind', type=str)
206
_global_option('dry-run',
207
help="show what would be done, but don't actually do anything")
210
205
def _global_short(short_name, long_name):