~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-18 23:18:12 UTC
  • mto: (4603.1.22 shelve-editor)
  • mto: This revision was merged to the branch mainline in revision 4795.
  • Revision ID: aaron@aaronbentley.com-20091018231812-8223ozmegpkoohip
Make change editor mandatory

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        if reporter is None:
150
150
            reporter = ShelfReporter()
151
151
        self.reporter = reporter
152
 
        self.change_editor = None
 
152
        config = self.work_tree.branch.get_config()
 
153
        self.change_editor = config.get_change_editor(target_tree, work_tree)
153
154
 
154
155
    @classmethod
155
156
    def from_args(klass, diff_writer, revision=None, all=False, file_list=None,
181
182
        return klass(tree, target_tree, diff_writer, all, all, files, message,
182
183
                     destroy)
183
184
 
184
 
    def set_change_editor(self):
185
 
        config = self.work_tree.branch.get_config()
186
 
        self.change_editor = config.get_change_editor(self.target_tree,
187
 
                                                      self.work_tree)
188
 
 
189
185
    def run(self):
190
186
        """Interactively shelve the changes."""
191
187
        creator = shelf.ShelfCreator(self.work_tree, self.target_tree,
224
220
            creator.finalize()
225
221
 
226
222
    def finalize(self):
227
 
        if self.change_editor is not None:
228
 
            self.change_editor.finish()
 
223
        self.change_editor.finish()
 
224
        self.work_tree.unlock()
 
225
 
229
226
 
230
227
    def get_parsed_patch(self, file_id, invert=False):
231
228
        """Return a parsed version of a file's patch.