/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

Merge from bzr.dev, resolving the worst of the semantic conflicts, but there's
still a little bit of breakage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
_deprecation_warning_done = False
61
61
 
62
62
 
 
63
######################################################################
 
64
# Repositories
 
65
 
63
66
class Repository(object):
64
67
    """Repository holding history for one or more branches.
65
68
 
948
951
 
949
952
for _name in [
950
953
        'KnitRepository',
951
 
        'KnitRepository2',
952
954
        'RepositoryFormatKnit',
953
955
        'RepositoryFormatKnit1',
954
 
        'RepositoryFormatKnit2',
955
956
        ]:
956
957
    __make_delegated(_name, 'bzrlib.repofmt.knitrepo')
957
958
 
1064
1065
"""
1065
1066
 
1066
1067
 
 
1068
#####################################################################
 
1069
# Repository Formats
 
1070
 
1067
1071
class RepositoryFormat(object):
1068
1072
    """A repository format.
1069
1073
 
1095
1099
        # format objects are generally stateless
1096
1100
        return isinstance(other, self.__class__)
1097
1101
 
 
1102
    def __ne__(self, other):
 
1103
        return not self == other
 
1104
 
1098
1105
    @classmethod
1099
1106
    def find_format(klass, a_bzrdir):
1100
1107
        """Return the format for the repository object in a_bzrdir.
1161
1168
        from bzrlib.store.revision.text import TextRevisionStore
1162
1169
        dir_mode = control_files._dir_mode
1163
1170
        file_mode = control_files._file_mode
1164
 
        text_store =TextStore(transport.clone(name),
 
1171
        text_store = TextStore(transport.clone(name),
1165
1172
                              prefixed=prefixed,
1166
1173
                              compressed=compressed,
1167
1174
                              dir_mode=dir_mode,
1281
1288
format_registry.default_key = 'Bazaar-NG Knit Repository Format 1'
1282
1289
 
1283
1290
format_registry.register_lazy(
1284
 
    'Bazaar Knit Repository Format 2\n',
 
1291
    'Bazaar Knit Repository Format 3 (bzr 0.15)\n',
1285
1292
    'bzrlib.repofmt.knitrepo',
1286
 
    'RepositoryFormatKnit2',
 
1293
    'RepositoryFormatKnit3',
1287
1294
    )
1288
1295
 
1289
1296
 
1360
1367
 
1361
1368
    @staticmethod
1362
1369
    def is_compatible(source, target):
1363
 
        if source.supports_rich_root() == target.supports_rich_root():
1364
 
            return True
1365
 
        else:
1366
 
            return False
 
1370
        if source.supports_rich_root() != target.supports_rich_root():
 
1371
            return False
 
1372
        if source._serializer != target._serializer:
 
1373
            return False
 
1374
        return True
1367
1375
 
1368
1376
    @needs_write_lock
1369
1377
    def copy_content(self, revision_id=None, basis=None):
1665
1673
 
1666
1674
    @staticmethod
1667
1675
    def is_compatible(source, target):
1668
 
        """Be compatible with Knit1 source and Knit2 target"""
1669
 
        from bzrlib.repofmt.knitrepo import RepositoryFormatKnit2
 
1676
        """Be compatible with Knit1 source and Knit3 target"""
 
1677
        from bzrlib.repofmt.knitrepo import RepositoryFormatKnit3
1670
1678
        try:
1671
1679
            from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1, \
1672
 
                    RepositoryFormatKnit2
 
1680
                    RepositoryFormatKnit3
1673
1681
            return (isinstance(source._format, (RepositoryFormatKnit1)) and
1674
 
                    isinstance(target._format, (RepositoryFormatKnit2)))
 
1682
                    isinstance(target._format, (RepositoryFormatKnit3)))
1675
1683
        except AttributeError:
1676
1684
            return False
1677
1685
 
1785
1793
        # here.
1786
1794
        result.append((InterModel1and2,
1787
1795
                       weaverepo.RepositoryFormat5(),
1788
 
                       knitrepo.RepositoryFormatKnit2()))
 
1796
                       knitrepo.RepositoryFormatKnit3()))
1789
1797
        result.append((InterKnit1and2,
1790
1798
                       knitrepo.RepositoryFormatKnit1(),
1791
 
                       knitrepo.RepositoryFormatKnit2()))
 
1799
                       knitrepo.RepositoryFormatKnit3()))
1792
1800
        return result
1793
1801
 
1794
1802
 
2003
2011
        :param file_parents: The per-file parent revision ids.
2004
2012
        """
2005
2013
        self._add_text_to_weave(file_id, [], file_parents.keys())
 
2014
 
 
2015
    def modified_reference(self, file_id, file_parents):
 
2016
        """Record the modification of a reference.
 
2017
 
 
2018
        :param file_id: The file_id of the link to record.
 
2019
        :param file_parents: The per-file parent revision ids.
 
2020
        """
 
2021
        self._add_text_to_weave(file_id, [], file_parents.keys())
2006
2022
    
2007
2023
    def modified_file_text(self, file_id, file_parents,
2008
2024
                           get_content_byte_lines, text_sha1=None,