~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Patch Queue Manager
  • Date: 2013-06-24 13:05:33 UTC
  • mfrom: (6578.1.1 2.6-merges-2.5)
  • Revision ID: pqm@pqm.ubuntu.com-20130624130533-51c8htekjd8mix3u
(jameinel) Merge bzr/2.5 into trunk,
 including the fix for bug #855155 (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2478
2478
    def create_tree_from_shape(self, rev_id, shape):
2479
2479
        dir_ids = {'': 'root-id'}
2480
2480
        inv = inventory.Inventory('root-id', rev_id)
2481
 
        for path, file_id in shape:
 
2481
        for info in shape:
 
2482
            if len(info) == 2:
 
2483
                path, file_id = info
 
2484
                ie_rev_id = rev_id
 
2485
            else:
 
2486
                path, file_id, ie_rev_id = info
2482
2487
            if path == '':
2483
2488
                # Replace the root entry
2484
2489
                del inv._byid[inv.root.file_id]
2486
2491
                inv._byid[file_id] = inv.root
2487
2492
                dir_ids[''] = file_id
2488
2493
                continue
2489
 
            inv.add(self.path_to_ie(path, file_id, rev_id, dir_ids))
 
2494
            inv.add(self.path_to_ie(path, file_id, ie_rev_id, dir_ids))
2490
2495
        return revisiontree.InventoryRevisionTree(_Repo(), inv, rev_id)
2491
2496
 
2492
2497
    def create_empty_dirstate(self):
2615
2620
            target=[('file', 'file-id')],
2616
2621
            )
2617
2622
 
 
2623
    def test_add_file_in_empty_dir_not_matching_active_state(self):
 
2624
        state = self.assertUpdate(
 
2625
                active=[],
 
2626
                basis=[('dir/', 'dir-id')],
 
2627
                target=[('dir/', 'dir-id', 'basis'), ('dir/file', 'file-id')],
 
2628
                )
 
2629
 
2618
2630
    def test_add_file_missing_in_active_state(self):
2619
2631
        state = self.assertUpdate(
2620
2632
            active=[],