~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-22 21:20:30 UTC
  • mfrom: (3010.1.17 pack.read-locks)
  • Revision ID: pqm@pqm.ubuntu.com-20071122212030-ehfexlt3qzptnsdv
(robertc) Various lock and write-group correctness issues which show
        up when packs are the default format. (Robert Collins, #154204).

Show diffs side-by-side

added added

removed removed

Lines of Context:
420
420
    def get_tree_with_a_file(self):
421
421
        tree = self.make_branch_and_tree('tree')
422
422
        self.build_tree(['tree/a file'])
423
 
        tree.add('a file', 'a file id')
 
423
        tree.add('a file', 'a-file-id')
424
424
        return tree
425
425
 
426
426
    def test_non_empty_no_parents_to_dirstate(self):
431
431
            (('', '', tree.get_root_id()), # common details
432
432
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
433
433
             ]),
434
 
            (('', 'a file', 'a file id'), # common
 
434
            (('', 'a file', 'a-file-id'), # common
435
435
             [('f', '', 0, False, dirstate.DirState.NULLSTAT), # current
436
436
             ]),
437
437
            ])
450
450
             [('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
451
451
              ('d', '', 0, False, rev_id), # first parent details
452
452
             ]),
453
 
            (('', 'a file', 'a file id'), # common
 
453
            (('', 'a file', 'a-file-id'), # common
454
454
             [('f', '', 0, False, dirstate.DirState.NULLSTAT), # current
455
455
              ('f', 'c3ed76e4bfd45ff1763ca206055bca8e9fc28aa8', 24, False,
456
456
               rev_id), # first parent
478
478
              ('d', '', 0, False, rev_id), # first parent details
479
479
              ('d', '', 0, False, rev_id2), # second parent details
480
480
             ]),
481
 
            (('', 'a file', 'a file id'), # common
 
481
            (('', 'a file', 'a-file-id'), # common
482
482
             [('f', '', 0, False, dirstate.DirState.NULLSTAT), # current
483
483
              ('f', 'c3ed76e4bfd45ff1763ca206055bca8e9fc28aa8', 24, False,
484
484
               rev_id), # first parent
1008
1008
            (('', '', 'TREE_ROOT'), [
1009
1009
             ('d', '', 0, False, dirstate.DirState.NULLSTAT), # current tree
1010
1010
             ]),
1011
 
            (('', 'a file', 'a file id'), [
 
1011
            (('', 'a file', 'a-file-id'), [
1012
1012
             ('f', '1'*20, 19, False, dirstate.pack_stat(stat)), # current tree
1013
1013
             ]),
1014
1014
            ]
1015
1015
        try:
1016
 
            state.add('a file', 'a file id', 'file', stat, '1'*20)
 
1016
            state.add('a file', 'a-file-id', 'file', stat, '1'*20)
1017
1017
            # having added it, it should be in the output of iter_entries.
1018
1018
            self.assertEqual(expected_entries, list(state._iter_entries()))
1019
1019
            # saving and reloading should not affect this.
1038
1038
        state = dirstate.DirState.initialize('dirstate')
1039
1039
        try:
1040
1040
            self.assertRaises(errors.NotVersionedError, state.add,
1041
 
                'unversioned/a file', 'a file id', 'file', None, None)
 
1041
                'unversioned/a file', 'a-file-id', 'file', None, None)
1042
1042
        finally:
1043
1043
            state.unlock()
1044
1044
 
1115
1115
            (('', 'a dir', 'a dir id'), [
1116
1116
             ('d', '', 0, False, dirstate.pack_stat(dirstat)), # current tree
1117
1117
             ]),
1118
 
            (('a dir', 'a file', 'a file id'), [
 
1118
            (('a dir', 'a file', 'a-file-id'), [
1119
1119
             ('f', '1'*20, 25, False,
1120
1120
              dirstate.pack_stat(filestat)), # current tree details
1121
1121
             ]),
1123
1123
        state = dirstate.DirState.initialize('dirstate')
1124
1124
        try:
1125
1125
            state.add('a dir', 'a dir id', 'directory', dirstat, None)
1126
 
            state.add('a dir/a file', 'a file id', 'file', filestat, '1'*20)
 
1126
            state.add('a dir/a file', 'a-file-id', 'file', filestat, '1'*20)
1127
1127
            # added it, it should be in the output of iter_entries.
1128
1128
            self.assertEqual(expected_entries, list(state._iter_entries()))
1129
1129
            # saving and reloading should not affect this.