~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisionnamespaces.py

  • Committer: Martin Pool
  • Date: 2006-03-06 11:20:10 UTC
  • mfrom: (1593 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060306112010-17c0170dde5d1eea
[merge] large merge to sync with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.errors import NoCommonAncestor, NoCommits
24
24
from bzrlib.errors import NoSuchRevision
25
25
from bzrlib.revisionspec import RevisionSpec
26
 
from bzrlib.workingtree import WorkingTree
27
26
 
28
27
 
29
28
class TestRevisionNamespaces(TestCaseWithTransport):
70
69
        b2 = wt2.branch
71
70
        self.assertRaises(NoCommits, RevisionSpec('ancestor:.').in_history, b2)
72
71
 
73
 
        os.mkdir('copy')
74
 
        b3 = b.clone('copy')
75
 
        wt3 = WorkingTree('copy', b3)
 
72
        d3 = b.bzrdir.sprout('copy')
 
73
        b3 = d3.open_branch()
 
74
        wt3 = d3.open_workingtree()
76
75
        wt3.commit('Commit four', rev_id='b@r-0-4')
77
76
        self.assertEquals(RevisionSpec('ancestor:.').in_history(b3).rev_id,
78
77
                          'a@r-0-3')
94
93
        branch = wt.branch
95
94
        wt.add(['file'])
96
95
        wt.commit('add file')
97
 
        branch.clone('branch2')
 
96
        d2 = branch.bzrdir.sprout('branch2')
98
97
        print >> open('branch2/file', 'w'), 'new content'
99
 
        branch2 = Branch.open('branch2')
100
 
        WorkingTree('branch2', branch2).commit('update file', rev_id='A')
 
98
        branch2 = d2.open_branch()
 
99
        d2.open_workingtree().commit('update file', rev_id='A')
101
100
        spec = RevisionSpec('branch:./branch2/.bzr/../')
102
101
        rev_info = spec.in_history(branch)
103
102
        self.assertEqual(rev_info, (None, 'A'))