2318
2318
:Other filtering:
2320
The --message option can be used for finding revisions that match a
2321
regular expression in a commit message.
2320
The --match option can be used for finding revisions that match a
2321
regular expression in a commit message, committer, author or bug.
2322
Specifying the option several times will match any of the supplied
2323
expressions. --match-author, --match-bugs, --match-committer and
2324
--match-message can be used to only match a specific field.
2323
2326
:Tips & tricks:
2405
2408
Option('signatures',
2406
2409
help='Show digital signature validity'),
2412
help='Show revisions whose properties match this '
2415
ListOption('match-message',
2416
help='Show revisions whose message matches this '
2419
ListOption('match-committer',
2420
help='Show revisions whose committer matches this '
2423
ListOption('match-author',
2424
help='Show revisions whose authors match this '
2427
ListOption('match-bugs',
2428
help='Show revisions whose bugs match this '
2408
2432
encoding_type = 'replace'
2531
2560
match_using_deltas = (len(file_ids) != 1 or filter_by_dir
2532
2561
or delta_type or partial_history)
2565
match_dict[''] = match
2567
match_dict['message'] = match_message
2569
match_dict['committer'] = match_committer
2571
match_dict['author'] = match_author
2573
match_dict['bugs'] = match_bugs
2534
2575
# Build the LogRequest and execute it
2535
2576
if len(file_ids) == 0:
2536
2577
file_ids = None
2539
2580
start_revision=rev1, end_revision=rev2, limit=limit,
2540
2581
message_search=message, delta_type=delta_type,
2541
2582
diff_type=diff_type, _match_using_deltas=match_using_deltas,
2542
exclude_common_ancestry=exclude_common_ancestry,
2583
exclude_common_ancestry=exclude_common_ancestry, match=match_dict,
2543
2584
signature=signatures
2545
2586
Logger(b, rqst).show(lf)
3033
3074
old_file_id = rev_tree.path2id(relpath)
3076
# TODO: Split out this code to something that generically finds the
3077
# best id for a path across one or more trees; it's like
3078
# find_ids_across_trees but restricted to find just one. -- mbp
3035
3080
if name_from_revision:
3036
3081
# Try in revision if requested
3037
3082
if old_file_id is None:
3039
3084
"%r is not present in revision %s" % (
3040
3085
filename, rev_tree.get_revision_id()))
3042
content = rev_tree.get_file_text(old_file_id)
3087
actual_file_id = old_file_id
3044
3089
cur_file_id = tree.path2id(relpath)
3046
if cur_file_id is not None:
3047
# Then try with the actual file id
3049
content = rev_tree.get_file_text(cur_file_id)
3051
except errors.NoSuchId:
3052
# The actual file id didn't exist at that time
3054
if not found and old_file_id is not None:
3055
# Finally try with the old file id
3056
content = rev_tree.get_file_text(old_file_id)
3059
# Can't be found anywhere
3090
if cur_file_id is not None and rev_tree.has_id(cur_file_id):
3091
actual_file_id = cur_file_id
3092
elif old_file_id is not None:
3093
actual_file_id = old_file_id
3060
3095
raise errors.BzrCommandError(
3061
3096
"%r is not present in revision %s" % (
3062
3097
filename, rev_tree.get_revision_id()))
3064
from bzrlib.filters import (
3065
ContentFilterContext,
3066
filtered_output_bytes,
3068
filters = rev_tree._content_filter_stack(relpath)
3069
chunks = content.splitlines(True)
3070
content = filtered_output_bytes(chunks, filters,
3071
ContentFilterContext(relpath, rev_tree))
3073
self.outf.writelines(content)
3099
from bzrlib.filter_tree import ContentFilterTree
3100
filter_tree = ContentFilterTree(rev_tree,
3101
rev_tree._content_filter_stack)
3102
content = filter_tree.get_file_text(actual_file_id)
3076
self.outf.write(content)
3104
content = rev_tree.get_file_text(actual_file_id)
3106
self.outf.write(content)
3079
3109
class cmd_local_time_offset(Command):