~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-19 08:31:08 UTC
  • mfrom: (1666.1.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060419083108-fab2970f4575b010
Change the default branch format to be metadir. (Robert Collins, Aaron Bentley).

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from bzrlib.branch import Branch
7
7
from bzrlib.tests import TestCaseInTempDir
8
8
 
 
9
 
9
10
class TestMissing(TestCaseInTempDir):
 
11
 
10
12
    def test_missing(self):
11
13
        missing = "You are missing 1 revision(s):"
12
14
 
24
26
        open('a', 'ab').write('more\n')
25
27
        self.capture('commit -m more')
26
28
 
27
 
        # compare a against b
 
29
        # run missing in a against b
28
30
        os.chdir('../a')
29
 
        lines = self.capture('missing ../b', retcode=1).splitlines()
 
31
        # this should not require missing to take out a write lock on a 
 
32
        # or b. So we take a write lock on both to test that at the same
 
33
        # time. This may let the test pass while the default branch is an
 
34
        # os-locking branch, but it will trigger failures with lockdir based
 
35
        # branches.
 
36
        branch_a = Branch.open('.')
 
37
        branch_a.lock_write()
 
38
        branch_b = Branch.open('../b')
 
39
        branch_b.lock_write()
 
40
        out,err = self.run_bzr('missing', '../b', retcode=1)
 
41
        lines = out.splitlines()
30
42
        # we're missing the extra revision here
31
43
        self.assertEqual(missing, lines[0])
 
44
        # and we expect 8 lines of output which we trust at the moment to be
 
45
        # good.
32
46
        self.assertEqual(8, len(lines))
 
47
        # we do not expect any error output.
 
48
        self.assertEqual('', err)
 
49
        # unlock the branches for the rest of the test
 
50
        branch_a.unlock()
 
51
        branch_b.unlock()
33
52
 
34
53
        # get extra revision from b
35
54
        self.capture('merge ../b')