~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-09-04 02:59:56 UTC
  • mfrom: (1172)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050904025956-776ba4f07de97700
Merged mpool's latest changes (~0.0.7)

Show diffs side-by-side

added added

removed removed

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