/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 breezy/plugins/fastimport/revision_store.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-12 20:07:32 UTC
  • mto: This revision was merged to the branch mainline in revision 6819.
  • Revision ID: jelmer@jelmer.uk-20171112200732-ehxgen03s9jphe8n
Swap arguments for get_symlink_target and kind/stored_kind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
                                                        'unordered', True)
86
86
            return stream.next().get_bytes_as('fulltext')
87
87
 
88
 
    def get_symlink_target(self, file_id):
 
88
    def get_symlink_target(self, path, file_id=None):
 
89
        if file_id is None:
 
90
            file_id = self.path2id(path)
89
91
        if file_id in self._new_info_by_id:
90
92
            ie = self._new_info_by_id[file_id][1]
91
93
            return ie.symlink_target
224
226
    def get_file_text(self, revision_id, file_id):
225
227
        """Get the text stored for a file in a given revision."""
226
228
        revtree = self.repo.revision_tree(revision_id)
227
 
        return revtree.get_file_text(file_id)
 
229
        path = revtree.id2path(file_id)
 
230
        return revtree.get_file_text(path, file_id)
228
231
 
229
232
    def get_file_lines(self, revision_id, file_id):
230
233
        """Get the lines stored for a file in a given revision."""
231
234
        revtree = self.repo.revision_tree(revision_id)
232
 
        return osutils.split_lines(revtree.get_file_text(file_id))
 
235
        path = revtree.id2path(file_id)
 
236
        return osutils.split_lines(revtree.get_file_text(path, file_id))
233
237
 
234
238
    def start_new_revision(self, revision, parents, parent_invs):
235
239
        """Init the metadata needed for get_parents_and_revision_for_entry().