1062
1062
_see_also = ['revno', 'working-trees', 'repositories']
1063
1063
takes_args = ['location?']
1064
1064
takes_options = ['verbose']
1065
encoding_type = 'replace'
1067
1066
@display_command
1068
1067
def run(self, location=None, verbose=False):
1072
1071
noise_level = 0
1073
1072
from bzrlib.info import show_bzrdir_info
1074
1073
show_bzrdir_info(bzrdir.BzrDir.open_containing(location)[0],
1075
verbose=noise_level, outfile=self.outf)
1074
verbose=noise_level)
1078
1077
class cmd_remove(Command):
1386
1385
"bzr diff -p1" is equivalent to "bzr diff --prefix old/:new/", and
1387
1386
produces patches suitable for "patch -p1".
1391
2 - unrepresentable changes
1396
1389
Shows the difference in the working tree versus the last commit::
2369
2362
def run(self, branch=None, verbose=False):
2370
2363
from bzrlib.check import check
2371
2364
if branch is None:
2372
branch_obj = Branch.open_containing('.')[0]
2374
branch_obj = Branch.open(branch)
2375
check(branch_obj, verbose)
2376
# bit hacky, check the tree parent is accurate
2379
tree = WorkingTree.open_containing('.')[0]
2381
tree = WorkingTree.open(branch)
2382
except (errors.NoWorkingTree, errors.NotLocalUrl):
2385
# This is a primitive 'check' for tree state. Currently this is not
2386
# integrated into the main check logic as yet.
2389
tree_basis = tree.basis_tree()
2390
tree_basis.lock_read()
2392
repo_basis = tree.branch.repository.revision_tree(
2393
tree.last_revision())
2394
if len(list(repo_basis._iter_changes(tree_basis))):
2395
raise errors.BzrCheckError(
2396
"Mismatched basis inventory content.")
2365
branch = Branch.open_containing('.')[0]
2367
branch = Branch.open(branch)
2368
check(branch, verbose)
2404
2371
class cmd_upgrade(Command):
4197
4164
short_name='d',
4200
RegistryOption.from_kwargs('sort',
4201
'Sort tags by different criteria.', title='Sorting',
4202
alpha='Sort tags lexicographically (default).',
4203
time='Sort tags chronologically.',
4208
4169
@display_command
4214
4173
branch, relpath = Branch.open_containing(directory)
4215
tags = branch.tags.get_tag_dict().items()
4218
elif sort == 'time':
4220
for tag, revid in tags:
4222
revobj = branch.repository.get_revision(revid)
4223
except errors.NoSuchRevision:
4224
timestamp = sys.maxint # place them at the end
4226
timestamp = revobj.timestamp
4227
timestamps[revid] = timestamp
4228
tags.sort(key=lambda x: timestamps[x[1]])
4230
# [ (tag, revid), ... ] -> [ (tag, dotted_revno), ... ]
4231
revno_map = branch.get_revision_id_to_revno_map()
4232
tags = [ (tag, '.'.join(map(str, revno_map.get(revid, ('?',)))))
4233
for tag, revid in tags ]
4234
for tag, revspec in tags:
4235
self.outf.write('%-20s %s\n' % (tag, revspec))
4174
for tag_name, target in sorted(branch.tags.get_tag_dict().items()):
4175
self.outf.write('%-20s %s\n' % (tag_name, target))
4238
4178
class cmd_reconfigure(Command):