~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: abentley
  • Date: 2006-04-20 23:47:53 UTC
  • mfrom: (1681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: abentley@lappy-20060420234753-6a6874b76f09f86d
Merge 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: