/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: 2008-10-27 06:14:45 UTC
  • mfrom: (3793 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3795.
  • Revision ID: andrew.bennetts@canonical.com-20081027061445-eqt9lz6uw1mbvq4g
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    tsort,
25
25
    revision as _mod_revision,
26
26
    )
27
 
from bzrlib.diff import _raise_if_nonexistent
28
27
import bzrlib.errors as errors
29
28
from bzrlib.osutils import is_inside_any
30
29
from bzrlib.symbol_versioning import (deprecated_function,
31
30
        )
32
 
from bzrlib.trace import warning
 
31
from bzrlib.trace import mutter, warning
33
32
 
34
33
# TODO: when showing single-line logs, truncate to the width of the terminal
35
34
# if known, but only if really going to the terminal (not into a file)
87
86
            old = new.basis_tree()
88
87
        elif len(revision) > 0:
89
88
            try:
90
 
                rev_id = revision[0].as_revision_id(wt.branch)
91
 
                old = wt.branch.repository.revision_tree(rev_id)
 
89
                old = revision[0].as_tree(wt.branch)
92
90
            except errors.NoSuchRevision, e:
93
91
                raise errors.BzrCommandError(str(e))
94
92
            if (len(revision) > 1) and (revision[1].spec is not None):
95
93
                try:
96
 
                    rev_id = revision[1].as_revision_id(wt.branch)
97
 
                    new = wt.branch.repository.revision_tree(rev_id)
 
94
                    new = revision[1].as_tree(wt.branch)
98
95
                    new_is_working_tree = False
99
96
                except errors.NoSuchRevision, e:
100
97
                    raise errors.BzrCommandError(str(e))
246
243
                            revisions[sub_merge],
247
244
                            term_width - len(sub_prefix))
248
245
            to_file.write(sub_prefix + log_message + '\n')
 
246
 
 
247
 
 
248
def _raise_if_nonexistent(paths, old_tree, new_tree):
 
249
    """Complain if paths are not in either inventory or tree.
 
250
 
 
251
    It's OK with the files exist in either tree's inventory, or 
 
252
    if they exist in the tree but are not versioned.
 
253
    
 
254
    This can be used by operations such as bzr status that can accept
 
255
    unknown or ignored files.
 
256
    """
 
257
    mutter("check paths: %r", paths)
 
258
    if not paths:
 
259
        return
 
260
    s = old_tree.filter_unversioned_files(paths)
 
261
    s = new_tree.filter_unversioned_files(s)
 
262
    s = [path for path in s if not new_tree.has_filename(path)]
 
263
    if s:
 
264
        raise errors.PathsDoNotExist(sorted(s))
 
265
 
 
266