~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

  • Committer: Robert Collins
  • Date: 2005-09-06 11:09:03 UTC
  • mfrom: (1178)
  • mto: (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050906110903-b6be7bd6102403cb
really merge mpool

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."""