~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf_ui.py

  • Committer: Aaron Bentley
  • Date: 2009-10-23 02:39:47 UTC
  • mto: (4603.1.22 shelve-editor)
  • mto: This revision was merged to the branch mainline in revision 4795.
  • Revision ID: aaron@aaronbentley.com-20091023023947-296teofaeaenstbt
Fix shelf_ui tests to finalize.

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
        :param manager: The shelf manager to use.
134
134
        :param reporter: Object for reporting changes to user.
135
135
        """
 
136
        work_tree.lock_tree_write()
136
137
        self.work_tree = work_tree
137
138
        self.target_tree = target_tree
138
139
        self.diff_writer = diff_writer
176
177
            target_tree = builtins._get_one_revision_tree('shelf2', revision,
177
178
                tree.branch, tree)
178
179
            files = builtins.safe_relpath_files(tree, file_list)
179
 
        except:
 
180
            return klass(tree, target_tree, diff_writer, all, all, files,
 
181
                         message, destroy)
 
182
        finally:
180
183
            tree.unlock()
181
 
            raise
182
 
        return klass(tree, target_tree, diff_writer, all, all, files, message,
183
 
                     destroy)
184
184
 
185
185
    def run(self):
186
186
        """Interactively shelve the changes."""
220
220
            creator.finalize()
221
221
 
222
222
    def finalize(self):
223
 
        self.change_editor.finish()
 
223
        if self.change_editor is not None:
 
224
            self.change_editor.finish()
224
225
        self.work_tree.unlock()
225
226
 
226
227