~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-11-05 08:35:39 UTC
  • mfrom: (5521.1.2 670851-directory-and-files)
  • Revision ID: pqm@pqm.ubuntu.com-20101105083539-urkk2to9qakthagn
(vila) Respect --directory when path parameters are also used for shelve and
 restore (Vincent Ladeuil)

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()