~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevisionnamespaces.py

  • Committer: Aaron Bentley
  • Date: 2005-10-04 04:32:32 UTC
  • mfrom: (1185.12.6)
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051004043231-40302a149769263b
merged my own changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
import time
19
 
 
20
 
from bzrlib.branch import Branch
21
19
from bzrlib.selftest import TestCaseInTempDir
22
20
from bzrlib.errors import NoCommonAncestor, NoCommits
23
 
from bzrlib.errors import NoSuchRevision
24
21
from bzrlib.clone import copy_branch
25
22
from bzrlib.merge import merge
26
 
from bzrlib.revisionspec import RevisionSpec
27
23
 
28
24
class TestRevisionNamespaces(TestCaseInTempDir):
29
25
 
31
27
        """Test revision specifiers.
32
28
 
33
29
        These identify revisions by date, etc."""
 
30
        from bzrlib.errors import NoSuchRevision
 
31
        from bzrlib.branch import Branch
 
32
        from bzrlib.revisionspec import RevisionSpec
34
33
 
35
34
        b = Branch.initialize('.')
36
35
 
79
78
                          'b@r-0-4')
80
79
        self.assertEquals(RevisionSpec('ancestor:.').in_history(b3).rev_id,
81
80
                          'b@r-0-4')
82
 
 
83
 
    def test_branch_namespace(self):
84
 
        """Ensure that the branch namespace pulls in the requisite content."""
85
 
        self.build_tree(['branch1/', 'branch1/file', 'branch2/'])
86
 
        branch = Branch.initialize('branch1')
87
 
        branch.add(['file'])
88
 
        branch.commit('add file')
89
 
        copy_branch(branch, 'branch2')
90
 
        print >> open('branch2/file', 'w'), 'new content'
91
 
        branch2 = Branch.open('branch2')
92
 
        branch2.commit('update file', rev_id='A')
93
 
        spec = RevisionSpec('branch:./branch2/.bzr/../')
94
 
        rev_info = spec.in_history(branch)
95
 
        self.assertEqual(rev_info, (None, 'A'))
96