19
19
def show_status(branch, show_unchanged=False,
20
20
specific_files=None,
22
"""Display single-line status for non-ignored working files.
25
"""Display status for non-ignored working files.
25
If true, show unmodified files too.
28
If set, includes unchanged files.
28
31
If set, only show the status of files in this list.
34
If set, includes each file's id.
37
If set, write to this file (default stdout.)
40
If set, write pending merges.
42
If None the compare latest revision with working tree
43
If one revision show compared it with working tree.
44
If two revisions show status between first and second.
31
from bzrlib.diff import compare_trees
47
from bzrlib.delta import compare_trees
36
old = branch.basis_tree()
37
new = branch.working_tree()
54
new_is_working_tree = True
56
old = branch.basis_tree()
57
new = branch.working_tree()
58
elif len(revision) > 0:
60
rev_id = revision[0].in_history(branch).rev_id
61
old = branch.revision_tree(rev_id)
62
except NoSuchRevision, e:
63
raise BzrCommandError(str(e))
66
rev_id = revision[1].in_history(branch).rev_id
67
new = branch.revision_tree(rev_id)
68
new_is_working_tree = False
69
except NoSuchRevision, e:
70
raise BzrCommandError(str(e))
72
new = branch.working_tree()
39
75
delta = compare_trees(old, new, want_unchanged=show_unchanged,
40
76
specific_files=specific_files)
42
delta.show(sys.stdout, show_ids=show_ids,
43
80
show_unchanged=show_unchanged)
45
unknowns = new.unknowns()
48
# FIXME: Should also match if the unknown file is within a
49
# specified directory.
51
if path not in specific_files:
82
if new_is_working_tree:
83
unknowns = new.unknowns()
86
# FIXME: Should also match if the unknown file is within a
87
# specified directory.
89
if path not in specific_files:
92
print >>to_file, 'unknown:'
94
print >>to_file, ' ', path
95
if show_pending and len(branch.pending_merges()) > 0:
96
print >>to_file, 'pending merges:'
97
for merge in branch.pending_merges():
98
print >> to_file, ' ', merge