~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf_ui.py

  • Committer: Martin
  • Date: 2010-06-22 00:32:37 UTC
  • mto: This revision was merged to the branch mainline in revision 5315.
  • Revision ID: gzlist@googlemail.com-20100622003237-zntnpyx8hjb5jnpw
Change interface of _command_line_to_argv so old tests can still be used with new stripping logic

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
 
155
155
    @classmethod
156
156
    def from_args(klass, diff_writer, revision=None, all=False, file_list=None,
157
 
                  message=None, directory=None, destroy=False):
 
157
                  message=None, directory='.', destroy=False):
158
158
        """Create a shelver from commandline arguments.
159
159
 
160
160
        The returned shelver wil have a work_tree that is locked and should
168
168
        :param destroy: Change the working tree without storing the shelved
169
169
            changes.
170
170
        """
171
 
        if directory is None:
172
 
            directory = u'.'
173
 
        elif file_list:
174
 
            file_list = [osutils.pathjoin(directory, f) for f in file_list]
175
171
        tree, path = workingtree.WorkingTree.open_containing(directory)
176
172
        # Ensure that tree is locked for the lifetime of target_tree, as
177
173
        # target tree may be reading from the same dirstate.
179
175
        try:
180
176
            target_tree = builtins._get_one_revision_tree('shelf2', revision,
181
177
                tree.branch, tree)
182
 
            files = tree.safe_relpath_files(file_list)
 
178
            files = builtins.safe_relpath_files(tree, file_list)
183
179
            return klass(tree, target_tree, diff_writer, all, all, files,
184
180
                         message, destroy)
185
181
        finally:
497
493
        tt = tree_merger.make_preview_transform()
498
494
        new_tree = tt.get_preview_tree()
499
495
        if self.write_diff_to is None:
500
 
            self.write_diff_to = ui.ui_factory.make_output_stream(encoding_type='exact')
 
496
            self.write_diff_to = ui.ui_factory.make_output_stream()
501
497
        path_encoding = osutils.get_diff_header_encoding()
502
498
        diff.show_diff_trees(merger.this_tree, new_tree, self.write_diff_to,
503
499
            path_encoding=path_encoding)