~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store.py

  • Committer: Martin Pool
  • Date: 2005-06-11 01:35:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050611013524-2ee17e0fb957a444
- Show progress while branching

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        f.write(content)
108
108
        f.close()
109
109
 
 
110
 
110
111
    def copy_multi(self, other, ids):
111
112
        """Copy texts for ids from other into self.
112
113
 
113
114
        If an id is present in self, it is skipped.  A count of copied
114
115
        ids is returned, which may be less than len(ids).
115
116
        """
 
117
        from bzrlib.progress import ProgressBar
 
118
        pb = ProgressBar()
 
119
        pb.update('preparing to copy')
 
120
        to_copy = [id for id in ids if id not in self]
116
121
        count = 0
117
 
        for id in ids:
118
 
            if id in self:
119
 
                continue
 
122
        for id in to_copy:
 
123
            count += 1
 
124
            pb.update('copy', count, len(to_copy))
120
125
            self.add(other[id], id)
121
 
            count += 1
 
126
        assert count == len(to_copy)
 
127
        pb.clear()
122
128
        return count
 
129
    
123
130
 
124
131
    def __contains__(self, fileid):
125
132
        """"""