~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Martin Packman
  • Date: 2012-01-05 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
import sys
18
20
 
19
21
from bzrlib import (
157
159
        try:
158
160
            for hook in hooks['pre_status']:
159
161
                hook(StatusHookParams(old, new, to_file, versioned,
160
 
                    show_ids, short, verbose))
 
162
                    show_ids, short, verbose, specific_files=specific_files))
161
163
 
162
164
            specific_files, nonexistents \
163
165
                = _filter_nonexistent(specific_files, old, new)
222
224
                raise errors.PathsDoNotExist(nonexistents)
223
225
            for hook in hooks['post_status']:
224
226
                hook(StatusHookParams(old, new, to_file, versioned,
225
 
                    show_ids, short, verbose))
 
227
                    show_ids, short, verbose, specific_files=specific_files))
226
228
        finally:
227
229
            old.unlock()
228
230
            new.unlock()
416
418
    """
417
419
 
418
420
    def __init__(self, old_tree, new_tree, to_file, versioned, show_ids,
419
 
            short, verbose):
 
421
            short, verbose, specific_files=None):
420
422
        """Create a group of post_status hook parameters.
421
423
 
422
424
        :param old_tree: Start tree (basis tree) for comparison.
426
428
        :param show_ids: Show internal object ids.
427
429
        :param short: Use short status indicators.
428
430
        :param verbose: Verbose flag.
 
431
        :param specific_files: If set, a list of filenames whose status should be
 
432
            shown.  It is an error to give a filename that is not in the working
 
433
            tree, or in the working inventory or in the basis inventory.
429
434
        """
430
435
        self.old_tree = old_tree
431
436
        self.new_tree = new_tree
434
439
        self.show_ids = show_ids
435
440
        self.short = short
436
441
        self.verbose = verbose
 
442
        self.specific_files = specific_files
437
443
 
438
444
    def __eq__(self, other):
439
445
        return self.__dict__ == other.__dict__
440
446
 
441
447
    def __repr__(self):
442
 
        return "<%s(%s, %s, %s, %s, %s, %s, %s)>" % (self.__class__.__name__,
 
448
        return "<%s(%s, %s, %s, %s, %s, %s, %s, %s)>" % (self.__class__.__name__,
443
449
            self.old_tree, self.new_tree, self.to_file, self.versioned,
444
 
            self.show_ids, self.short, self.verbose)
 
450
            self.show_ids, self.short, self.verbose, self.specific_files)
445
451
 
446
452
 
447
453
def _show_shelve_summary(params):
449
455
 
450
456
    :param params: StatusHookParams.
451
457
    """
 
458
    # Don't show shelves if status of specific files is being shown, only if
 
459
    # no file arguments have been passed
 
460
    if params.specific_files:
 
461
        return
452
462
    get_shelf_manager = getattr(params.new_tree, 'get_shelf_manager', None)
453
463
    if get_shelf_manager is None:
454
464
        return