/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-14 08:20:59 UTC
  • mfrom: (2990 +trunk)
  • mto: (2990.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2991.
  • Revision ID: v.ladeuil+lp@free.fr-20071114082059-bx03o3laiqfnyleb
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
359
359
        # There are no files on disk and no parents
360
360
        tree = self.make_branch_and_tree('tree')
361
361
        expected_result = ([], [
362
 
            (('', '', tree.path2id('')), # common details
 
362
            (('', '', tree.get_root_id()), # common details
363
363
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
364
364
             ])])
365
365
        state = dirstate.DirState.from_tree(tree, 'dirstate')
372
372
        rev_id = tree.commit('first post').encode('utf8')
373
373
        root_stat_pack = dirstate.pack_stat(os.stat(tree.basedir))
374
374
        expected_result = ([rev_id], [
375
 
            (('', '', tree.path2id('')), # common details
 
375
            (('', '', tree.get_root_id()), # common details
376
376
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
377
377
              ('d', '', 0, False, rev_id), # first parent details
378
378
             ])])
392
392
        rev_id2 = tree2.commit('second post', allow_pointless=True)
393
393
        tree.merge_from_branch(tree2.branch)
394
394
        expected_result = ([rev_id, rev_id2], [
395
 
            (('', '', tree.path2id('')), # common details
 
395
            (('', '', tree.get_root_id()), # common details
396
396
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
397
397
              ('d', '', 0, False, rev_id), # first parent details
398
398
              ('d', '', 0, False, rev_id2), # second parent details
411
411
        tree = self.make_branch_and_tree('tree')
412
412
        self.build_tree(['tree/unknown'])
413
413
        expected_result = ([], [
414
 
            (('', '', tree.path2id('')), # common details
 
414
            (('', '', tree.get_root_id()), # common details
415
415
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
416
416
             ])])
417
417
        state = dirstate.DirState.from_tree(tree, 'dirstate')
428
428
        # There are files on disk and no parents
429
429
        tree = self.get_tree_with_a_file()
430
430
        expected_result = ([], [
431
 
            (('', '', tree.path2id('')), # common details
 
431
            (('', '', tree.get_root_id()), # common details
432
432
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
433
433
             ]),
434
434
            (('', 'a file', 'a file id'), # common
446
446
        # and length:
447
447
        self.build_tree_contents([('tree/a file', 'new content\n')])
448
448
        expected_result = ([rev_id], [
449
 
            (('', '', tree.path2id('')), # common details
 
449
            (('', '', tree.get_root_id()), # common details
450
450
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
451
451
              ('d', '', 0, False, rev_id), # first parent details
452
452
             ]),
473
473
        # and length again, giving us three distinct values:
474
474
        self.build_tree_contents([('tree/a file', 'new content\n')])
475
475
        expected_result = ([rev_id, rev_id2], [
476
 
            (('', '', tree.path2id('')), # common details
 
476
            (('', '', tree.get_root_id()), # common details
477
477
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
478
478
              ('d', '', 0, False, rev_id), # first parent details
479
479
              ('d', '', 0, False, rev_id2), # second parent details
525
525
        # get a state object
526
526
        # no parents, default tree content
527
527
        expected_result = ([], [
528
 
            (('', '', tree.path2id('')), # common details
 
528
            (('', '', tree.get_root_id()), # common details
529
529
             # current tree details, but new from_tree skips statting, it
530
530
             # uses set_state_from_inventory, and thus depends on the
531
531
             # inventory state.
678
678
        try:
679
679
            tree1.add('')
680
680
            revid1 = tree1.commit('foo').encode('utf8')
681
 
            root_id = tree1.inventory.root.file_id
 
681
            root_id = tree1.get_root_id()
682
682
            inv = tree1.inventory
683
683
        finally:
684
684
            tree1.unlock()
892
892
        tree2.lock_write()
893
893
        try:
894
894
            revid2 = tree2.commit('foo')
895
 
            root_id = tree2.inventory.root.file_id
 
895
            root_id = tree2.get_root_id()
896
896
        finally:
897
897
            tree2.unlock()
898
898
        state = dirstate.DirState.initialize('dirstate')
962
962
        try:
963
963
            tree2.put_file_bytes_non_atomic('file-id', 'new file-content')
964
964
            revid2 = tree2.commit('foo')
965
 
            root_id = tree2.inventory.root.file_id
 
965
            root_id = tree2.get_root_id()
966
966
        finally:
967
967
            tree2.unlock()
968
968
        # check the layout in memory