~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: 2010-02-25 06:17:27 UTC
  • mfrom: (5055 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5057.
  • Revision ID: mbp@sourcefrog.net-20100225061727-4sd9lt0qmdc6087t
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        transport = self.get_transport()
50
50
 
51
51
        # Create initial standalone branch
52
 
        tree1 = self.make_branch_and_tree('standalone', 'knit')
 
52
        tree1 = self.make_branch_and_tree('standalone', 'weave')
53
53
        self.build_tree(['standalone/a'])
54
54
        tree1.add('a')
55
55
        branch1 = tree1.branch
56
56
 
57
57
        out, err = self.run_bzr('info standalone')
58
58
        self.assertEqualDiff(
59
 
"""Standalone tree (format: knit)
 
59
"""Standalone tree (format: weave)
60
60
Location:
61
61
  branch root: standalone
62
62
""", out)
65
65
        # Standalone branch - verbose mode
66
66
        out, err = self.run_bzr('info standalone -v')
67
67
        self.assertEqualDiff(
68
 
"""Standalone tree (format: knit)
 
68
"""Standalone tree (format: weave)
69
69
Location:
70
70
  branch root: standalone
71
71
 
72
72
Format:
73
 
       control: Meta directory format 1
74
 
  working tree: Working tree format 3
75
 
        branch: Branch format 5
76
 
    repository: Knit repository format 1
 
73
       control: All-in-one format 6
 
74
  working tree: Working tree format 2
 
75
        branch: Branch format 4
 
76
    repository: Weave repository format 6
77
77
 
78
78
In the working tree:
79
79
         0 unchanged
96
96
        # Standalone branch - really verbose mode
97
97
        out, err = self.run_bzr('info standalone -vv')
98
98
        self.assertEqualDiff(
99
 
"""Standalone tree (format: knit)
 
99
"""Standalone tree (format: weave)
100
100
Location:
101
101
  branch root: standalone
102
102
 
103
103
Format:
104
 
       control: Meta directory format 1
105
 
  working tree: Working tree format 3
106
 
        branch: Branch format 5
107
 
    repository: Knit repository format 1
 
104
       control: All-in-one format 6
 
105
  working tree: Working tree format 2
 
106
        branch: Branch format 4
 
107
    repository: Weave repository format 6
108
108
 
109
109
In the working tree:
110
110
         0 unchanged
134
134
 
135
135
        out, err = self.run_bzr('info branch')
136
136
        self.assertEqualDiff(
137
 
"""Standalone tree (format: knit)
 
137
"""Standalone tree (format: weave)
138
138
Location:
139
139
  branch root: branch
140
140
 
146
146
 
147
147
        out, err = self.run_bzr('info branch --verbose')
148
148
        self.assertEqualDiff(
149
 
"""Standalone tree (format: knit)
 
149
"""Standalone tree (format: weave)
150
150
Location:
151
151
  branch root: branch
152
152
 
155
155
  parent branch: standalone
156
156
 
157
157
Format:
158
 
       control: Meta directory format 1
159
 
  working tree: Working tree format 3
160
 
        branch: Branch format 5
161
 
    repository: Knit repository format 1
 
158
       control: All-in-one format 6
 
159
  working tree: Working tree format 2
 
160
        branch: Branch format 4
 
161
    repository: Weave repository format 6
162
162
 
163
163
In the working tree:
164
164
         1 unchanged
213
213
         0 removed
214
214
         0 renamed
215
215
         0 unknown
216
 
         0 ignored
 
216
         1 ignored
217
217
         0 versioned subdirectories
218
218
 
219
219
Branch history:
276
276
        tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
277
277
        branch5 = tree5.branch
278
278
        out, err = self.run_bzr('info -v lightcheckout')
279
 
        if "metaweave" in bzrdir.format_registry:
280
 
            format_description = "knit or metaweave"
281
 
        else:
282
 
            format_description = "knit"
283
279
        self.assertEqualDiff(
284
280
"""Lightweight checkout (format: %s)
285
281
Location:
288
284
 
289
285
Format:
290
286
       control: Meta directory format 1
291
 
  working tree: Working tree format 3
292
 
        branch: Branch format 5
293
 
    repository: Knit repository format 1
 
287
  working tree: Working tree format 6
 
288
        branch: Branch format 4
 
289
    repository: Weave repository format 6
294
290
 
295
291
In the working tree:
296
292
         1 unchanged
310
306
 
311
307
Repository:
312
308
         1 revision
313
 
""" % (format_description, datestring_first, datestring_first,), out)
 
309
""" % (self._repo_strings, datestring_first, datestring_first,), out)
314
310
        self.assertEqual('', err)
315
311
 
316
312
        # Update initial standalone branch
323
319
        # Out of date branched standalone branch will not be detected
324
320
        out, err = self.run_bzr('info -v branch')
325
321
        self.assertEqualDiff(
326
 
"""Standalone tree (format: knit)
 
322
"""Standalone tree (format: weave)
327
323
Location:
328
324
  branch root: branch
329
325
 
332
328
  parent branch: standalone
333
329
 
334
330
Format:
335
 
       control: Meta directory format 1
336
 
  working tree: Working tree format 3
337
 
        branch: Branch format 5
338
 
    repository: Knit repository format 1
 
331
       control: All-in-one format 6
 
332
  working tree: Working tree format 2
 
333
        branch: Branch format 4
 
334
    repository: Weave repository format 6
339
335
 
340
336
In the working tree:
341
337
         1 unchanged
385
381
         0 removed
386
382
         0 renamed
387
383
         0 unknown
388
 
         0 ignored
 
384
         1 ignored
389
385
         0 versioned subdirectories
390
386
 
391
387
Branch history:
450
446
 
451
447
Format:
452
448
       control: Meta directory format 1
453
 
  working tree: Working tree format 3
454
 
        branch: Branch format 5
455
 
    repository: Knit repository format 1
 
449
  working tree: Working tree format 6
 
450
        branch: Branch format 4
 
451
    repository: Weave repository format 6
456
452
 
457
453
Working tree is out of date: missing 1 revision.
458
454
 
474
470
 
475
471
Repository:
476
472
         2 revisions
477
 
""" % (format_description, datestring_first, datestring_last,), out)
 
473
""" % (self._repo_strings, datestring_first, datestring_last,), out)
478
474
        self.assertEqual('', err)
479
475
 
480
476
    def test_info_standalone_no_tree(self):
1232
1228
        # Do a light checkout of the heavy one
1233
1229
        transport.mkdir('tree/lightcheckout')
1234
1230
        lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1235
 
        branch.BranchReferenceFormat().initialize(lco_dir,
1236
 
            target_branch=co_branch)
 
1231
        branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1237
1232
        lco_dir.create_workingtree()
1238
1233
        lco_tree = lco_dir.open_workingtree()
1239
1234
 
1327
1322
            self.knownFailure('Win32 cannot run "bzr info"'
1328
1323
                              ' when the tree is locked.')
1329
1324
 
 
1325
    def test_info_locking_oslocks(self):
 
1326
        if sys.platform == "win32":
 
1327
            raise TestSkipped("don't use oslocks on win32 in unix manner")
 
1328
        # This test tests old (all-in-one, OS lock using) behaviour which
 
1329
        # simply cannot work on windows (and is indeed why we changed our
 
1330
        # design. As such, don't try to remove the thisFailsStrictLockCheck
 
1331
        # call here.
 
1332
        self.thisFailsStrictLockCheck()
 
1333
 
 
1334
        tree = self.make_branch_and_tree('branch',
 
1335
                                         format=bzrdir.BzrDirFormat6())
 
1336
 
 
1337
        # Test all permutations of locking the working tree, branch and repository
 
1338
        # XXX: Well not yet, as we can't query oslocks yet. Currently, it's
 
1339
        # implemented by raising NotImplementedError and get_physical_lock_status()
 
1340
        # always returns false. This makes bzr info hide the lock status.  (Olaf)
 
1341
        # W B R
 
1342
 
 
1343
        # U U U
 
1344
        out, err = self.run_bzr('info -v branch')
 
1345
        self.assertEqualDiff(
 
1346
"""Standalone tree (format: weave)
 
1347
Location:
 
1348
  branch root: %s
 
1349
 
 
1350
Format:
 
1351
       control: All-in-one format 6
 
1352
  working tree: Working tree format 2
 
1353
        branch: Branch format 4
 
1354
    repository: %s
 
1355
 
 
1356
In the working tree:
 
1357
         0 unchanged
 
1358
         0 modified
 
1359
         0 added
 
1360
         0 removed
 
1361
         0 renamed
 
1362
         0 unknown
 
1363
         0 ignored
 
1364
         0 versioned subdirectories
 
1365
 
 
1366
Branch history:
 
1367
         0 revisions
 
1368
 
 
1369
Repository:
 
1370
         0 revisions
 
1371
""" % ('branch', tree.branch.repository._format.get_format_description(),
 
1372
       ), out)
 
1373
        self.assertEqual('', err)
 
1374
        # L L L
 
1375
        tree.lock_write()
 
1376
        out, err = self.run_bzr('info -v branch')
 
1377
        self.assertEqualDiff(
 
1378
"""Standalone tree (format: weave)
 
1379
Location:
 
1380
  branch root: %s
 
1381
 
 
1382
Format:
 
1383
       control: All-in-one format 6
 
1384
  working tree: Working tree format 2
 
1385
        branch: Branch format 4
 
1386
    repository: %s
 
1387
 
 
1388
In the working tree:
 
1389
         0 unchanged
 
1390
         0 modified
 
1391
         0 added
 
1392
         0 removed
 
1393
         0 renamed
 
1394
         0 unknown
 
1395
         0 ignored
 
1396
         0 versioned subdirectories
 
1397
 
 
1398
Branch history:
 
1399
         0 revisions
 
1400
 
 
1401
Repository:
 
1402
         0 revisions
 
1403
""" % ('branch', tree.branch.repository._format.get_format_description(),
 
1404
       ), out)
 
1405
        self.assertEqual('', err)
 
1406
        tree.unlock()
 
1407
 
1330
1408
    def test_info_stacked(self):
1331
1409
        # We have a mainline
1332
1410
        trunk_tree = self.make_branch_and_tree('mainline',