20
20
specific_files=None,
25
"""Display status for non-ignored working files.
24
"""Display single-line status for non-ignored working files.
28
If set, includes unchanged files.
27
If true, show unmodified files too.
31
30
If set, only show the status of files in this list.
34
If set, includes each file's id.
37
33
If set, write to this file (default stdout.)
40
If set, write pending merges.
43
If None the compare latest revision with working tree
44
If one revision show compared it with working tree.
45
If two revisions show status between first and second.
48
from bzrlib.osutils import is_inside_any
49
36
from bzrlib.delta import compare_trees
51
38
if to_file == None:
56
new_is_working_tree = True
58
old = branch.basis_tree()
59
new = branch.working_tree()
60
elif len(revision) > 0:
62
rev_id = revision[0].in_history(branch).rev_id
63
old = branch.revision_tree(rev_id)
64
except NoSuchRevision, e:
65
raise BzrCommandError(str(e))
68
rev_id = revision[1].in_history(branch).rev_id
69
new = branch.revision_tree(rev_id)
70
new_is_working_tree = False
71
except NoSuchRevision, e:
72
raise BzrCommandError(str(e))
74
new = branch.working_tree()
44
old = branch.basis_tree()
45
new = branch.working_tree()
77
47
delta = compare_trees(old, new, want_unchanged=show_unchanged,
78
48
specific_files=specific_files)
82
52
show_unchanged=show_unchanged)
84
if new_is_working_tree:
85
conflicts = new.iter_conflicts()
86
unknowns = new.unknowns()
87
list_paths('unknown', unknowns, specific_files, to_file)
88
list_paths('conflicts', conflicts, specific_files, to_file)
89
if show_pending and len(branch.pending_merges()) > 0:
90
print >>to_file, 'pending merges:'
91
for merge in branch.pending_merges():
92
print >> to_file, ' ', merge
54
unknowns = new.unknowns()
57
# FIXME: Should also match if the unknown file is within a
58
# specified directory.
60
if path not in specific_files:
63
print >>to_file, 'unknown:'
65
print >>to_file, ' ', path
66
if show_pending and len(branch.pending_merges()) > 0:
67
print >>to_file, 'pending merges:'
68
for merge in branch.pending_merges():
69
print >> to_file, ' ', merge
96
def list_paths(header, paths, specific_files, to_file):
99
if specific_files and not is_inside_any(specific_files, path):
102
print >>to_file, '%s:' % header
104
print >>to_file, ' ', path