~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Vincent Ladeuil
  • Date: 2011-08-12 09:49:24 UTC
  • mfrom: (6015.9.10 2.4)
  • mto: This revision was merged to the branch mainline in revision 6066.
  • Revision ID: v.ladeuil+lp@free.fr-20110812094924-knc5s0g7vs31a2f1
Merge 2.4 into trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
        new_roots = [k for k, v in self._new_parent.iteritems() if v is
232
232
                     ROOT_PARENT]
233
233
        if len(new_roots) < 1:
234
 
            if self.final_kind(self.root) is None:
235
 
                self.cancel_deletion(self.root)
236
 
            if self.final_file_id(self.root) is None:
237
 
                self.version_file(self.tree_file_id(self.root),
238
 
                                     self.root)
239
234
            return
240
235
        if len(new_roots) != 1:
241
236
            raise ValueError('A tree cannot have two roots!')
1753
1748
                mover.apply_deletions()
1754
1749
        finally:
1755
1750
            child_pb.finished()
 
1751
        if self.final_file_id(self.root) is None:
 
1752
            inventory_delta = [e for e in inventory_delta if e[0] != '']
1756
1753
        self._tree.apply_inventory_delta(inventory_delta)
1757
1754
        self._apply_observed_sha1s()
1758
1755
        self._done = True
2261
2258
        else:
2262
2259
            return None
2263
2260
 
 
2261
    def get_file_verifier(self, file_id, path=None, stat_value=None):
 
2262
        trans_id = self._transform.trans_id_file_id(file_id)
 
2263
        kind = self._transform._new_contents.get(trans_id)
 
2264
        if kind is None:
 
2265
            return self._transform._tree.get_file_verifier(file_id)
 
2266
        if kind == 'file':
 
2267
            fileobj = self.get_file(file_id)
 
2268
            try:
 
2269
                return ("SHA1", sha_file(fileobj))
 
2270
            finally:
 
2271
                fileobj.close()
 
2272
 
2264
2273
    def get_file_sha1(self, file_id, path=None, stat_value=None):
2265
2274
        trans_id = self._transform.trans_id_file_id(file_id)
2266
2275
        kind = self._transform._new_contents.get(trans_id)