~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: 2008-09-29 05:42:34 UTC
  • mfrom: (3737.2.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080929054234-s2ajcaxxm75errlz
(jam) Fix 'bzr revert' on win32 by taking a write lock out earlier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3263
3263
    def run(self, revision=None, no_backup=False, file_list=None,
3264
3264
            forget_merges=None):
3265
3265
        tree, file_list = tree_files(file_list)
3266
 
        if forget_merges:
3267
 
            tree.set_parent_ids(tree.get_parent_ids()[:1])
3268
 
        else:
3269
 
            self._revert_tree_to_revision(tree, revision, file_list, no_backup)
 
3266
        tree.lock_write()
 
3267
        try:
 
3268
            if forget_merges:
 
3269
                tree.set_parent_ids(tree.get_parent_ids()[:1])
 
3270
            else:
 
3271
                self._revert_tree_to_revision(tree, revision, file_list, no_backup)
 
3272
        finally:
 
3273
            tree.unlock()
3270
3274
 
3271
3275
    @staticmethod
3272
3276
    def _revert_tree_to_revision(tree, revision, file_list, no_backup):