~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

  • Committer: Robert Collins
  • Date: 2005-08-25 06:08:36 UTC
  • mto: (974.1.50) (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: robertc@robertcollins.net-20050825060836-40b430abb9d341d9
unbreak cmd_branch now that something tests the core of it..

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, TestCaseInTempDir
 
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(TestCaseInTempDir):
 
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
 
        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):
 
101
        
 
102
        
 
103
class SubdirCommit(BzrTestBase):
136
104
 
137
105
    def test_subdir_commit(self):
138
106
        """Test committing a subdirectory, and committing within a directory."""