~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: 2009-08-25 23:37:34 UTC
  • mfrom: (4648.1.2 shelve-locks)
  • Revision ID: pqm@pqm.ubuntu.com-20090825233734-ozgeetbq9aagneer
Fix shelve on windows. (Robert Collins, #305006)

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
 
121
121
 
122
122
def _get_one_revision_tree(command_name, revisions, branch=None, tree=None):
 
123
    """Get a revision tree. Not suitable for commands that change the tree.
 
124
    
 
125
    Specifically, the basis tree in dirstate trees is coupled to the dirstate
 
126
    and doing a commit/uncommit/pull will at best fail due to changing the
 
127
    basis revision data.
 
128
 
 
129
    If tree is passed in, it should be already locked, for lifetime management
 
130
    of the trees internal cached state.
 
131
    """
123
132
    if branch is None:
124
133
        branch = tree.branch
125
134
    if revisions is None:
5634
5643
        if writer is None:
5635
5644
            writer = bzrlib.option.diff_writer_registry.get()
5636
5645
        try:
5637
 
            Shelver.from_args(writer(sys.stdout), revision, all, file_list,
5638
 
                              message, destroy=destroy).run()
 
5646
            shelver = Shelver.from_args(writer(sys.stdout), revision, all,
 
5647
                file_list, message, destroy=destroy)
 
5648
            try:
 
5649
                shelver.run()
 
5650
            finally:
 
5651
                shelver.work_tree.unlock()
5639
5652
        except errors.UserAbort:
5640
5653
            return 0
5641
5654
 
5680
5693
 
5681
5694
    def run(self, shelf_id=None, action='apply'):
5682
5695
        from bzrlib.shelf_ui import Unshelver
5683
 
        Unshelver.from_args(shelf_id, action).run()
 
5696
        unshelver = Unshelver.from_args(shelf_id, action)
 
5697
        try:
 
5698
            unshelver.run()
 
5699
        finally:
 
5700
            unshelver.tree.unlock()
5684
5701
 
5685
5702
 
5686
5703
class cmd_clean_tree(Command):