~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: 2010-09-20 14:57:31 UTC
  • mfrom: (5434.1.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20100920145731-g0nb7fth1nrppoxf
(vila) Re-open bzr.dev for dev as 2.3.0dev2 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
398
398
            (2, 3), None))
399
399
 
400
400
 
 
401
hooks = StatusHooks()
 
402
 
 
403
 
401
404
class StatusHookParams(object):
402
405
    """Object holding parameters passed to post_status hooks.
403
406
 
438
441
            self.old_tree, self.new_tree, self.to_file, self.versioned,
439
442
            self.show_ids, self.short, self.verbose)
440
443
 
441
 
 
442
 
def _show_shelve_summary(params):
443
 
    """post_status hook to display a summary of shelves.
444
 
 
445
 
    :param params: StatusHookParams.
446
 
    """
447
 
    get_shelf_manager = getattr(params.new_tree, 'get_shelf_manager', None)
448
 
    if get_shelf_manager is None:
449
 
        return
450
 
    manager = get_shelf_manager()
451
 
    shelves = manager.active_shelves()
452
 
    if shelves:
453
 
        params.to_file.write('%d shelves exist. '
454
 
            'See "bzr shelve --list" for details.\n' % len(shelves))
455
 
 
456
 
 
457
 
hooks = StatusHooks()
458
 
 
459
 
 
460
 
hooks.install_named_hook('post_status', _show_shelve_summary,
461
 
    'bzr status')
462