34
34
# if known, but only if really going to the terminal (not into a file)
37
def report_changes(to_file, old, new, specific_files,
38
show_short_reporter, show_long_callback,
39
short=False, want_unchanged=False,
40
want_unversioned=False, show_ids=False):
41
"""Display summary of changes.
43
This compares two trees with regards to a list of files, and delegates
44
the display to underlying elements.
46
For short output, it creates an iterator on all changes, and lets a given
47
reporter display these changes.
49
For stantard output, it creates a delta of the changes, and forwards it
52
:param to_file: If set, write to this file (default stdout.)
53
:param old: Start tree for the comparison
54
:param end: End tree for the comparison
55
:param specific_files: If set, a list of filenames whose status should be
56
shown. It is an error to give a filename that is not in the working
57
tree, or in the working inventory or in the basis inventory.
58
:param show_short_reporter: Reporter in charge of display for short output
59
:param show_long_callback: Callback in charge of display for normal output
60
:param short: If True, gives short SVN-style status lines.
61
:param want_unchanged: Deprecated parameter. If set, includes unchanged
63
:param show_ids: If set, includes each file's id.
64
:param want_unversioned: If False, only shows versioned files.
68
changes = new.iter_changes(old, want_unchanged, specific_files,
69
require_versioned=False, want_unversioned=want_unversioned)
70
_mod_delta.report_changes(changes, show_short_reporter)
73
delta = new.changes_from(old, want_unchanged=want_unchanged,
74
specific_files=specific_files,
75
want_unversioned=want_unversioned)
76
# filter out unknown files. We may want a tree method for
78
delta.unversioned = [unversioned for unversioned in
79
delta.unversioned if not new.is_ignored(unversioned[0])]
80
show_long_callback(to_file, delta,
82
show_unchanged=want_unchanged)
85
37
def show_tree_status(wt, show_unchanged=None,
86
38
specific_files=None,
120
71
:param verbose: If True, show all merged revisions, not just
122
73
:param versioned: If True, only shows versioned files.
123
:param show_long_callback: A callback: message = show_long_callback(to_file, delta,
124
show_ids, show_unchanged, indent, filter), only used with the long output
126
75
if show_unchanged is not None:
127
76
warn("show_tree_status with show_unchanged has been deprecated "
157
106
specific_files, nonexistents \
158
107
= _filter_nonexistent(specific_files, old, new)
159
108
want_unversioned = not versioned
161
# Reporter used for short outputs
162
reporter = _mod_delta._ChangeReporter(output_file=to_file,
163
unversioned_filter=new.is_ignored)
164
report_changes(to_file, old, new, specific_files,
165
reporter, show_long_callback,
166
short=short, want_unchanged=show_unchanged,
167
want_unversioned=want_unversioned, show_ids=show_ids)
110
changes = new.iter_changes(old, show_unchanged, specific_files,
111
require_versioned=False, want_unversioned=want_unversioned)
112
reporter = _mod_delta._ChangeReporter(output_file=to_file,
113
unversioned_filter=new.is_ignored)
114
_mod_delta.report_changes(changes, reporter)
116
delta = new.changes_from(old, want_unchanged=show_unchanged,
117
specific_files=specific_files,
118
want_unversioned=want_unversioned)
119
# filter out unknown files. We may want a tree method for
121
delta.unversioned = [unversioned for unversioned in
122
delta.unversioned if not new.is_ignored(unversioned[0])]
125
show_unchanged=show_unchanged,
169
127
# show the new conflicts only for now. XXX: get them from the
171
129
conflicts = new.conflicts()