/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/transform.py

Add new_file(sha1=XXX) and pass that down to create_file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
755
755
        return trans_id
756
756
 
757
757
    def new_file(self, name, parent_id, contents, file_id=None,
758
 
                 executable=None):
 
758
                 executable=None, sha1=None):
759
759
        """Convenience method to create files.
760
760
 
761
761
        name is the name of the file to create.
768
768
        trans_id = self._new_entry(name, parent_id, file_id)
769
769
        # TODO: rather than scheduling a set_executable call,
770
770
        # have create_file create the file with the right mode.
771
 
        self.create_file(contents, trans_id)
 
771
        self.create_file(contents, trans_id, sha1=sha1)
772
772
        if executable is not None:
773
773
            self.set_executability(executable, trans_id)
774
774
        return trans_id