/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: Andrew Bennetts
  • Date: 2010-01-12 03:53:21 UTC
  • mfrom: (4948 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4964.
  • Revision ID: andrew.bennetts@canonical.com-20100112035321-hofpz5p10224ryj3
Merge lp:bzr, resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
import sys
18
18
 
45
45
                     versioned=False):
46
46
    """Display summary of changes.
47
47
 
48
 
    By default this compares the working tree to a previous revision. 
49
 
    If the revision argument is given, summarizes changes between the 
 
48
    By default this compares the working tree to a previous revision.
 
49
    If the revision argument is given, summarizes changes between the
50
50
    working tree and another, or between two revisions.
51
51
 
52
 
    The result is written out as Unicode and to_file should be able 
 
52
    The result is written out as Unicode and to_file should be able
53
53
    to encode that.
54
54
 
55
55
    If showing the status of a working tree, extra information is included
56
56
    about unknown files, conflicts, and pending merges.
57
57
 
58
 
    :param show_unchanged: Deprecated parameter. If set, includes unchanged 
 
58
    :param show_unchanged: Deprecated parameter. If set, includes unchanged
59
59
        files.
60
60
    :param specific_files: If set, a list of filenames whose status should be
61
 
        shown.  It is an error to give a filename that is not in the working 
 
61
        shown.  It is an error to give a filename that is not in the working
62
62
        tree, or in the working inventory or in the basis inventory.
63
63
    :param show_ids: If set, includes each file's id.
64
64
    :param to_file: If set, write to this file (default stdout.)
78
78
 
79
79
    if to_file is None:
80
80
        to_file = sys.stdout
81
 
    
 
81
 
82
82
    wt.lock_read()
83
83
    try:
84
84
        new_is_working_tree = True
156
156
                to_file.write("%s %s\n" % (prefix, nonexistent))
157
157
            if (new_is_working_tree and show_pending):
158
158
                show_pending_merges(new, to_file, short, verbose=verbose)
 
159
            if nonexistents:
 
160
                raise errors.PathsDoNotExist(nonexistents)
159
161
        finally:
160
162
            old.unlock()
161
163
            new.unlock()
162
 
            if nonexistents:
163
 
              raise errors.PathsDoNotExist(nonexistents)
164
164
    finally:
165
165
        wt.unlock()
166
166
 
197
197
    if len(parents) < 2:
198
198
        return
199
199
 
200
 
    # we need one extra space for terminals that wrap on last char
201
 
    term_width = osutils.terminal_width() - 1
 
200
    term_width = osutils.terminal_width()
 
201
    if term_width is not None:
 
202
        # we need one extra space for terminals that wrap on last char
 
203
        term_width = term_width - 1
202
204
    if short:
203
205
        first_prefix = 'P   '
204
206
        sub_prefix = 'P.   '
206
208
        first_prefix = '  '
207
209
        sub_prefix = '    '
208
210
 
 
211
    def show_log_message(rev, prefix):
 
212
        if term_width is None:
 
213
            width = term_width
 
214
        else:
 
215
            width = term_width - len(prefix)
 
216
        log_message = log_formatter.log_string(None, rev, width, prefix=prefix)
 
217
        to_file.write(log_message + '\n')
 
218
 
209
219
    pending = parents[1:]
210
220
    branch = new.branch
211
221
    last_revision = parents[0]
213
223
        if verbose:
214
224
            to_file.write('pending merges:\n')
215
225
        else:
216
 
            to_file.write('pending merge tips: (use -v to see all merge revisions)\n')
 
226
            to_file.write('pending merge tips:'
 
227
                          ' (use -v to see all merge revisions)\n')
217
228
    graph = branch.repository.get_graph()
218
229
    other_revisions = [last_revision]
219
230
    log_formatter = log.LineLogFormatter(to_file)
227
238
            continue
228
239
 
229
240
        # Log the merge, as it gets a slightly different formatting
230
 
        log_message = log_formatter.log_string(None, rev,
231
 
                        term_width - len(first_prefix))
232
 
        to_file.write(first_prefix + log_message + '\n')
 
241
        show_log_message(rev, first_prefix)
233
242
        if not verbose:
234
243
            continue
235
244
 
267
276
            if rev is None:
268
277
                to_file.write(sub_prefix + '(ghost) ' + sub_merge + '\n')
269
278
                continue
270
 
            log_message = log_formatter.log_string(None,
271
 
                            revisions[sub_merge],
272
 
                            term_width - len(sub_prefix))
273
 
            to_file.write(sub_prefix + log_message + '\n')
 
279
            show_log_message(revisions[sub_merge], sub_prefix)
274
280
 
275
281
 
276
282
def _filter_nonexistent(orig_paths, old_tree, new_tree):