~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: 2010-03-02 08:49:07 UTC
  • mfrom: (5067.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100302084907-z4r0yoa4ldspjz82
(vila) Resolve --take-this or --take-other correctly rename kept file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006-2010 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,
28
29
    upgrade,
29
30
    urlutils,
30
31
    )
31
 
from bzrlib.osutils import format_date
32
 
from bzrlib.tests import TestSkipped
33
 
from bzrlib.tests.blackbox import ExternalBase
34
 
 
35
 
 
36
 
class TestInfo(ExternalBase):
 
32
from bzrlib.transport import memory
 
33
 
 
34
 
 
35
class TestInfo(tests.TestCaseWithTransport):
37
36
 
38
37
    def setUp(self):
39
 
        ExternalBase.setUp(self)
40
 
        self._repo_strings = "2a or development-subtree"
 
38
        super(TestInfo, self).setUp()
 
39
        self._repo_strings = "2a"
41
40
 
42
41
    def test_info_non_existing(self):
43
 
        if sys.platform == "win32":
44
 
            location = "C:/i/do/not/exist/"
45
 
        else:
46
 
            location = "/i/do/not/exist/"
 
42
        self.vfs_transport_factory = memory.MemoryServer
 
43
        location = self.get_url()
47
44
        out, err = self.run_bzr('info '+location, retcode=3)
48
45
        self.assertEqual(out, '')
49
46
        self.assertEqual(err, 'bzr: ERROR: Not a branch: "%s".\n' % location)
129
126
        self.assertEqual('', err)
130
127
        tree1.commit('commit one')
131
128
        rev = branch1.repository.get_revision(branch1.revision_history()[0])
132
 
        datestring_first = format_date(rev.timestamp, rev.timezone)
 
129
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
133
130
 
134
131
        # Branch standalone with push location
135
132
        branch2 = branch1.bzrdir.sprout('branch').open_branch()
215
212
         0 added
216
213
         0 removed
217
214
         0 renamed
218
 
         1 unknown
219
 
         0 ignored
 
215
         0 unknown
 
216
         1 ignored
220
217
         0 versioned subdirectories
221
218
 
222
219
Branch history:
317
314
        tree1.add('b')
318
315
        tree1.commit('commit two')
319
316
        rev = branch1.repository.get_revision(branch1.revision_history()[-1])
320
 
        datestring_last = format_date(rev.timestamp, rev.timezone)
 
317
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
321
318
 
322
319
        # Out of date branched standalone branch will not be detected
323
320
        out, err = self.run_bzr('info -v branch')
383
380
         0 added
384
381
         0 removed
385
382
         0 renamed
386
 
         1 unknown
387
 
         0 ignored
 
383
         0 unknown
 
384
         1 ignored
388
385
         0 versioned subdirectories
389
386
 
390
387
Branch history:
571
568
        tree2.add('a')
572
569
        tree2.commit('commit one')
573
570
        rev = repo.get_revision(branch2.revision_history()[0])
574
 
        datestring_first = format_date(rev.timestamp, rev.timezone)
 
571
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
575
572
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
576
573
        self.assertEqualDiff(
577
574
"""Lightweight checkout (format: %s)
690
687
 
691
688
        # Out of date lightweight checkout
692
689
        rev = repo.get_revision(branch1.revision_history()[-1])
693
 
        datestring_last = format_date(rev.timestamp, rev.timezone)
 
690
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
694
691
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
695
692
        self.assertEqualDiff(
696
693
"""Lightweight checkout (format: %s)
846
843
        tree1.add('a')
847
844
        tree1.commit('commit one')
848
845
        rev = repo.get_revision(branch1.revision_history()[0])
849
 
        datestring_first = format_date(rev.timestamp, rev.timezone)
 
846
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
850
847
        out, err = self.run_bzr('info -v repo/branch1')
851
848
        self.assertEqualDiff(
852
849
"""Repository tree (format: knit)
1328
1325
    def test_info_locking_oslocks(self):
1329
1326
        if sys.platform == "win32":
1330
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.
1331
1332
        self.thisFailsStrictLockCheck()
1332
1333
 
1333
1334
        tree = self.make_branch_and_tree('branch',