~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_versioning.py

  • Committer: John Arbash Meinel
  • Date: 2006-03-08 14:31:23 UTC
  • mfrom: (1598 +trunk)
  • mto: (1685.1.1 bzr-encoding)
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: john@arbash-meinel.com-20060308143123-448308b0db4de410
[merge] bzr.dev 1573, lots of updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.branch import Branch
27
27
from bzrlib.trace import mutter
28
28
from bzrlib.osutils import pathjoin
 
29
from bzrlib.workingtree import WorkingTree
29
30
 
30
31
 
31
32
class TestVersioning(TestCaseInTempDir):
40
41
        self.run_bzr('mkdir', 'foo', retcode=3)
41
42
 
42
43
        from bzrlib.diff import compare_trees
43
 
        from bzrlib.branch import Branch
44
 
        b = Branch.open(u'.')
 
44
        wt = WorkingTree.open('.')
45
45
        
46
 
        delta = compare_trees(b.basis_tree(), b.working_tree())
 
46
        delta = compare_trees(wt.basis_tree(), wt)
47
47
 
48
48
        self.log('delta.added = %r' % delta.added)
49
49
 
65
65
        os.chdir('..')
66
66
 
67
67
        from bzrlib.diff import compare_trees
68
 
        from bzrlib.branch import Branch
69
 
        b = Branch.open(u'.')
 
68
        wt = WorkingTree.open('.')
70
69
        
71
 
        delta = compare_trees(b.basis_tree(), b.working_tree())
 
70
        delta = compare_trees(wt.basis_tree(), wt)
72
71
 
73
72
        self.log('delta.added = %r' % delta.added)
74
73
 
95
94
        self.failUnless(os.path.isdir('a/b/dir'))
96
95
 
97
96
        from bzrlib.diff import compare_trees
98
 
        b = Branch.open(u'.')
99
 
        b_a = Branch.open('a')
100
 
        b_b = Branch.open('a/b')
 
97
        wt = WorkingTree.open('.')
 
98
        wt_a = WorkingTree.open('a')
 
99
        wt_b = WorkingTree.open('a/b')
101
100
        
102
 
        delta = compare_trees(b.basis_tree(), b.working_tree())
103
 
        self.assertEquals(len(delta.added), 1)
104
 
        self.assertEquals(delta.added[0][0], 'dir')
105
 
        self.failIf(delta.modified)
106
 
 
107
 
        delta = compare_trees(b_a.basis_tree(), b_a.working_tree())
108
 
        self.assertEquals(len(delta.added), 1)
109
 
        self.assertEquals(delta.added[0][0], 'dir')
110
 
        self.failIf(delta.modified)
111
 
 
112
 
        delta = compare_trees(b_b.basis_tree(), b_b.working_tree())
 
101
        delta = compare_trees(wt.basis_tree(), wt)
 
102
        self.assertEquals(len(delta.added), 1)
 
103
        self.assertEquals(delta.added[0][0], 'dir')
 
104
        self.failIf(delta.modified)
 
105
 
 
106
        delta = compare_trees(wt_a.basis_tree(), wt_a)
 
107
        self.assertEquals(len(delta.added), 1)
 
108
        self.assertEquals(delta.added[0][0], 'dir')
 
109
        self.failIf(delta.modified)
 
110
 
 
111
        delta = compare_trees(wt_b.basis_tree(), wt_b)
113
112
        self.assertEquals(len(delta.added), 1)
114
113
        self.assertEquals(delta.added[0][0], 'dir')
115
114
        self.failIf(delta.modified)