~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

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', 'weave')
 
52
        tree1 = self.make_branch_and_tree('standalone', 'knit')
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: weave)
 
59
"""Standalone tree (format: knit)
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: weave)
 
68
"""Standalone tree (format: knit)
69
69
Location:
70
70
  branch root: standalone
71
71
 
72
72
Format:
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
 
73
       control: Meta directory format 1
 
74
  working tree: Working tree format 3
 
75
        branch: Branch format 5
 
76
    repository: Knit repository format 1
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: weave)
 
99
"""Standalone tree (format: knit)
100
100
Location:
101
101
  branch root: standalone
102
102
 
103
103
Format:
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
 
104
       control: Meta directory format 1
 
105
  working tree: Working tree format 3
 
106
        branch: Branch format 5
 
107
    repository: Knit repository format 1
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: weave)
 
137
"""Standalone tree (format: knit)
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: weave)
 
149
"""Standalone tree (format: knit)
150
150
Location:
151
151
  branch root: branch
152
152
 
155
155
  parent branch: standalone
156
156
 
157
157
Format:
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
 
158
       control: Meta directory format 1
 
159
  working tree: Working tree format 3
 
160
        branch: Branch format 5
 
161
    repository: Knit repository format 1
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
 
         1 ignored
 
216
         0 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"
279
283
        self.assertEqualDiff(
280
284
"""Lightweight checkout (format: %s)
281
285
Location:
284
288
 
285
289
Format:
286
290
       control: Meta directory format 1
287
 
  working tree: Working tree format 6
288
 
        branch: Branch format 4
289
 
    repository: Weave repository format 6
 
291
  working tree: Working tree format 3
 
292
        branch: Branch format 5
 
293
    repository: Knit repository format 1
290
294
 
291
295
In the working tree:
292
296
         1 unchanged
306
310
 
307
311
Repository:
308
312
         1 revision
309
 
""" % (self._repo_strings, datestring_first, datestring_first,), out)
 
313
""" % (format_description, datestring_first, datestring_first,), out)
310
314
        self.assertEqual('', err)
311
315
 
312
316
        # Update initial standalone branch
319
323
        # Out of date branched standalone branch will not be detected
320
324
        out, err = self.run_bzr('info -v branch')
321
325
        self.assertEqualDiff(
322
 
"""Standalone tree (format: weave)
 
326
"""Standalone tree (format: knit)
323
327
Location:
324
328
  branch root: branch
325
329
 
328
332
  parent branch: standalone
329
333
 
330
334
Format:
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
 
335
       control: Meta directory format 1
 
336
  working tree: Working tree format 3
 
337
        branch: Branch format 5
 
338
    repository: Knit repository format 1
335
339
 
336
340
In the working tree:
337
341
         1 unchanged
381
385
         0 removed
382
386
         0 renamed
383
387
         0 unknown
384
 
         1 ignored
 
388
         0 ignored
385
389
         0 versioned subdirectories
386
390
 
387
391
Branch history:
446
450
 
447
451
Format:
448
452
       control: Meta directory format 1
449
 
  working tree: Working tree format 6
450
 
        branch: Branch format 4
451
 
    repository: Weave repository format 6
 
453
  working tree: Working tree format 3
 
454
        branch: Branch format 5
 
455
    repository: Knit repository format 1
452
456
 
453
457
Working tree is out of date: missing 1 revision.
454
458
 
470
474
 
471
475
Repository:
472
476
         2 revisions
473
 
""" % (self._repo_strings, datestring_first, datestring_last,), out)
 
477
""" % (format_description, datestring_first, datestring_last,), out)
474
478
        self.assertEqual('', err)
475
479
 
476
480
    def test_info_standalone_no_tree(self):
1323
1327
            self.knownFailure('Win32 cannot run "bzr info"'
1324
1328
                              ' when the tree is locked.')
1325
1329
 
1326
 
    def test_info_locking_oslocks(self):
1327
 
        if sys.platform == "win32":
1328
 
            self.skip("don't use oslocks on win32 in unix manner")
1329
 
        # This test tests old (all-in-one, OS lock using) behaviour which
1330
 
        # simply cannot work on windows (and is indeed why we changed our
1331
 
        # design. As such, don't try to remove the thisFailsStrictLockCheck
1332
 
        # call here.
1333
 
        self.thisFailsStrictLockCheck()
1334
 
 
1335
 
        tree = self.make_branch_and_tree('branch',
1336
 
                                         format=bzrdir.BzrDirFormat6())
1337
 
 
1338
 
        # Test all permutations of locking the working tree, branch and repository
1339
 
        # XXX: Well not yet, as we can't query oslocks yet. Currently, it's
1340
 
        # implemented by raising NotImplementedError and get_physical_lock_status()
1341
 
        # always returns false. This makes bzr info hide the lock status.  (Olaf)
1342
 
        # W B R
1343
 
 
1344
 
        # U U U
1345
 
        out, err = self.run_bzr('info -v branch')
1346
 
        self.assertEqualDiff(
1347
 
"""Standalone tree (format: weave)
1348
 
Location:
1349
 
  branch root: %s
1350
 
 
1351
 
Format:
1352
 
       control: All-in-one format 6
1353
 
  working tree: Working tree format 2
1354
 
        branch: Branch format 4
1355
 
    repository: %s
1356
 
 
1357
 
In the working tree:
1358
 
         0 unchanged
1359
 
         0 modified
1360
 
         0 added
1361
 
         0 removed
1362
 
         0 renamed
1363
 
         0 unknown
1364
 
         0 ignored
1365
 
         0 versioned subdirectories
1366
 
 
1367
 
Branch history:
1368
 
         0 revisions
1369
 
 
1370
 
Repository:
1371
 
         0 revisions
1372
 
""" % ('branch', tree.branch.repository._format.get_format_description(),
1373
 
       ), out)
1374
 
        self.assertEqual('', err)
1375
 
        # L L L
1376
 
        tree.lock_write()
1377
 
        out, err = self.run_bzr('info -v branch')
1378
 
        self.assertEqualDiff(
1379
 
"""Standalone tree (format: weave)
1380
 
Location:
1381
 
  branch root: %s
1382
 
 
1383
 
Format:
1384
 
       control: All-in-one format 6
1385
 
  working tree: Working tree format 2
1386
 
        branch: Branch format 4
1387
 
    repository: %s
1388
 
 
1389
 
In the working tree:
1390
 
         0 unchanged
1391
 
         0 modified
1392
 
         0 added
1393
 
         0 removed
1394
 
         0 renamed
1395
 
         0 unknown
1396
 
         0 ignored
1397
 
         0 versioned subdirectories
1398
 
 
1399
 
Branch history:
1400
 
         0 revisions
1401
 
 
1402
 
Repository:
1403
 
         0 revisions
1404
 
""" % ('branch', tree.branch.repository._format.get_format_description(),
1405
 
       ), out)
1406
 
        self.assertEqual('', err)
1407
 
        tree.unlock()
1408
 
 
1409
1330
    def test_info_stacked(self):
1410
1331
        # We have a mainline
1411
1332
        trunk_tree = self.make_branch_and_tree('mainline',