~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Martin Pool
  • Date: 2006-01-23 02:09:39 UTC
  • mfrom: (1534.1.11 integration)
  • Revision ID: mbp@sourcefrog.net-20060123020939-567fb193328ed7a6
[merge] robert's integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
            self.pb = pb
109
109
        self.from_branch.lock_read()
110
110
        try:
111
 
            revs = self._revids_to_fetch(last_revision )
 
111
            revs = self._revids_to_fetch(last_revision)
112
112
            # nothing to do
113
113
            if revs: 
114
 
                self._fetch_revision_texts( revs )
115
 
                self._fetch_weave_texts( revs )
116
 
                self._fetch_inventory_weave( revs )
 
114
                self._fetch_weave_texts(revs)
 
115
                self._fetch_inventory_weave(revs)
 
116
                self._fetch_revision_texts(revs)
117
117
                self.count_copied += len(revs)
118
118
        finally:
119
119
            self.from_branch.unlock()
133
133
        self.dest_last_rev = self.to_branch.last_revision()
134
134
        branch_to_revs = set(self.to_branch.get_ancestry(self.dest_last_rev))
135
135
 
136
 
        return branch_from_revs.difference( branch_to_revs )
 
136
        return branch_from_revs.difference(branch_to_revs)
137
137
 
138
 
    def _fetch_revision_texts( self, revs ):
 
138
    def _fetch_revision_texts(self, revs):
139
139
        self.to_branch.revision_store.copy_multi(
140
 
            self.from_branch.revision_store, revs )
 
140
            self.from_branch.revision_store, revs)
141
141
 
142
 
    def _fetch_weave_texts( self, revs ):
143
 
        file_ids = self.from_branch.fileid_involved_by_set( revs )
 
142
    def _fetch_weave_texts(self, revs):
 
143
        file_ids = self.from_branch.fileid_involved_by_set(revs)
144
144
        count = 0
145
145
        num_file_ids = len(file_ids)
146
146
        for file_id in file_ids:
147
 
            self.pb.update( "merge weave merge",count,num_file_ids)
 
147
            self.pb.update("merge weave merge", count, num_file_ids)
148
148
            count +=1
149
149
            to_weave = self.to_weaves.get_weave_or_empty(file_id,
150
150
                self.to_branch.get_transaction())
159
159
                    to_weave.reweave(from_weave)
160
160
            else:
161
161
                # destination is empty, just replace it
162
 
                to_weave = from_weave.copy( )
 
162
                to_weave = from_weave.copy()
163
163
 
164
164
            self.to_weaves.put_weave(file_id, to_weave,
165
165
                self.to_branch.get_transaction())
166
166
 
167
 
        self.pb.clear( )
 
167
        self.pb.clear()
168
168
 
169
 
    def _fetch_inventory_weave( self, revs ):
170
 
        self.pb.update( "inventory merge",0,1)
 
169
    def _fetch_inventory_weave(self, revs):
 
170
        self.pb.update("inventory merge", 0, 1)
171
171
 
172
172
        from_weave = self.from_control.get_weave('inventory',
173
173
                self.from_branch.get_transaction())
182
182
                to_weave.reweave(from_weave)
183
183
        else:
184
184
            # destination is empty, just replace it
185
 
            to_weave = from_weave.copy( )
 
185
            to_weave = from_weave.copy()
186
186
 
187
187
        self.to_control.put_weave('inventory', to_weave,
188
188
            self.to_branch.get_transaction())
189
189
 
190
 
        self.pb.clear( )
 
190
        self.pb.clear()
191
191
 
192
192
    def _find_last_revision(self, last_revision):
193
193
        """Find the limiting source revision.