~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: John Arbash Meinel
  • Date: 2013-06-24 12:03:12 UTC
  • mfrom: (6437.77.2 2.5)
  • mto: This revision was merged to the branch mainline in revision 6579.
  • Revision ID: john@arbash-meinel.com-20130624120312-pmvck24x052csigx
Merge lp:bzr/2.5 r6515 to get the fix for bug #855155 (Dirstate.update_basis_by_delta)

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=[],