~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store.py

  • Committer: Martin Pool
  • Date: 2005-06-06 11:37:20 UTC
  • Revision ID: mbp@sourcefrog.net-20050606113720-67ba802e69fe05c4
- add Store.copy_multi for use in pulling changes into a branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        f.write(content)
108
108
        f.close()
109
109
 
 
110
    def copy_multi(self, other, ids):
 
111
        """Copy texts for ids from other into self.
 
112
 
 
113
        If an id is present in self, it is skipped.  A count of copied
 
114
        ids is returned, which may be less than len(ids).
 
115
        """
 
116
        count = 0
 
117
        for id in ids:
 
118
            if id in self:
 
119
                continue
 
120
            self.add(other[id], id)
 
121
            count += 1
 
122
        return count
110
123
 
111
124
    def __contains__(self, fileid):
112
125
        """"""