~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-03 20:18:35 UTC
  • mfrom: (1185.82.137 w-changeset)
  • Revision ID: pqm@pqm.ubuntu.com-20060603201835-1c9a1725641ccd24
Implement bundles

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2006 by Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
 
#
 
3
 
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
6
6
# the Free Software Foundation; either version 2 of the License, or
7
7
# (at your option) any later version.
8
 
#
 
8
 
9
9
# This program is distributed in the hope that it will be useful,
10
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
# GNU General Public License for more details.
13
 
#
 
13
 
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
 
19
19
"""Tests for the info command of bzr."""
20
20
 
21
 
import sys
22
21
 
23
22
import bzrlib
 
23
 
 
24
 
24
25
from bzrlib.osutils import format_date
25
26
from bzrlib.tests import TestSkipped
26
27
from bzrlib.tests.blackbox import ExternalBase
29
30
class TestInfo(ExternalBase):
30
31
 
31
32
    def test_info_non_existing(self):
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)
 
33
        out, err = self.runbzr('info /i/do/not/exist/', retcode=3)
37
34
        self.assertEqual(out, '')
38
 
        self.assertEqual(err, 'bzr: ERROR: Not a branch: %s\n' % location)
 
35
        self.assertEqual(err, 'bzr: ERROR: Not a branch: /i/do/not/exist/\n')
39
36
 
40
37
    def test_info_standalone(self):
41
38
        transport = self.get_transport()
136
133
        bzrlib.upgrade.upgrade('bound', bzrlib.bzrdir.BzrDirMetaFormat1())
137
134
        branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
138
135
        branch3.bind(branch1)
139
 
        bound_tree = branch3.bzrdir.open_workingtree()
140
136
        out, err = self.runbzr('info bound')
141
137
        self.assertEqualDiff(
142
138
"""Location:
148
144
 
149
145
Format:
150
146
       control: Meta directory format 1
151
 
  working tree: %s
 
147
  working tree: Working tree format 3
152
148
        branch: Branch format 5
153
149
    repository: %s
154
150
 
174
170
""" % (branch3.bzrdir.root_transport.base,
175
171
       branch1.bzrdir.root_transport.base,
176
172
       branch1.bzrdir.root_transport.base,
177
 
       bound_tree._format.get_format_description(),      
178
173
       branch3.repository._format.get_format_description(),
179
174
       datestring_first, datestring_first,
180
175
       # poking at _revision_store isn't all that clean, but neither is
247
242
        out, err = self.runbzr('info lightcheckout')
248
243
        self.assertEqualDiff(
249
244
"""Location:
250
 
 light checkout root: %s
251
 
  checkout of branch: %s
 
245
  light checkout root: %s
 
246
   checkout of branch: %s
252
247
 
253
248
Format:
254
249
       control: Meta directory format 1
428
423
        out, err = self.runbzr('info lightcheckout --verbose')
429
424
        self.assertEqualDiff(
430
425
"""Location:
431
 
 light checkout root: %s
432
 
  checkout of branch: %s
 
426
  light checkout root: %s
 
427
   checkout of branch: %s
433
428
 
434
429
Format:
435
430
       control: Meta directory format 1
548
543
        dir2.create_workingtree()
549
544
        tree2 = dir2.open_workingtree()
550
545
        branch2 = tree2.branch
551
 
        self.assertCheckoutStatusOutput('tree/lightcheckout', tree2, shared_repo=repo)
 
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)
552
580
 
553
581
        # Create normal checkout
554
 
        tree3 = branch1.create_checkout('tree/checkout')
555
 
        self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
556
 
            verbose=True,
557
 
            light_checkout=False, repo_branch=branch1)
 
582
        branch3 = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout')
 
583
        branch3.bind(branch1)
 
584
        tree3 = branch3.bzrdir.open_workingtree()
 
585
        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
621
        # Update lightweight checkout
559
622
        self.build_tree(['tree/lightcheckout/a'])
560
623
        tree2.add('a')
564
627
        out, err = self.runbzr('info tree/lightcheckout --verbose')
565
628
        self.assertEqualDiff(
566
629
"""Location:
567
 
 light checkout root: %s
568
 
   shared repository: %s
569
 
   repository branch: branch
 
630
  light checkout root: %s
 
631
    shared repository: %s
 
632
    repository branch: branch
570
633
 
571
634
Format:
572
635
       control: Meta directory format 1
693
756
        out, err = self.runbzr('info tree/lightcheckout --verbose')
694
757
        self.assertEqualDiff(
695
758
"""Location:
696
 
 light checkout root: %s
697
 
   shared repository: %s
698
 
   repository branch: branch
 
759
  light checkout root: %s
 
760
    shared repository: %s
 
761
    repository branch: branch
699
762
 
700
763
Format:
701
764
       control: Meta directory format 1
1084
1147
 
1085
1148
        bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
1086
1149
 
1087
 
    def assertCheckoutStatusOutput(self, 
1088
 
        command_string, lco_tree, shared_repo=None,
1089
 
        repo_branch=None,
1090
 
        tree_locked=False,
1091
 
        branch_locked=False, repo_locked=False,
1092
 
        verbose=False,
1093
 
        light_checkout=True):
1094
 
        """Check the output of info in a light checkout tree.
1095
 
 
1096
 
        This is not quite a mirror of the info code: rather than using the
1097
 
        tree being examined to predict output, it uses a bunch of flags which
1098
 
        allow us, the test writers, to document what *should* be present in
1099
 
        the output. Removing this separation would remove the value of the
1100
 
        tests.
1101
 
        
1102
 
        :param path: the path to the light checkout.
1103
 
        :param lco_tree: the tree object for the light checkout.
1104
 
        :param shared_repo: A shared repository is in use, expect that in
1105
 
            the output.
1106
 
        :param repo_branch: A branch in a shared repository for non light
1107
 
            checkouts.
1108
 
        :param tree_locked: If true, expect the tree to be locked.
1109
 
        :param branch_locked: If true, expect the branch to be locked.
1110
 
        :param repo_locked: If true, expect the repository to be locked.
1111
 
        :param verbose: If true, expect verbose output
1112
 
        """
1113
 
        out, err = self.runbzr('info %s' % command_string)
1114
 
        if repo_locked or branch_locked or tree_locked:
1115
 
            def locked_message(a_bool):
1116
 
                if a_bool:
1117
 
                    return 'locked'
1118
 
                else:
1119
 
                    return 'unlocked'
1120
 
            expected_lock_output = (
1121
 
                "\n"
1122
 
                "Lock status:\n"
1123
 
                "  working tree: %s\n"
1124
 
                "        branch: %s\n"
1125
 
                "    repository: %s\n" % (
1126
 
                    locked_message(tree_locked),
1127
 
                    locked_message(branch_locked),
1128
 
                    locked_message(repo_locked)))
1129
 
        else:
1130
 
            expected_lock_output = ''
1131
 
        if light_checkout:
1132
 
            tree_data = (" light checkout root: %s" %
1133
 
                lco_tree.bzrdir.root_transport.base)
1134
 
        else:
1135
 
            tree_data = ("       checkout root: %s" %
1136
 
                lco_tree.bzrdir.root_transport.base)
1137
 
        if shared_repo is not None:
1138
 
            branch_data = (
1139
 
                "   shared repository: %s\n"
1140
 
                "   repository branch: branch\n" %
1141
 
                shared_repo.bzrdir.root_transport.base)
1142
 
        elif repo_branch is not None:
1143
 
            branch_data = (
1144
 
                "  checkout of branch: %s\n" % 
1145
 
                repo_branch.bzrdir.root_transport.base)
1146
 
        else:
1147
 
            branch_data = ("  checkout of branch: %s\n" % 
1148
 
                lco_tree.branch.bzrdir.root_transport.base)
1149
 
        
1150
 
        if verbose:
1151
 
            verbose_info = '         0 committers\n'
1152
 
        else:
1153
 
            verbose_info = ''
1154
 
            
1155
 
        self.assertEqualDiff(
1156
 
"""Location:
1157
 
%s
1158
 
%s
1159
 
Format:
1160
 
       control: Meta directory format 1
1161
 
  working tree: %s
1162
 
        branch: Branch format 5
1163
 
    repository: %s
1164
 
%s
1165
 
In the working tree:
1166
 
         0 unchanged
1167
 
         0 modified
1168
 
         0 added
1169
 
         0 removed
1170
 
         0 renamed
1171
 
         0 unknown
1172
 
         0 ignored
1173
 
         0 versioned subdirectories
1174
 
 
1175
 
Branch history:
1176
 
         0 revisions
1177
 
%s
1178
 
Revision store:
1179
 
         0 revisions
1180
 
         0 KiB
1181
 
""" %  (tree_data,
1182
 
        branch_data,
1183
 
        lco_tree._format.get_format_description(),
1184
 
        lco_tree.branch.repository._format.get_format_description(),
1185
 
        expected_lock_output,
1186
 
        verbose_info,
1187
 
        ), out)
1188
 
        self.assertEqual('', err)
1189
 
 
1190
1150
    def test_info_locking(self):
1191
1151
        transport = self.get_transport()
1192
1152
        # Create shared repository with a branch
1213
1173
        # W B R
1214
1174
 
1215
1175
        # U U U
1216
 
        self.assertCheckoutStatusOutput('tree/lightcheckout', lco_tree)
 
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)
1217
1209
        # U U L
1218
1210
        lco_tree.branch.repository.lock_write()
1219
 
        try:
1220
 
            self.assertCheckoutStatusOutput('tree/lightcheckout',
1221
 
            lco_tree,
1222
 
            repo_locked=True)
1223
 
        finally:
1224
 
            lco_tree.branch.repository.unlock()
 
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()
1225
1250
        # U L L
1226
1251
        lco_tree.branch.lock_write()
1227
 
        try:
1228
 
            self.assertCheckoutStatusOutput('tree/lightcheckout',
1229
 
            lco_tree,
1230
 
            branch_locked=True,
1231
 
            repo_locked=True)
1232
 
        finally:
1233
 
            lco_tree.branch.unlock()
 
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()
1234
1291
        # L L L
1235
1292
        lco_tree.lock_write()
1236
 
        try:
1237
 
            self.assertCheckoutStatusOutput('tree/lightcheckout',
1238
 
            lco_tree,
1239
 
            tree_locked=True,
1240
 
            branch_locked=True,
1241
 
            repo_locked=True)
1242
 
        finally:
1243
 
            lco_tree.unlock()
 
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()
1244
1332
        # L L U
1245
1333
        lco_tree.lock_write()
1246
1334
        lco_tree.branch.repository.unlock()
1247
 
        try:
1248
 
            self.assertCheckoutStatusOutput('tree/lightcheckout',
1249
 
            lco_tree,
1250
 
            tree_locked=True,
1251
 
            branch_locked=True)
1252
 
        finally:
1253
 
            lco_tree.branch.repository.lock_write()
1254
 
            lco_tree.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()
1255
1375
        # L U U
1256
1376
        lco_tree.lock_write()
1257
1377
        lco_tree.branch.unlock()
1258
 
        try:
1259
 
            self.assertCheckoutStatusOutput('tree/lightcheckout',
1260
 
            lco_tree,
1261
 
            tree_locked=True)
1262
 
        finally:
1263
 
            lco_tree.branch.lock_write()
1264
 
            lco_tree.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()
1265
1418
        # L U L
1266
1419
        lco_tree.lock_write()
1267
1420
        lco_tree.branch.unlock()
1268
1421
        lco_tree.branch.repository.lock_write()
1269
 
        try:
1270
 
            self.assertCheckoutStatusOutput('tree/lightcheckout',
1271
 
            lco_tree,
1272
 
            tree_locked=True,
1273
 
            repo_locked=True)
1274
 
        finally:
1275
 
            lco_tree.branch.repository.unlock()
1276
 
            lco_tree.branch.lock_write()
1277
 
            lco_tree.unlock()
 
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()
1278
1463
        # U L U
1279
1464
        lco_tree.branch.lock_write()
1280
1465
        lco_tree.branch.repository.unlock()
1281
 
        try:
1282
 
            self.assertCheckoutStatusOutput('tree/lightcheckout',
1283
 
            lco_tree,
1284
 
            branch_locked=True)
1285
 
        finally:
1286
 
            lco_tree.branch.repository.lock_write()
1287
 
            lco_tree.branch.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()
1288
1506
 
1289
1507
    def test_info_locking_oslocks(self):
1290
 
        if sys.platform == "win32":
1291
 
            raise TestSkipped("don't use oslocks on win32 in unix manner")
1292
 
 
1293
1508
        tree = self.make_branch_and_tree('branch',
1294
1509
                                         format=bzrlib.bzrdir.BzrDirFormat6())
1295
1510