~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-27 04:42:41 UTC
  • mfrom: (1092.1.43)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050827044241-23d676133b9fc981
Merge of robertc@robertcollins.net-20050826013321-52eee1f1da679ee9

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
 
24
24
import os
25
 
 
26
 
from bzrlib.selftest import BzrTestBase, FunctionalTestCase
 
25
from bzrlib.selftest import InTempDir, BzrTestBase
27
26
from bzrlib.branch import Branch
28
27
 
29
 
import logging
30
 
logger = logging.getLogger('bzr.test.versioning')
31
 
debug = logger.debug
32
 
 
33
 
 
34
 
class TestVersioning(FunctionalTestCase):
 
28
 
 
29
class TestVersioning(InTempDir):
35
30
    
36
31
    def test_mkdir(self): 
37
32
        """Basic 'bzr mkdir' operation"""
73
68
                          b.add,
74
69
                          'foo/hello')
75
70
        
76
 
        self.check_and_upgrade()
77
 
 
78
 
        
79
71
    def test_subdir_add(self):
80
72
        """Add in subdirectory should add only things from there down"""
81
73
        
106
98
        chdir('..')
107
99
        eq(run_bzr(['add']), 0)
108
100
        eq(list(b.unknowns()), [])
109
 
 
110
 
        self.check_and_upgrade()
111
 
 
112
 
 
113
 
    def check_and_upgrade(self):
114
 
        """After all the above changes, run the check and upgrade commands.
115
 
 
116
 
        The upgrade should be a no-op."""
117
 
        from bzrlib.commands import run_bzr
118
 
        b = Branch('.')
119
 
        debug('branch has %d revisions', b.revno())
120
 
        
121
 
        debug('check branch...')
122
 
        from bzrlib.check import check
123
 
        check(b)
124
 
        
125
 
        debug('upgrade branch...')
126
 
        from bzrlib.upgrade import upgrade
127
 
        upgrade(b)
128
 
        
129
 
        debug('check branch...')
130
 
        from bzrlib.check import check
131
 
        check(b)
132
 
        
133
 
 
134
 
        
135
 
        
136
 
class SubdirCommit(FunctionalTestCase):
 
101
        
 
102
        
 
103
class SubdirCommit(BzrTestBase):
137
104
 
138
105
    def test_subdir_commit(self):
139
106
        """Test committing a subdirectory, and committing within a directory."""