~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2008-11-15 20:37:36 UTC
  • mto: This revision was merged to the branch mainline in revision 3838.
  • Revision ID: aaron@aaronbentley.com-20081115203736-6ikutv274y59s0jo
Shelf supports multiple diff writers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4757
4757
        'revision',
4758
4758
        Option('all', help='Shelve all changes.'),
4759
4759
        'message',
 
4760
        RegistryOption('writer', 'Method to use for writing diffs.',
 
4761
                       bzrlib.option.diff_writer_registry,
 
4762
                       value_switches=True, enum_switch=False)
4760
4763
    ]
4761
4764
    _see_also = ['unshelve']
4762
4765
 
4763
 
    def run(self, revision=None, all=False, file_list=None, message=None):
 
4766
    def run(self, revision=None, all=False, file_list=None, message=None,
 
4767
            writer=None):
4764
4768
        from bzrlib.shelf_ui import Shelver
 
4769
        if writer is None:
 
4770
            writer = bzrlib.option.diff_writer_registry.get()
4765
4771
        try:
4766
 
            Shelver.from_args(revision, all, file_list, message).run()
 
4772
            Shelver.from_args(writer(sys.stdout), revision, all, file_list,
 
4773
                              message).run()
4767
4774
        except errors.UserAbort:
4768
4775
            return 0
4769
4776