19
19
from bzrlib.delta import compare_trees
20
20
from bzrlib.diff import _raise_if_nonexistent
21
from bzrlib.errors import NoSuchRevision
21
import bzrlib.errors as errors
22
22
from bzrlib.log import line_log
23
23
from bzrlib.osutils import is_inside_any
24
from bzrlib.symbol_versioning import *
24
from bzrlib.symbol_versioning import (deprecated_function,
26
28
# TODO: when showing single-line logs, truncate to the width of the terminal
27
29
# if known, but only if really going to the terminal (not into a file)
30
32
@deprecated_function(zero_eight)
31
def show_status(branch, show_unchanged=False,
33
def show_status(branch, show_unchanged=None,
32
34
specific_files=None,
69
71
specific_files, show_ids, to_file, show_pending, revision)
72
def show_tree_status(wt, show_unchanged=False,
74
def show_tree_status(wt, show_unchanged=None,
73
75
specific_files=None,
87
89
If showing the status of a working tree, extra information is included
88
90
about unknown files, conflicts, and pending merges.
91
If set, includes unchanged files.
94
If set, a list of filenames whose status should be shown.
95
It is an error to give a filename that is not in the working
92
:param show_unchanged: Deprecated parameter. If set, includes unchanged
94
:param specific_files: If set, a list of filenames whose status should be
95
shown. It is an error to give a filename that is not in the working
96
96
tree, or in the working inventory or in the basis inventory.
99
If set, includes each file's id.
102
If set, write to this file (default stdout.)
105
If set, write pending merges.
108
If None the compare latest revision with working tree
97
:param show_ids: If set, includes each file's id.
98
:param to_file: If set, write to this file (default stdout.)
99
:param show_pending: If set, write pending merges.
100
:param revision: If None the compare latest revision with working tree
101
If not None it must be a RevisionSpec list.
109
102
If one revision show compared it with working tree.
110
103
If two revisions show status between first and second.
105
if show_unchanged is not None:
106
warn("show_status_trees with show_unchanged has been deprecated "
107
"since bzrlib 0.9", DeprecationWarning, stacklevel=2)
113
110
to_file = sys.stdout
123
120
rev_id = revision[0].in_history(wt.branch).rev_id
124
121
old = wt.branch.repository.revision_tree(rev_id)
125
except NoSuchRevision, e:
126
raise BzrCommandError(str(e))
122
except errors.NoSuchRevision, e:
123
raise errors.BzrCommandError(str(e))
127
124
if (len(revision) > 1) and (revision[1].spec is not None):
129
126
rev_id = revision[1].in_history(wt.branch).rev_id
130
127
new = wt.branch.repository.revision_tree(rev_id)
131
128
new_is_working_tree = False
132
except NoSuchRevision, e:
133
raise BzrCommandError(str(e))
129
except errors.NoSuchRevision, e:
130
raise errors.BzrCommandError(str(e))
136
133
_raise_if_nonexistent(specific_files, old, new)
180
177
mm_revision = branch.repository.get_revision(mmerge)
181
178
print >> to_file, ' ', line_log(mm_revision, 75)
182
179
ignore.add(mmerge)
183
except NoSuchRevision:
184
print >> to_file, ' ', merge
180
except errors.NoSuchRevision:
181
print >> to_file, ' ', merge
186
183
def list_paths(header, paths, specific_files, to_file):
187
184
done_header = False