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

  • Committer: Robert Collins
  • Date: 2007-09-12 04:21:51 UTC
  • mto: This revision was merged to the branch mainline in revision 2817.
  • Revision ID: robertc@robertcollins.net-20070912042151-o2k78pnf1hdwd2xt
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        inv_vf = self.control_weaves.get_weave('inventory',
126
126
                                               self.get_transaction())
127
127
        self._inventory_add_lines(inv_vf, revision_id, parents,
128
 
                                  osutils.split_lines(inv_text))
 
128
            osutils.split_lines(inv_text), check_content=False)
129
129
        return inv_sha1
130
130
 
131
 
    def _inventory_add_lines(self, inv_vf, revision_id, parents, lines):
 
131
    def _inventory_add_lines(self, inv_vf, revision_id, parents, lines,
 
132
        check_content=True):
132
133
        final_parents = []
133
134
        for parent in parents:
134
135
            if parent in inv_vf:
135
136
                final_parents.append(parent)
136
 
 
137
 
        inv_vf.add_lines(revision_id, final_parents, lines)
 
137
        inv_vf.add_lines(revision_id, final_parents, lines,
 
138
            check_content=check_content)
138
139
 
139
140
    @needs_write_lock
140
141
    def add_revision(self, revision_id, rev, inv=None, config=None):
2303
2304
        # Don't change this to add_lines - add_lines_with_ghosts is cheaper
2304
2305
        # than add_lines, and allows committing when a parent is ghosted for
2305
2306
        # some reason.
 
2307
        # Note: as we read the content directly from the tree, we know its not
 
2308
        # been turned into unicode or badly split - but a broken tree
 
2309
        # implementation could give us bad output from readlines() so this is
 
2310
        # not a guarantee of safety. What would be better is always checking
 
2311
        # the content during test suite execution. RBC 20070912
2306
2312
        result = versionedfile.add_lines_with_ghosts(
2307
2313
            self._new_revision_id, parents, new_lines,
2308
 
            random_id=self.random_revid)[0:2]
 
2314
            random_id=self.random_revid, check_content=False)[0:2]
2309
2315
        versionedfile.clear_cache()
2310
2316
        return result
2311
2317