/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Aaron Bentley
  • Date: 2006-05-20 17:51:13 UTC
  • mfrom: (1718 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1727.
  • Revision ID: aaron.bentley@utoronto.ca-20060520175113-4549e0023f9210bf
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
17
17
import sys
18
18
 
19
19
from bzrlib.delta import compare_trees
 
20
from bzrlib.diff import _raise_if_nonexistent
20
21
from bzrlib.errors import NoSuchRevision
21
22
from bzrlib.log import line_log
22
23
from bzrlib.osutils import is_inside_any
83
84
    The result is written out as Unicode and to_file should be able 
84
85
    to encode that.
85
86
 
 
87
    If showing the status of a working tree, extra information is included
 
88
    about unknown files, conflicts, and pending merges.
 
89
 
86
90
    show_unchanged
87
91
        If set, includes unchanged files.
88
92
 
89
93
    specific_files
90
 
        If set, only show the status of files in this list.
 
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 
 
96
        tree, or in the working inventory or in the basis inventory.
91
97
 
92
98
    show_ids
93
99
        If set, includes each file's id.
127
133
                    raise BzrCommandError(str(e))
128
134
            else:
129
135
                new = wt
130
 
                
 
136
        _raise_if_nonexistent(specific_files, old, new)
131
137
        delta = compare_trees(old, new, want_unchanged=show_unchanged,
132
138
                              specific_files=specific_files)
133
139
        delta.show(to_file,
136
142
 
137
143
        if new_is_working_tree:
138
144
            list_paths('unknown', new.unknowns(), specific_files, to_file)
139
 
            list_paths('conflicts', new.iter_conflicts(), specific_files, to_file)
 
145
            conflict_title = False
 
146
            for conflict in wt.conflicts():
 
147
                if conflict_title is False:
 
148
                    print >> to_file, "conflicts:"
 
149
                    conflict_title = True
 
150
                print >> to_file, "  %s" % conflict
140
151
        if new_is_working_tree and show_pending:
141
152
            show_pending_merges(new, to_file)
142
153
    finally:
153
164
    if last_revision is not None:
154
165
        ignore = set(branch.repository.get_ancestry(last_revision))
155
166
    else:
156
 
        ignore = set()
 
167
        ignore = set([None])
157
168
    for merge in new.pending_merges():
158
169
        ignore.add(merge)
159
170
        try:
160
171
            m_revision = branch.repository.get_revision(merge)
161
172
            print >> to_file, ' ', line_log(m_revision, 77)
162
173
            inner_merges = branch.repository.get_ancestry(merge)
 
174
            assert inner_merges[0] == None
 
175
            inner_merges.pop(0)
163
176
            inner_merges.reverse()
164
177
            for mmerge in inner_merges:
165
178
                if mmerge in ignore: