~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Robert Collins
  • Date: 2006-03-07 12:17:32 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060307121732-1a219b872ef18ecc
cleanup deprecation warnings and finish conversion so the inventory is knit based too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
 
356
356
        w = self.get_inventory_weave()
357
357
        file_ids = set()
358
 
        for line in w._weave:
359
 
 
360
 
            # it is ugly, but it is due to the weave structure
361
 
            if not isinstance(line, basestring): continue
362
 
 
 
358
 
 
359
        for lineno, insert, deletes, line in w.walk(changes):
363
360
            start = line.find('file_id="')+9
364
361
            if start < 9: continue
365
362
            end = line.find('"', start)
977
974
        control_files = LockableFiles(repository_transport, 'lock')
978
975
        return control_files
979
976
 
980
 
    def _get_control_store(self, repo_transport, control_files):
981
 
        """Return the control store for this repository."""
982
 
        return self._get_versioned_file_store('',
983
 
                                              repo_transport,
984
 
                                              control_files,
985
 
                                              prefixed=False)
986
 
 
987
977
    def _upload_blank_content(self, a_bzrdir, dirs, files, utf8_files, shared):
988
978
        """Upload the initial blank content."""
989
979
        control_files = self._create_control_files(a_bzrdir)
1013
1003
     - an optional 'no-working-trees' flag
1014
1004
    """
1015
1005
 
 
1006
    def _get_control_store(self, repo_transport, control_files):
 
1007
        """Return the control store for this repository."""
 
1008
        return self._get_versioned_file_store('',
 
1009
                                              repo_transport,
 
1010
                                              control_files,
 
1011
                                              prefixed=False)
 
1012
 
1016
1013
    def get_format_string(self):
1017
1014
        """See RepositoryFormat.get_format_string()."""
1018
1015
        return "Bazaar-NG Repository format 7"
1094
1091
     - an optional 'no-working-trees' flag
1095
1092
    """
1096
1093
 
 
1094
    def _get_control_store(self, repo_transport, control_files):
 
1095
        """Return the control store for this repository."""
 
1096
        return self._get_versioned_file_store('',
 
1097
                                              repo_transport,
 
1098
                                              control_files,
 
1099
                                              prefixed=False,
 
1100
                                              versionedfile_class=KnitVersionedFile)
 
1101
 
1097
1102
    def get_format_string(self):
1098
1103
        """See RepositoryFormat.get_format_string()."""
1099
1104
        return "Bazaar-NG Knit Repository Format 1"
1102
1107
        """See RepositoryFormat._get_revision_store()."""
1103
1108
        from bzrlib.store.revision.knit import KnitRevisionStore
1104
1109
        versioned_file_store = VersionedFileStore(
1105
 
            repo_transport.clone('revision-store'),
 
1110
            repo_transport,
1106
1111
            file_mode = control_files._file_mode,
1107
1112
            prefixed=False,
1108
1113
            precious=True,
1142
1147
        repo_transport = a_bzrdir.get_repository_transport(None)
1143
1148
        control_files = LockableFiles(repo_transport, 'lock')
1144
1149
        control_store = self._get_control_store(repo_transport, control_files)
 
1150
        transaction = bzrlib.transactions.PassThroughTransaction()
1145
1151
        # trigger a write of the inventory store.
1146
 
        control_store.get_weave_or_empty('inventory',
1147
 
            bzrlib.transactions.PassThroughTransaction())
 
1152
        control_store.get_weave_or_empty('inventory', transaction)
 
1153
        _revision_store = self._get_revision_store(repo_transport, control_files)
 
1154
        _revision_store.has_revision_id('A', transaction)
 
1155
        _revision_store.get_signature_file(transaction)
1148
1156
        return self.open(a_bzrdir=a_bzrdir, _found=True)
1149
1157
 
1150
1158
    def open(self, a_bzrdir, _found=False, _override_transport=None):