~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_info.py

  • Committer: Martin Pool
  • Date: 2006-06-20 07:55:43 UTC
  • mfrom: (1798 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1799.
  • Revision ID: mbp@sourcefrog.net-20060620075543-b10f6575d4a4fa32
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
"""Tests for the info command of bzr."""
20
20
 
 
21
import sys
21
22
 
22
23
import bzrlib
23
 
 
24
 
 
25
24
from bzrlib.osutils import format_date
26
25
from bzrlib.tests import TestSkipped
27
26
from bzrlib.tests.blackbox import ExternalBase
30
29
class TestInfo(ExternalBase):
31
30
 
32
31
    def test_info_non_existing(self):
33
 
        out, err = self.runbzr('info /i/do/not/exist/', retcode=3)
 
32
        if sys.platform == "win32":
 
33
            location = "C:/i/do/not/exist/"
 
34
        else:
 
35
            location = "/i/do/not/exist/"
 
36
        out, err = self.runbzr('info '+location, retcode=3)
34
37
        self.assertEqual(out, '')
35
 
        self.assertEqual(err, 'bzr: ERROR: Not a branch: /i/do/not/exist/\n')
 
38
        self.assertEqual(err, 'bzr: ERROR: Not a branch: %s\n' % location)
36
39
 
37
40
    def test_info_standalone(self):
38
41
        transport = self.get_transport()
133
136
        bzrlib.upgrade.upgrade('bound', bzrlib.bzrdir.BzrDirMetaFormat1())
134
137
        branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
135
138
        branch3.bind(branch1)
 
139
        bound_tree = branch3.bzrdir.open_workingtree()
136
140
        out, err = self.runbzr('info bound')
137
141
        self.assertEqualDiff(
138
142
"""Location:
144
148
 
145
149
Format:
146
150
       control: Meta directory format 1
147
 
  working tree: Working tree format 3
 
151
  working tree: %s
148
152
        branch: Branch format 5
149
153
    repository: %s
150
154
 
170
174
""" % (branch3.bzrdir.root_transport.base,
171
175
       branch1.bzrdir.root_transport.base,
172
176
       branch1.bzrdir.root_transport.base,
 
177
       bound_tree._format.get_format_description(),      
173
178
       branch3.repository._format.get_format_description(),
174
179
       datestring_first, datestring_first,
175
180
       # poking at _revision_store isn't all that clean, but neither is
242
247
        out, err = self.runbzr('info lightcheckout')
243
248
        self.assertEqualDiff(
244
249
"""Location:
245
 
  light checkout root: %s
246
 
   checkout of branch: %s
 
250
 light checkout root: %s
 
251
  checkout of branch: %s
247
252
 
248
253
Format:
249
254
       control: Meta directory format 1
423
428
        out, err = self.runbzr('info lightcheckout --verbose')
424
429
        self.assertEqualDiff(
425
430
"""Location:
426
 
  light checkout root: %s
427
 
   checkout of branch: %s
 
431
 light checkout root: %s
 
432
  checkout of branch: %s
428
433
 
429
434
Format:
430
435
       control: Meta directory format 1
543
548
        dir2.create_workingtree()
544
549
        tree2 = dir2.open_workingtree()
545
550
        branch2 = tree2.branch
546
 
        out, err = self.runbzr('info tree/lightcheckout')
547
 
        self.assertEqualDiff(
548
 
"""Location:
549
 
  light checkout root: %s
550
 
    shared repository: %s
551
 
    repository branch: branch
552
 
 
553
 
Format:
554
 
       control: Meta directory format 1
555
 
  working tree: Working tree format 3
556
 
        branch: Branch format 5
557
 
    repository: %s
558
 
 
559
 
In the working tree:
560
 
         0 unchanged
561
 
         0 modified
562
 
         0 added
563
 
         0 removed
564
 
         0 renamed
565
 
         0 unknown
566
 
         0 ignored
567
 
         0 versioned subdirectories
568
 
 
569
 
Branch history:
570
 
         0 revisions
571
 
 
572
 
Revision store:
573
 
         0 revisions
574
 
         0 KiB
575
 
""" % (tree2.bzrdir.root_transport.base,
576
 
       repo.bzrdir.root_transport.base,
577
 
       repo._format.get_format_description(),
578
 
       ), out)
579
 
        self.assertEqual('', err)
 
551
        self.assertCheckoutStatusOutput('tree/lightcheckout', tree2, shared_repo=repo)
580
552
 
581
553
        # Create normal checkout
582
554
        branch3 = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout')
583
555
        branch3.bind(branch1)
584
556
        tree3 = branch3.bzrdir.open_workingtree()
585
557
        tree3.update()
586
 
        out, err = self.runbzr('info tree/checkout --verbose')
587
 
        self.assertEqualDiff(
588
 
"""Location:
589
 
       checkout root: %s
590
 
  checkout of branch: %s
591
 
 
592
 
Format:
593
 
       control: Meta directory format 1
594
 
  working tree: Working tree format 3
595
 
        branch: Branch format 5
596
 
    repository: %s
597
 
 
598
 
In the working tree:
599
 
         0 unchanged
600
 
         0 modified
601
 
         0 added
602
 
         0 removed
603
 
         0 renamed
604
 
         0 unknown
605
 
         0 ignored
606
 
         0 versioned subdirectories
607
 
 
608
 
Branch history:
609
 
         0 revisions
610
 
         0 committers
611
 
 
612
 
Revision store:
613
 
         0 revisions
614
 
         0 KiB
615
 
""" % (branch3.bzrdir.root_transport.base,
616
 
       branch1.bzrdir.root_transport.base,
617
 
       repo._format.get_format_description(),
618
 
       ), out)
619
 
        self.assertEqual('', err)
620
 
 
 
558
        self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
 
559
            verbose=True,
 
560
            light_checkout=False, repo_branch=branch1)
621
561
        # Update lightweight checkout
622
562
        self.build_tree(['tree/lightcheckout/a'])
623
563
        tree2.add('a')
627
567
        out, err = self.runbzr('info tree/lightcheckout --verbose')
628
568
        self.assertEqualDiff(
629
569
"""Location:
630
 
  light checkout root: %s
631
 
    shared repository: %s
632
 
    repository branch: branch
 
570
 light checkout root: %s
 
571
   shared repository: %s
 
572
   repository branch: branch
633
573
 
634
574
Format:
635
575
       control: Meta directory format 1
756
696
        out, err = self.runbzr('info tree/lightcheckout --verbose')
757
697
        self.assertEqualDiff(
758
698
"""Location:
759
 
  light checkout root: %s
760
 
    shared repository: %s
761
 
    repository branch: branch
 
699
 light checkout root: %s
 
700
   shared repository: %s
 
701
   repository branch: branch
762
702
 
763
703
Format:
764
704
       control: Meta directory format 1
1147
1087
 
1148
1088
        bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
1149
1089
 
 
1090
    def assertCheckoutStatusOutput(self, 
 
1091
        command_string, lco_tree, shared_repo=None,
 
1092
        repo_branch=None,
 
1093
        tree_locked=False,
 
1094
        branch_locked=False, repo_locked=False,
 
1095
        verbose=False,
 
1096
        light_checkout=True):
 
1097
        """Check the output of info in a light checkout tree.
 
1098
 
 
1099
        This is not quite a mirror of the info code: rather than using the
 
1100
        tree being examined to predict output, it uses a bunch of flags which
 
1101
        allow us, the test writers, to document what *should* be present in
 
1102
        the output. Removing this separation would remove the value of the
 
1103
        tests.
 
1104
        
 
1105
        :param path: the path to the light checkout.
 
1106
        :param lco_tree: the tree object for the light checkout.
 
1107
        :param shared_repo: A shared repository is in use, expect that in
 
1108
            the output.
 
1109
        :param repo_branch: A branch in a shared repository for non light
 
1110
            checkouts.
 
1111
        :param tree_locked: If true, expect the tree to be locked.
 
1112
        :param branch_locked: If true, expect the branch to be locked.
 
1113
        :param repo_locked: If true, expect the repository to be locked.
 
1114
        :param verbose: If true, expect verbose output
 
1115
        """
 
1116
        out, err = self.runbzr('info %s' % command_string)
 
1117
        if repo_locked or branch_locked or tree_locked:
 
1118
            def locked_message(a_bool):
 
1119
                if a_bool:
 
1120
                    return 'locked'
 
1121
                else:
 
1122
                    return 'unlocked'
 
1123
            expected_lock_output = (
 
1124
                "\n"
 
1125
                "Lock status:\n"
 
1126
                "  working tree: %s\n"
 
1127
                "        branch: %s\n"
 
1128
                "    repository: %s\n" % (
 
1129
                    locked_message(tree_locked),
 
1130
                    locked_message(branch_locked),
 
1131
                    locked_message(repo_locked)))
 
1132
        else:
 
1133
            expected_lock_output = ''
 
1134
        if light_checkout:
 
1135
            tree_data = (" light checkout root: %s" %
 
1136
                lco_tree.bzrdir.root_transport.base)
 
1137
        else:
 
1138
            tree_data = ("       checkout root: %s" %
 
1139
                lco_tree.bzrdir.root_transport.base)
 
1140
        if shared_repo is not None:
 
1141
            branch_data = (
 
1142
                "   shared repository: %s\n"
 
1143
                "   repository branch: branch\n" %
 
1144
                shared_repo.bzrdir.root_transport.base)
 
1145
        elif repo_branch is not None:
 
1146
            branch_data = (
 
1147
                "  checkout of branch: %s\n" % 
 
1148
                repo_branch.bzrdir.root_transport.base)
 
1149
        else:
 
1150
            branch_data = ("  checkout of branch: %s\n" % 
 
1151
                lco_tree.branch.bzrdir.root_transport.base)
 
1152
        
 
1153
        if verbose:
 
1154
            verbose_info = '         0 committers\n'
 
1155
        else:
 
1156
            verbose_info = ''
 
1157
            
 
1158
        self.assertEqualDiff(
 
1159
"""Location:
 
1160
%s
 
1161
%s
 
1162
Format:
 
1163
       control: Meta directory format 1
 
1164
  working tree: %s
 
1165
        branch: Branch format 5
 
1166
    repository: %s
 
1167
%s
 
1168
In the working tree:
 
1169
         0 unchanged
 
1170
         0 modified
 
1171
         0 added
 
1172
         0 removed
 
1173
         0 renamed
 
1174
         0 unknown
 
1175
         0 ignored
 
1176
         0 versioned subdirectories
 
1177
 
 
1178
Branch history:
 
1179
         0 revisions
 
1180
%s
 
1181
Revision store:
 
1182
         0 revisions
 
1183
         0 KiB
 
1184
""" %  (tree_data,
 
1185
        branch_data,
 
1186
        lco_tree._format.get_format_description(),
 
1187
        lco_tree.branch.repository._format.get_format_description(),
 
1188
        expected_lock_output,
 
1189
        verbose_info,
 
1190
        ), out)
 
1191
        self.assertEqual('', err)
 
1192
 
1150
1193
    def test_info_locking(self):
1151
1194
        transport = self.get_transport()
1152
1195
        # Create shared repository with a branch
1173
1216
        # W B R
1174
1217
 
1175
1218
        # U U U
1176
 
        out, err = self.runbzr('info tree/lightcheckout')
1177
 
        self.assertEqualDiff(
1178
 
"""Location:
1179
 
  light checkout root: %s
1180
 
   checkout of branch: %s
1181
 
 
1182
 
Format:
1183
 
       control: Meta directory format 1
1184
 
  working tree: Working tree format 3
1185
 
        branch: Branch format 5
1186
 
    repository: %s
1187
 
 
1188
 
In the working tree:
1189
 
         0 unchanged
1190
 
         0 modified
1191
 
         0 added
1192
 
         0 removed
1193
 
         0 renamed
1194
 
         0 unknown
1195
 
         0 ignored
1196
 
         0 versioned subdirectories
1197
 
 
1198
 
Branch history:
1199
 
         0 revisions
1200
 
 
1201
 
Revision store:
1202
 
         0 revisions
1203
 
         0 KiB
1204
 
""" % (lco_tree.bzrdir.root_transport.base,
1205
 
       lco_tree.branch.bzrdir.root_transport.base,
1206
 
       lco_tree.branch.repository._format.get_format_description(),
1207
 
       ), out)
1208
 
        self.assertEqual('', err)
 
1219
        self.assertCheckoutStatusOutput('tree/lightcheckout', lco_tree)
1209
1220
        # U U L
1210
1221
        lco_tree.branch.repository.lock_write()
1211
 
        out, err = self.runbzr('info tree/lightcheckout')
1212
 
        self.assertEqualDiff(
1213
 
"""Location:
1214
 
  light checkout root: %s
1215
 
   checkout of branch: %s
1216
 
 
1217
 
Format:
1218
 
       control: Meta directory format 1
1219
 
  working tree: Working tree format 3
1220
 
        branch: Branch format 5
1221
 
    repository: %s
1222
 
 
1223
 
Lock status:
1224
 
  working tree: unlocked
1225
 
        branch: unlocked
1226
 
    repository: locked
1227
 
 
1228
 
In the working tree:
1229
 
         0 unchanged
1230
 
         0 modified
1231
 
         0 added
1232
 
         0 removed
1233
 
         0 renamed
1234
 
         0 unknown
1235
 
         0 ignored
1236
 
         0 versioned subdirectories
1237
 
 
1238
 
Branch history:
1239
 
         0 revisions
1240
 
 
1241
 
Revision store:
1242
 
         0 revisions
1243
 
         0 KiB
1244
 
""" % (lco_tree.bzrdir.root_transport.base,
1245
 
       lco_tree.branch.bzrdir.root_transport.base,
1246
 
       lco_tree.branch.repository._format.get_format_description(),
1247
 
       ), out)
1248
 
        self.assertEqual('', err)
1249
 
        lco_tree.branch.repository.unlock()
 
1222
        try:
 
1223
            self.assertCheckoutStatusOutput('tree/lightcheckout',
 
1224
            lco_tree,
 
1225
            repo_locked=True)
 
1226
        finally:
 
1227
            lco_tree.branch.repository.unlock()
1250
1228
        # U L L
1251
1229
        lco_tree.branch.lock_write()
1252
 
        out, err = self.runbzr('info tree/lightcheckout')
1253
 
        self.assertEqualDiff(
1254
 
"""Location:
1255
 
  light checkout root: %s
1256
 
   checkout of branch: %s
1257
 
 
1258
 
Format:
1259
 
       control: Meta directory format 1
1260
 
  working tree: Working tree format 3
1261
 
        branch: Branch format 5
1262
 
    repository: %s
1263
 
 
1264
 
Lock status:
1265
 
  working tree: unlocked
1266
 
        branch: locked
1267
 
    repository: locked
1268
 
 
1269
 
In the working tree:
1270
 
         0 unchanged
1271
 
         0 modified
1272
 
         0 added
1273
 
         0 removed
1274
 
         0 renamed
1275
 
         0 unknown
1276
 
         0 ignored
1277
 
         0 versioned subdirectories
1278
 
 
1279
 
Branch history:
1280
 
         0 revisions
1281
 
 
1282
 
Revision store:
1283
 
         0 revisions
1284
 
         0 KiB
1285
 
""" % (lco_tree.bzrdir.root_transport.base,
1286
 
       lco_tree.branch.bzrdir.root_transport.base,
1287
 
       lco_tree.branch.repository._format.get_format_description(),
1288
 
       ), out)
1289
 
        self.assertEqual('', err)
1290
 
        lco_tree.branch.unlock()
 
1230
        try:
 
1231
            self.assertCheckoutStatusOutput('tree/lightcheckout',
 
1232
            lco_tree,
 
1233
            branch_locked=True,
 
1234
            repo_locked=True)
 
1235
        finally:
 
1236
            lco_tree.branch.unlock()
1291
1237
        # L L L
1292
1238
        lco_tree.lock_write()
1293
 
        out, err = self.runbzr('info tree/lightcheckout')
1294
 
        self.assertEqualDiff(
1295
 
"""Location:
1296
 
  light checkout root: %s
1297
 
   checkout of branch: %s
1298
 
 
1299
 
Format:
1300
 
       control: Meta directory format 1
1301
 
  working tree: Working tree format 3
1302
 
        branch: Branch format 5
1303
 
    repository: %s
1304
 
 
1305
 
Lock status:
1306
 
  working tree: locked
1307
 
        branch: locked
1308
 
    repository: locked
1309
 
 
1310
 
In the working tree:
1311
 
         0 unchanged
1312
 
         0 modified
1313
 
         0 added
1314
 
         0 removed
1315
 
         0 renamed
1316
 
         0 unknown
1317
 
         0 ignored
1318
 
         0 versioned subdirectories
1319
 
 
1320
 
Branch history:
1321
 
         0 revisions
1322
 
 
1323
 
Revision store:
1324
 
         0 revisions
1325
 
         0 KiB
1326
 
""" % (lco_tree.bzrdir.root_transport.base,
1327
 
       lco_tree.branch.bzrdir.root_transport.base,
1328
 
       lco_tree.branch.repository._format.get_format_description(),
1329
 
       ), out)
1330
 
        self.assertEqual('', err)
1331
 
        lco_tree.unlock()
 
1239
        try:
 
1240
            self.assertCheckoutStatusOutput('tree/lightcheckout',
 
1241
            lco_tree,
 
1242
            tree_locked=True,
 
1243
            branch_locked=True,
 
1244
            repo_locked=True)
 
1245
        finally:
 
1246
            lco_tree.unlock()
1332
1247
        # L L U
1333
1248
        lco_tree.lock_write()
1334
1249
        lco_tree.branch.repository.unlock()
1335
 
        out, err = self.runbzr('info tree/lightcheckout')
1336
 
        self.assertEqualDiff(
1337
 
"""Location:
1338
 
  light checkout root: %s
1339
 
   checkout of branch: %s
1340
 
 
1341
 
Format:
1342
 
       control: Meta directory format 1
1343
 
  working tree: Working tree format 3
1344
 
        branch: Branch format 5
1345
 
    repository: %s
1346
 
 
1347
 
Lock status:
1348
 
  working tree: locked
1349
 
        branch: locked
1350
 
    repository: unlocked
1351
 
 
1352
 
In the working tree:
1353
 
         0 unchanged
1354
 
         0 modified
1355
 
         0 added
1356
 
         0 removed
1357
 
         0 renamed
1358
 
         0 unknown
1359
 
         0 ignored
1360
 
         0 versioned subdirectories
1361
 
 
1362
 
Branch history:
1363
 
         0 revisions
1364
 
 
1365
 
Revision store:
1366
 
         0 revisions
1367
 
         0 KiB
1368
 
""" % (lco_tree.bzrdir.root_transport.base,
1369
 
       lco_tree.branch.bzrdir.root_transport.base,
1370
 
       lco_tree.branch.repository._format.get_format_description(),
1371
 
       ), out)
1372
 
        self.assertEqual('', err)
1373
 
        lco_tree.branch.repository.lock_write()
1374
 
        lco_tree.unlock()
 
1250
        try:
 
1251
            self.assertCheckoutStatusOutput('tree/lightcheckout',
 
1252
            lco_tree,
 
1253
            tree_locked=True,
 
1254
            branch_locked=True)
 
1255
        finally:
 
1256
            lco_tree.branch.repository.lock_write()
 
1257
            lco_tree.unlock()
1375
1258
        # L U U
1376
1259
        lco_tree.lock_write()
1377
1260
        lco_tree.branch.unlock()
1378
 
        out, err = self.runbzr('info tree/lightcheckout')
1379
 
        self.assertEqualDiff(
1380
 
"""Location:
1381
 
  light checkout root: %s
1382
 
   checkout of branch: %s
1383
 
 
1384
 
Format:
1385
 
       control: Meta directory format 1
1386
 
  working tree: Working tree format 3
1387
 
        branch: Branch format 5
1388
 
    repository: %s
1389
 
 
1390
 
Lock status:
1391
 
  working tree: locked
1392
 
        branch: unlocked
1393
 
    repository: unlocked
1394
 
 
1395
 
In the working tree:
1396
 
         0 unchanged
1397
 
         0 modified
1398
 
         0 added
1399
 
         0 removed
1400
 
         0 renamed
1401
 
         0 unknown
1402
 
         0 ignored
1403
 
         0 versioned subdirectories
1404
 
 
1405
 
Branch history:
1406
 
         0 revisions
1407
 
 
1408
 
Revision store:
1409
 
         0 revisions
1410
 
         0 KiB
1411
 
""" % (lco_tree.bzrdir.root_transport.base,
1412
 
       lco_tree.branch.bzrdir.root_transport.base,
1413
 
       lco_tree.branch.repository._format.get_format_description(),
1414
 
       ), out)
1415
 
        self.assertEqual('', err)
1416
 
        lco_tree.branch.lock_write()
1417
 
        lco_tree.unlock()
 
1261
        try:
 
1262
            self.assertCheckoutStatusOutput('tree/lightcheckout',
 
1263
            lco_tree,
 
1264
            tree_locked=True)
 
1265
        finally:
 
1266
            lco_tree.branch.lock_write()
 
1267
            lco_tree.unlock()
1418
1268
        # L U L
1419
1269
        lco_tree.lock_write()
1420
1270
        lco_tree.branch.unlock()
1421
1271
        lco_tree.branch.repository.lock_write()
1422
 
        out, err = self.runbzr('info tree/lightcheckout')
1423
 
        self.assertEqualDiff(
1424
 
"""Location:
1425
 
  light checkout root: %s
1426
 
   checkout of branch: %s
1427
 
 
1428
 
Format:
1429
 
       control: Meta directory format 1
1430
 
  working tree: Working tree format 3
1431
 
        branch: Branch format 5
1432
 
    repository: %s
1433
 
 
1434
 
Lock status:
1435
 
  working tree: locked
1436
 
        branch: unlocked
1437
 
    repository: locked
1438
 
 
1439
 
In the working tree:
1440
 
         0 unchanged
1441
 
         0 modified
1442
 
         0 added
1443
 
         0 removed
1444
 
         0 renamed
1445
 
         0 unknown
1446
 
         0 ignored
1447
 
         0 versioned subdirectories
1448
 
 
1449
 
Branch history:
1450
 
         0 revisions
1451
 
 
1452
 
Revision store:
1453
 
         0 revisions
1454
 
         0 KiB
1455
 
""" % (lco_tree.bzrdir.root_transport.base,
1456
 
       lco_tree.branch.bzrdir.root_transport.base,
1457
 
       lco_tree.branch.repository._format.get_format_description(),
1458
 
       ), out)
1459
 
        self.assertEqual('', err)
1460
 
        lco_tree.branch.repository.unlock()
1461
 
        lco_tree.branch.lock_write()
1462
 
        lco_tree.unlock()
 
1272
        try:
 
1273
            self.assertCheckoutStatusOutput('tree/lightcheckout',
 
1274
            lco_tree,
 
1275
            tree_locked=True,
 
1276
            repo_locked=True)
 
1277
        finally:
 
1278
            lco_tree.branch.repository.unlock()
 
1279
            lco_tree.branch.lock_write()
 
1280
            lco_tree.unlock()
1463
1281
        # U L U
1464
1282
        lco_tree.branch.lock_write()
1465
1283
        lco_tree.branch.repository.unlock()
1466
 
        out, err = self.runbzr('info tree/lightcheckout')
1467
 
        self.assertEqualDiff(
1468
 
"""Location:
1469
 
  light checkout root: %s
1470
 
   checkout of branch: %s
1471
 
 
1472
 
Format:
1473
 
       control: Meta directory format 1
1474
 
  working tree: Working tree format 3
1475
 
        branch: Branch format 5
1476
 
    repository: %s
1477
 
 
1478
 
Lock status:
1479
 
  working tree: unlocked
1480
 
        branch: locked
1481
 
    repository: unlocked
1482
 
 
1483
 
In the working tree:
1484
 
         0 unchanged
1485
 
         0 modified
1486
 
         0 added
1487
 
         0 removed
1488
 
         0 renamed
1489
 
         0 unknown
1490
 
         0 ignored
1491
 
         0 versioned subdirectories
1492
 
 
1493
 
Branch history:
1494
 
         0 revisions
1495
 
 
1496
 
Revision store:
1497
 
         0 revisions
1498
 
         0 KiB
1499
 
""" % (lco_tree.bzrdir.root_transport.base,
1500
 
       lco_tree.branch.bzrdir.root_transport.base,
1501
 
       lco_tree.branch.repository._format.get_format_description(),
1502
 
       ), out)
1503
 
        self.assertEqual('', err)
1504
 
        lco_tree.branch.repository.lock_write()
1505
 
        lco_tree.branch.unlock()
 
1284
        try:
 
1285
            self.assertCheckoutStatusOutput('tree/lightcheckout',
 
1286
            lco_tree,
 
1287
            branch_locked=True)
 
1288
        finally:
 
1289
            lco_tree.branch.repository.lock_write()
 
1290
            lco_tree.branch.unlock()
1506
1291
 
1507
1292
    def test_info_locking_oslocks(self):
 
1293
        if sys.platform == "win32":
 
1294
            raise TestSkipped("don't use oslocks on win32 in unix manner")
 
1295
 
1508
1296
        tree = self.make_branch_and_tree('branch',
1509
1297
                                         format=bzrlib.bzrdir.BzrDirFormat6())
1510
1298