~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: 2008-01-02 15:49:06 UTC
  • mfrom: (3146.1.2 parents-provider-fix)
  • Revision ID: pqm@pqm.ubuntu.com-20080102154906-hqiq6x2eammznjtg
ParentsProviders now provide tuples of parents, never lists (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1697
1697
        parent_map = {}
1698
1698
        for revision_id in keys:
1699
1699
            if revision_id == _mod_revision.NULL_REVISION:
1700
 
                parent_map[revision_id] = []
 
1700
                parent_map[revision_id] = ()
1701
1701
            else:
1702
1702
                try:
1703
 
                    parent_ids = self.get_revision(revision_id).parent_ids
 
1703
                    parent_id_list = self.get_revision(revision_id).parent_ids
1704
1704
                except errors.NoSuchRevision:
1705
1705
                    pass
1706
1706
                else:
1707
 
                    if len(parent_ids) == 0:
1708
 
                        parent_ids = [_mod_revision.NULL_REVISION]
 
1707
                    if len(parent_id_list) == 0:
 
1708
                        parent_ids = (_mod_revision.NULL_REVISION,)
 
1709
                    else:
 
1710
                        parent_ids = tuple(parent_id_list)
1709
1711
                    parent_map[revision_id] = parent_ids
1710
1712
        return parent_map
1711
1713