~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-07 10:45:44 UTC
  • mfrom: (2321.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070307104544-59e3e6358e4bdb29
(robertc) Merge dirstate and subtrees. (Robert Collins, Martin Pool, Aaaron Bentley, John A Meinel, James Westby)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from cStringIO import StringIO
19
19
import os
20
20
 
21
 
from bzrlib import ignores
22
 
import bzrlib
 
21
from bzrlib import (
 
22
    bzrdir,
 
23
    conflicts,
 
24
    errors,
 
25
    workingtree,
 
26
    )
23
27
from bzrlib.branch import Branch
24
 
from bzrlib import bzrdir, conflicts, errors, workingtree
25
28
from bzrlib.bzrdir import BzrDir
26
 
from bzrlib.errors import NotBranchError, NotVersionedError
27
29
from bzrlib.lockdir import LockDir
28
30
from bzrlib.mutabletree import needs_tree_write_lock
29
 
from bzrlib.osutils import pathjoin, getcwd, has_symlinks
30
31
from bzrlib.symbol_versioning import zero_thirteen
31
32
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
32
 
from bzrlib.trace import mutter
33
33
from bzrlib.transport import get_transport
34
34
from bzrlib.workingtree import (
35
35
    TreeEntry,
36
36
    TreeDirectory,
37
37
    TreeFile,
38
38
    TreeLink,
39
 
    WorkingTree,
40
39
    )
41
40
 
 
41
 
42
42
class TestTreeDirectory(TestCaseWithTransport):
43
43
 
44
44
    def test_kind_character(self):
174
174
        t = control.get_workingtree_transport(None)
175
175
        self.assertEqualDiff('Bazaar-NG Working Tree format 3',
176
176
                             t.get('format').read())
177
 
        # self.assertContainsRe(t.get('inventory').read(), 
178
 
        #                       '<inventory file_id="[^"]*" format="5">\n'
179
 
        #                       '</inventory>\n',
180
 
        #                      )
181
 
        # WorkingTreeFormat3 doesn't default to creating a unique root id,
182
 
        # because it is incompatible with older bzr versions
183
 
        self.assertContainsRe(t.get('inventory').read(),
 
177
        self.assertEqualDiff(t.get('inventory').read(), 
184
178
                              '<inventory format="5">\n'
185
179
                              '</inventory>\n',
186
180
                             )
231
225
 
232
226
    def create_format2_tree(self, url):
233
227
        return self.make_branch_and_tree(
234
 
            url, format=bzrlib.bzrdir.BzrDirFormat6())
 
228
            url, format=bzrdir.BzrDirFormat6())
235
229
 
236
230
    def test_conflicts(self):
237
231
        # test backwards compatability
359
353
        tree = self.make_branch_and_tree('tree')
360
354
        self.build_tree(['tree/hello/'])
361
355
        tree.add('hello', 'hello-id')
362
 
        file_conflict = conflicts.TextConflict('file', 'hello_id')
 
356
        file_conflict = conflicts.TextConflict('file', None, 'hello-id')
363
357
        tree.set_conflicts(conflicts.ConflictList([file_conflict]))
364
358
        tree.auto_resolve()