~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Vincent Ladeuil
  • Date: 2010-11-04 17:48:47 UTC
  • mto: This revision was merged to the branch mainline in revision 5523.
  • Revision ID: v.ladeuil+lp@free.fr-20101104174847-x3io00xsknnikaka
Handle --directory when paths are also provided to shelve and restore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5894
5894
            location = "."
5895
5895
        branch = Branch.open_containing(location)[0]
5896
5896
        branch.bzrdir.destroy_branch()
5897
 
        
 
5897
 
5898
5898
 
5899
5899
class cmd_shelve(Command):
5900
5900
    __doc__ = """Temporarily set aside some changes from the current tree.
5951
5951
    _see_also = ['unshelve', 'configuration']
5952
5952
 
5953
5953
    def run(self, revision=None, all=False, file_list=None, message=None,
5954
 
            writer=None, list=False, destroy=False, directory=u'.'):
 
5954
            writer=None, list=False, destroy=False, directory=None):
5955
5955
        if list:
5956
 
            return self.run_for_list()
 
5956
            return self.run_for_list(directory=directory)
5957
5957
        from bzrlib.shelf_ui import Shelver
5958
5958
        if writer is None:
5959
5959
            writer = bzrlib.option.diff_writer_registry.get()
5967
5967
        except errors.UserAbort:
5968
5968
            return 0
5969
5969
 
5970
 
    def run_for_list(self):
5971
 
        tree = WorkingTree.open_containing('.')[0]
 
5970
    def run_for_list(self, directory=None):
 
5971
        if directory is None:
 
5972
            directory = u'.'
 
5973
        tree = WorkingTree.open_containing(directory)[0]
5972
5974
        self.add_cleanup(tree.lock_read().unlock)
5973
5975
        manager = tree.get_shelf_manager()
5974
5976
        shelves = manager.active_shelves()