~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-01-29 14:09:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4992.
  • Revision ID: mbp@sourcefrog.net-20100129140905-2uiarb6p8di1ywsr
Correction to url

from review: https://code.edge.launchpad.net/~mbp/bzr/doc/+merge/18250

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
25
25
    errors,
26
26
    info,
27
27
    osutils,
28
 
    tests,
29
28
    upgrade,
30
29
    urlutils,
31
30
    )
32
 
from bzrlib.transport import memory
33
 
 
34
 
 
35
 
class TestInfo(tests.TestCaseWithTransport):
 
31
from bzrlib.osutils import format_date
 
32
from bzrlib.tests import TestSkipped, MemoryServer
 
33
from bzrlib.tests.blackbox import ExternalBase
 
34
 
 
35
 
 
36
class TestInfo(ExternalBase):
36
37
 
37
38
    def setUp(self):
38
 
        super(TestInfo, self).setUp()
 
39
        ExternalBase.setUp(self)
39
40
        self._repo_strings = "2a"
40
41
 
41
42
    def test_info_non_existing(self):
42
 
        self.vfs_transport_factory = memory.MemoryServer
 
43
        self.vfs_transport_factory = MemoryServer
43
44
        location = self.get_url()
44
45
        out, err = self.run_bzr('info '+location, retcode=3)
45
46
        self.assertEqual(out, '')
126
127
        self.assertEqual('', err)
127
128
        tree1.commit('commit one')
128
129
        rev = branch1.repository.get_revision(branch1.revision_history()[0])
129
 
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
 
130
        datestring_first = format_date(rev.timestamp, rev.timezone)
130
131
 
131
132
        # Branch standalone with push location
132
133
        branch2 = branch1.bzrdir.sprout('branch').open_branch()
212
213
         0 added
213
214
         0 removed
214
215
         0 renamed
215
 
         0 unknown
216
 
         1 ignored
 
216
         1 unknown
 
217
         0 ignored
217
218
         0 versioned subdirectories
218
219
 
219
220
Branch history:
314
315
        tree1.add('b')
315
316
        tree1.commit('commit two')
316
317
        rev = branch1.repository.get_revision(branch1.revision_history()[-1])
317
 
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
 
318
        datestring_last = format_date(rev.timestamp, rev.timezone)
318
319
 
319
320
        # Out of date branched standalone branch will not be detected
320
321
        out, err = self.run_bzr('info -v branch')
380
381
         0 added
381
382
         0 removed
382
383
         0 renamed
383
 
         0 unknown
384
 
         1 ignored
 
384
         1 unknown
 
385
         0 ignored
385
386
         0 versioned subdirectories
386
387
 
387
388
Branch history:
568
569
        tree2.add('a')
569
570
        tree2.commit('commit one')
570
571
        rev = repo.get_revision(branch2.revision_history()[0])
571
 
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
 
572
        datestring_first = format_date(rev.timestamp, rev.timezone)
572
573
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
573
574
        self.assertEqualDiff(
574
575
"""Lightweight checkout (format: %s)
687
688
 
688
689
        # Out of date lightweight checkout
689
690
        rev = repo.get_revision(branch1.revision_history()[-1])
690
 
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
 
691
        datestring_last = format_date(rev.timestamp, rev.timezone)
691
692
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
692
693
        self.assertEqualDiff(
693
694
"""Lightweight checkout (format: %s)
843
844
        tree1.add('a')
844
845
        tree1.commit('commit one')
845
846
        rev = repo.get_revision(branch1.revision_history()[0])
846
 
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
 
847
        datestring_first = format_date(rev.timestamp, rev.timezone)
847
848
        out, err = self.run_bzr('info -v repo/branch1')
848
849
        self.assertEqualDiff(
849
850
"""Repository tree (format: knit)
1228
1229
        # Do a light checkout of the heavy one
1229
1230
        transport.mkdir('tree/lightcheckout')
1230
1231
        lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1231
 
        branch.BranchReferenceFormat().initialize(lco_dir,
1232
 
            target_branch=co_branch)
 
1232
        branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1233
1233
        lco_dir.create_workingtree()
1234
1234
        lco_tree = lco_dir.open_workingtree()
1235
1235
 
1325
1325
 
1326
1326
    def test_info_locking_oslocks(self):
1327
1327
        if sys.platform == "win32":
1328
 
            self.skip("don't use oslocks on win32 in unix manner")
 
1328
            raise TestSkipped("don't use oslocks on win32 in unix manner")
1329
1329
        # This test tests old (all-in-one, OS lock using) behaviour which
1330
1330
        # simply cannot work on windows (and is indeed why we changed our
1331
1331
        # design. As such, don't try to remove the thisFailsStrictLockCheck