657
657
base_tree.lock_read()
659
file_list = self._maybe_expand_globs(file_list)
660
659
tree, file_list = tree_files_for_add(file_list)
661
660
added, ignored = tree.smart_add(file_list, not
662
661
no_recurse, action=action, save=not dry_run)
851
850
# All entries reference existing inventory items, so fix them up
852
851
# for cicp file-systems.
853
852
rel_names = tree.get_canonical_inventory_paths(rel_names)
854
for pair in tree.move(rel_names[:-1], rel_names[-1], after=after):
855
self.outf.write("%s => %s\n" % pair)
853
for src, dest in tree.move(rel_names[:-1], rel_names[-1], after=after):
855
self.outf.write("%s => %s\n" % (src, dest))
857
857
if len(names_list) != 2:
858
858
raise errors.BzrCommandError('to mv multiple files the'
902
902
dest = osutils.pathjoin(dest_parent, dest_tail)
903
903
mutter("attempting to move %s => %s", src, dest)
904
904
tree.rename_one(src, dest, after=after)
905
self.outf.write("%s => %s\n" % (src, dest))
906
self.outf.write("%s => %s\n" % (src, dest))
908
909
class cmd_pull(Command):
2279
2280
filter_by_dir = False
2281
# find the file ids to log and check for directory filtering
2282
b, file_info_list, rev1, rev2 = _get_info_for_log_files(revision,
2284
for relpath, file_id, kind in file_info_list:
2286
raise errors.BzrCommandError(
2287
"Path unknown at end or start of revision range: %s" %
2289
# If the relpath is the top of the tree, we log everything
2284
# find the file ids to log and check for directory filtering
2285
b, file_info_list, rev1, rev2 = _get_info_for_log_files(
2286
revision, file_list)
2287
for relpath, file_id, kind in file_info_list:
2289
raise errors.BzrCommandError(
2290
"Path unknown at end or start of revision range: %s" %
2292
# If the relpath is the top of the tree, we log everything
2297
file_ids.append(file_id)
2298
filter_by_dir = filter_by_dir or (
2299
kind in ['directory', 'tree-reference'])
2302
# FIXME ? log the current subdir only RBC 20060203
2303
if revision is not None \
2304
and len(revision) > 0 and revision[0].get_branch():
2305
location = revision[0].get_branch()
2294
file_ids.append(file_id)
2295
filter_by_dir = filter_by_dir or (
2296
kind in ['directory', 'tree-reference'])
2299
# FIXME ? log the current subdir only RBC 20060203
2300
if revision is not None \
2301
and len(revision) > 0 and revision[0].get_branch():
2302
location = revision[0].get_branch()
2305
dir, relpath = bzrdir.BzrDir.open_containing(location)
2306
b = dir.open_branch()
2307
rev1, rev2 = _get_revision_range(revision, b, self.name())
2309
# Decide on the type of delta & diff filtering to use
2310
# TODO: add an --all-files option to make this configurable & consistent
2318
diff_type = 'partial'
2308
dir, relpath = bzrdir.BzrDir.open_containing(location)
2309
b = dir.open_branch()
2311
rev1, rev2 = _get_revision_range(revision, b, self.name())
2313
# Decide on the type of delta & diff filtering to use
2314
# TODO: add an --all-files option to make this configurable & consistent
2322
diff_type = 'partial'
2324
2326
# Build the log formatter
2325
2327
if log_format is None:
2326
2328
log_format = log.log_formatter_registry.get_default(b)
2426
2429
@display_command
2427
2430
def run(self, filename):
2428
2431
tree, relpath = WorkingTree.open_containing(filename)
2432
file_id = tree.path2id(relpath)
2429
2433
b = tree.branch
2430
file_id = tree.path2id(relpath)
2431
for revno, revision_id, what in log.find_touching_revisions(b, file_id):
2432
self.outf.write("%6d %s\n" % (revno, what))
2436
touching_revs = log.find_touching_revisions(b, file_id)
2437
for revno, revision_id, what in touching_revs:
2438
self.outf.write("%6d %s\n" % (revno, what))
2435
2443
class cmd_ls(Command):
3032
3040
def get_message(commit_obj):
3033
3041
"""Callback to get commit message"""
3034
3042
my_message = message
3043
if my_message is not None and '\r' in my_message:
3044
my_message = my_message.replace('\r\n', '\n')
3045
my_message = my_message.replace('\r', '\n')
3035
3046
if my_message is None and not file:
3036
3047
t = make_commit_message_template_encoded(tree,
3037
3048
selected_list, diff=show_diff,