2278
2278
filter_by_dir = False
2280
# find the file ids to log and check for directory filtering
2281
b, file_info_list, rev1, rev2 = _get_info_for_log_files(revision,
2283
for relpath, file_id, kind in file_info_list:
2285
raise errors.BzrCommandError(
2286
"Path unknown at end or start of revision range: %s" %
2288
# If the relpath is the top of the tree, we log everything
2282
# find the file ids to log and check for directory filtering
2283
b, file_info_list, rev1, rev2 = _get_info_for_log_files(
2284
revision, file_list)
2285
for relpath, file_id, kind in file_info_list:
2287
raise errors.BzrCommandError(
2288
"Path unknown at end or start of revision range: %s" %
2290
# If the relpath is the top of the tree, we log everything
2295
file_ids.append(file_id)
2296
filter_by_dir = filter_by_dir or (
2297
kind in ['directory', 'tree-reference'])
2300
# FIXME ? log the current subdir only RBC 20060203
2301
if revision is not None \
2302
and len(revision) > 0 and revision[0].get_branch():
2303
location = revision[0].get_branch()
2293
file_ids.append(file_id)
2294
filter_by_dir = filter_by_dir or (
2295
kind in ['directory', 'tree-reference'])
2298
# FIXME ? log the current subdir only RBC 20060203
2299
if revision is not None \
2300
and len(revision) > 0 and revision[0].get_branch():
2301
location = revision[0].get_branch()
2304
dir, relpath = bzrdir.BzrDir.open_containing(location)
2305
b = dir.open_branch()
2306
rev1, rev2 = _get_revision_range(revision, b, self.name())
2308
# Decide on the type of delta & diff filtering to use
2309
# TODO: add an --all-files option to make this configurable & consistent
2317
diff_type = 'partial'
2306
dir, relpath = bzrdir.BzrDir.open_containing(location)
2307
b = dir.open_branch()
2309
rev1, rev2 = _get_revision_range(revision, b, self.name())
2311
# Decide on the type of delta & diff filtering to use
2312
# TODO: add an --all-files option to make this configurable & consistent
2320
diff_type = 'partial'
2323
2324
# Build the log formatter
2324
2325
if log_format is None:
2325
2326
log_format = log.log_formatter_registry.get_default(b)
2425
2427
@display_command
2426
2428
def run(self, filename):
2427
2429
tree, relpath = WorkingTree.open_containing(filename)
2430
file_id = tree.path2id(relpath)
2428
2431
b = tree.branch
2429
file_id = tree.path2id(relpath)
2430
for revno, revision_id, what in log.find_touching_revisions(b, file_id):
2431
self.outf.write("%6d %s\n" % (revno, what))
2434
touching_revs = log.find_touching_revisions(b, file_id)
2435
for revno, revision_id, what in touching_revs:
2436
self.outf.write("%6d %s\n" % (revno, what))
2434
2441
class cmd_ls(Command):