~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-07 10:45:44 UTC
  • mfrom: (2321.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070307104544-59e3e6358e4bdb29
(robertc) Merge dirstate and subtrees. (Robert Collins, Martin Pool, Aaaron Bentley, John A Meinel, James Westby)

Show diffs side-by-side

added added

removed removed

Lines of Context:
923
923
 
924
924
for _name in [
925
925
        'KnitRepository',
926
 
        'KnitRepository2',
927
926
        'RepositoryFormatKnit',
928
927
        'RepositoryFormatKnit1',
929
 
        'RepositoryFormatKnit2',
930
928
        ]:
931
929
    __make_delegated(_name, 'bzrlib.repofmt.knitrepo')
932
930
 
1073
1071
        # format objects are generally stateless
1074
1072
        return isinstance(other, self.__class__)
1075
1073
 
 
1074
    def __ne__(self, other):
 
1075
        return not self == other
 
1076
 
1076
1077
    @classmethod
1077
1078
    def find_format(klass, a_bzrdir):
1078
1079
        """Return the format for the repository object in a_bzrdir.
1257
1258
format_registry.default_key = 'Bazaar-NG Knit Repository Format 1'
1258
1259
 
1259
1260
format_registry.register_lazy(
1260
 
    'Bazaar Knit Repository Format 2\n',
 
1261
    'Bazaar Knit Repository Format 3 (bzr 0.15)\n',
1261
1262
    'bzrlib.repofmt.knitrepo',
1262
 
    'RepositoryFormatKnit2',
 
1263
    'RepositoryFormatKnit3',
1263
1264
    )
1264
1265
 
1265
1266
 
1340
1341
            return False
1341
1342
        if not isinstance(target, Repository):
1342
1343
            return False
1343
 
        if source._format.rich_root_data == target._format.rich_root_data:
1344
 
            return True
 
1344
        if source._format.rich_root_data != target._format.rich_root_data:
 
1345
            return False
 
1346
        if source._serializer != target._serializer:
 
1347
            return False
1345
1348
        else:
1346
 
            return False
 
1349
            return True 
1347
1350
 
1348
1351
    @needs_write_lock
1349
1352
    def copy_content(self, revision_id=None, basis=None):
1649
1652
 
1650
1653
    @staticmethod
1651
1654
    def is_compatible(source, target):
1652
 
        """Be compatible with Knit1 source and Knit2 target"""
1653
 
        from bzrlib.repofmt.knitrepo import RepositoryFormatKnit2
 
1655
        """Be compatible with Knit1 source and Knit3 target"""
 
1656
        from bzrlib.repofmt.knitrepo import RepositoryFormatKnit3
1654
1657
        try:
1655
1658
            from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1, \
1656
 
                    RepositoryFormatKnit2
 
1659
                    RepositoryFormatKnit3
1657
1660
            return (isinstance(source._format, (RepositoryFormatKnit1)) and
1658
 
                    isinstance(target._format, (RepositoryFormatKnit2)))
 
1661
                    isinstance(target._format, (RepositoryFormatKnit3)))
1659
1662
        except AttributeError:
1660
1663
            return False
1661
1664
 
1765
1768
        # here.
1766
1769
        result.append((InterModel1and2,
1767
1770
                       weaverepo.RepositoryFormat5(),
1768
 
                       knitrepo.RepositoryFormatKnit2()))
 
1771
                       knitrepo.RepositoryFormatKnit3()))
1769
1772
        result.append((InterKnit1and2,
1770
1773
                       knitrepo.RepositoryFormatKnit1(),
1771
 
                       knitrepo.RepositoryFormatKnit2()))
 
1774
                       knitrepo.RepositoryFormatKnit3()))
1772
1775
        return result
1773
1776
 
1774
1777
 
1983
1986
        :param file_parents: The per-file parent revision ids.
1984
1987
        """
1985
1988
        self._add_text_to_weave(file_id, [], file_parents.keys())
 
1989
 
 
1990
    def modified_reference(self, file_id, file_parents):
 
1991
        """Record the modification of a reference.
 
1992
 
 
1993
        :param file_id: The file_id of the link to record.
 
1994
        :param file_parents: The per-file parent revision ids.
 
1995
        """
 
1996
        self._add_text_to_weave(file_id, [], file_parents.keys())
1986
1997
    
1987
1998
    def modified_file_text(self, file_id, file_parents,
1988
1999
                           get_content_byte_lines, text_sha1=None,