~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

  • Committer: Martin Pool
  • Date: 2005-08-29 10:57:01 UTC
  • mfrom: (1092.1.41)
  • Revision ID: mbp@sourcefrog.net-20050829105701-7aaa81ecf1bfee05
- merge in merge improvements and additional tests 
  from aaron and lifeless

robertc@robertcollins.net-20050825131100-85772edabc817481

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, FunctionalTestCase
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(FunctionalTestCase):
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
        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):
104
137
 
105
138
    def test_subdir_commit(self):
106
139
        """Test committing a subdirectory, and committing within a directory."""