~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Alexander Belchenko
  • Date: 2009-08-27 07:30:31 UTC
  • mto: (4595.14.1 1.18)
  • mto: This revision was merged to the branch mainline in revision 4660.
  • Revision ID: bialix@ukr.net-20090827073031-dgm9i4kx8610p8tq
[cherrypick revno 4650 from bzr.dev] 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:
5627
5636
        if writer is None:
5628
5637
            writer = bzrlib.option.diff_writer_registry.get()
5629
5638
        try:
5630
 
            Shelver.from_args(writer(sys.stdout), revision, all, file_list,
5631
 
                              message, destroy=destroy).run()
 
5639
            shelver = Shelver.from_args(writer(sys.stdout), revision, all,
 
5640
                file_list, message, destroy=destroy)
 
5641
            try:
 
5642
                shelver.run()
 
5643
            finally:
 
5644
                shelver.work_tree.unlock()
5632
5645
        except errors.UserAbort:
5633
5646
            return 0
5634
5647
 
5673
5686
 
5674
5687
    def run(self, shelf_id=None, action='apply'):
5675
5688
        from bzrlib.shelf_ui import Unshelver
5676
 
        Unshelver.from_args(shelf_id, action).run()
 
5689
        unshelver = Unshelver.from_args(shelf_id, action)
 
5690
        try:
 
5691
            unshelver.run()
 
5692
        finally:
 
5693
            unshelver.tree.unlock()
5677
5694
 
5678
5695
 
5679
5696
class cmd_clean_tree(Command):