/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2009-08-25 23:47:08 UTC
  • mfrom: (4650 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4651.
  • Revision ID: robertc@robertcollins.net-20090825234708-utgl9u6v12sosp5c
NEWS Conflict.

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:
5638
5647
        if writer is None:
5639
5648
            writer = bzrlib.option.diff_writer_registry.get()
5640
5649
        try:
5641
 
            Shelver.from_args(writer(sys.stdout), revision, all, file_list,
5642
 
                              message, destroy=destroy).run()
 
5650
            shelver = Shelver.from_args(writer(sys.stdout), revision, all,
 
5651
                file_list, message, destroy=destroy)
 
5652
            try:
 
5653
                shelver.run()
 
5654
            finally:
 
5655
                shelver.work_tree.unlock()
5643
5656
        except errors.UserAbort:
5644
5657
            return 0
5645
5658
 
5684
5697
 
5685
5698
    def run(self, shelf_id=None, action='apply'):
5686
5699
        from bzrlib.shelf_ui import Unshelver
5687
 
        Unshelver.from_args(shelf_id, action).run()
 
5700
        unshelver = Unshelver.from_args(shelf_id, action)
 
5701
        try:
 
5702
            unshelver.run()
 
5703
        finally:
 
5704
            unshelver.tree.unlock()
5688
5705
 
5689
5706
 
5690
5707
class cmd_clean_tree(Command):