~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Added convenience function

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
                inv.add_path(path, kind, self._new_id[trans_id])
89
89
        self._tree._write_inventory(inv)
90
90
 
 
91
    def new_file(self, name, parent_id, contents, file_id=None):
 
92
        """Convenience method to create files""" 
 
93
        trans_id = self.create_path(name, parent_id)
 
94
        self.create_file(contents, trans_id)
 
95
        if file_id is not None:
 
96
            self.version_file(file_id, trans_id)
 
97
        return trans_id
 
98
 
91
99
 
92
100
class FinalPaths(object):
93
101
    def __init__(self, root, names, parents):