~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-27 01:14:33 UTC
  • mfrom: (1686.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060427011433-95634ee1da8a2049
Merge in faster joins from weave to knit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
977
977
        if not other.versions():
978
978
            return          # nothing to update, easy
979
979
 
980
 
        if version_ids:
981
 
            for version_id in version_ids:
982
 
                if not other.has_version(version_id) and not ignore_missing:
983
 
                    raise RevisionNotPresent(version_id, self._weave_name)
984
 
        else:
985
 
            version_ids = other.versions()
 
980
        if not version_ids:
 
981
            # versions is never none, InterWeave checks this.
 
982
            return 0
986
983
 
987
984
        # two loops so that we do not change ourselves before verifying it
988
985
        # will be ok
1465
1462
class InterWeave(InterVersionedFile):
1466
1463
    """Optimised code paths for weave to weave operations."""
1467
1464
    
1468
 
    _matching_file_factory = staticmethod(WeaveFile)
 
1465
    _matching_file_from_factory = staticmethod(WeaveFile)
 
1466
    _matching_file_to_factory = staticmethod(WeaveFile)
1469
1467
    
1470
1468
    @staticmethod
1471
1469
    def is_compatible(source, target):
1478
1476
 
1479
1477
    def join(self, pb=None, msg=None, version_ids=None, ignore_missing=False):
1480
1478
        """See InterVersionedFile.join."""
1481
 
        if self.target.versions() == []:
1482
 
            # optimised copy
 
1479
        version_ids = self._get_source_version_ids(version_ids, ignore_missing)
 
1480
        if self.target.versions() == [] and version_ids is None:
1483
1481
            self.target._copy_weave_content(self.source)
1484
1482
            return
1485
1483
        try: