~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_foreign.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
                        rev.timezone, rev.committer, rev.properties,
206
206
                        new_revid)
207
207
                try:
208
 
                    for path, ie in tree.inventory.iter_entries():
 
208
                    parent_tree = self.target.repository.revision_tree(
 
209
                        parent_revid)
 
210
                    for path, ie in tree.iter_entries_by_dir():
209
211
                        new_ie = ie.copy()
210
212
                        new_ie.revision = None
211
213
                        builder.record_entry_contents(new_ie, 
212
 
                            [self.target.repository.revision_tree(parent_revid).inventory],
 
214
                            [parent_tree.root_inventory],
213
215
                            path, tree, 
214
216
                            (ie.kind, ie.text_size, ie.executable, ie.text_sha1))
215
217
                    builder.finish_inventory()
240
242
 
241
243
    def open(self, a_bzrdir, name=None, _found=False, ignore_fallbacks=False,
242
244
            found_repository=None):
 
245
        if name is None:
 
246
            name = a_bzrdir._get_selected_branch()
243
247
        if not _found:
244
248
            raise NotImplementedError
245
249
        try:
251
255
            return DummyForeignVcsBranch(_format=self,
252
256
                              _control_files=control_files,
253
257
                              a_bzrdir=a_bzrdir,
254
 
                              _repository=found_repository)
 
258
                              _repository=found_repository,
 
259
                              name=name)
255
260
        except errors.NoSuchFile:
256
261
            raise errors.NotBranchError(path=transport.base)
257
262
 
317
322
 
318
323
    def open_branch(self, name=None, unsupported=False, ignore_fallbacks=True,
319
324
            possible_transports=None):
320
 
        if name is not None:
 
325
        if name is None:
 
326
            name = self._get_selected_branch()
 
327
        if name != "":
321
328
            raise errors.NoColocatedBranchSupport(self)
322
329
        return self._format.get_branch_format().open(self, _found=True)
323
330
 
424
431
        foreign.update_workingtree_fileids(wt, target_basis)
425
432
        wt.lock_read()
426
433
        try:
427
 
            self.assertEquals(set([root_id, "bla-b"]), set(wt.inventory))
 
434
            self.assertEquals(set([root_id, "bla-b"]), set(wt.all_file_ids()))
428
435
        finally:
429
436
            wt.unlock()
430
437