~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-13 12:01:34 UTC
  • mfrom: (2318.2.4 bzr.kg)
  • Revision ID: pqm@pqm.ubuntu.com-20070313120134-ddd44b75e5a2639c
Add support for status --versioned

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 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
81
81
                     to_file=None,
82
82
                     show_pending=True,
83
83
                     revision=None,
84
 
                     short=False):
 
84
                     short=False,
 
85
                     versioned=False):
85
86
    """Display summary of changes.
86
87
 
87
88
    By default this compares the working tree to a previous revision. 
106
107
        If not None it must be a RevisionSpec list.
107
108
        If one revision show compared it with working tree.
108
109
        If two revisions show status between first and second.
109
 
    :param short: If True, gives short SVN-style status lines
 
110
    :param short: If True, gives short SVN-style status lines.
 
111
    :param versioned: If True, only shows versioned files.
110
112
    """
111
113
    if show_unchanged is not None:
112
114
        warn("show_status_trees with show_unchanged has been deprecated "
142
144
        new.lock_read()
143
145
        try:
144
146
            _raise_if_nonexistent(specific_files, old, new)
 
147
            want_unversioned = not versioned
145
148
            if short:
146
149
                changes = new._iter_changes(old, show_unchanged, specific_files,
147
 
                    require_versioned=False, want_unversioned=True)
 
150
                    require_versioned=False, want_unversioned=want_unversioned)
148
151
                reporter = _mod_delta._ChangeReporter(output_file=to_file,
149
152
                    unversioned_filter=new.is_ignored)
150
153
                _mod_delta.report_changes(changes, reporter)
151
154
            else:
152
155
                delta = new.changes_from(old, want_unchanged=show_unchanged,
153
156
                                      specific_files=specific_files,
154
 
                                      want_unversioned=True)
 
157
                                      want_unversioned=want_unversioned)
155
158
                # filter out unknown files. We may want a tree method for
156
159
                # this
157
160
                delta.unversioned = [unversioned for unversioned in