~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisionnamespaces.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-07-12 12:36:57 UTC
  • mfrom: (1732.3.4 bzr.revnoX)
  • Revision ID: pqm@pqm.ubuntu.com-20060712123657-365eeb32b69308bf
(matthieu) revno:x:url revision spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
class TestRevisionNamespaces(TestCaseWithTransport):
29
29
 
 
30
    def test_revno_n_path(self):
 
31
        """Test revision specifiers.
 
32
 
 
33
        These identify revisions by date, etc."""
 
34
        wta = self.make_branch_and_tree('a')
 
35
        ba = wta.branch
 
36
        
 
37
        wta.commit('Commit one', rev_id='a@r-0-1')
 
38
        wta.commit('Commit two', rev_id='a@r-0-2')
 
39
        wta.commit('Commit three', rev_id='a@r-0-3')
 
40
 
 
41
        wtb = self.make_branch_and_tree('b')
 
42
        bb = wtb.branch
 
43
 
 
44
        wtb.commit('Commit one', rev_id='b@r-0-1')
 
45
        wtb.commit('Commit two', rev_id='b@r-0-2')
 
46
        wtb.commit('Commit three', rev_id='b@r-0-3')
 
47
 
 
48
        self.assertEquals(RevisionSpec('revno:1:a/').in_history(ba),
 
49
                          (1, 'a@r-0-1'))
 
50
        # The argument of in_history should be ignored since it is
 
51
        # redundant with the path in the spec.
 
52
        self.assertEquals(RevisionSpec('revno:1:a/').in_history(None),
 
53
                          (1, 'a@r-0-1'))
 
54
        self.assertEquals(RevisionSpec('revno:1:a/').in_history(bb),
 
55
                          (1, 'a@r-0-1'))
 
56
        self.assertEquals(RevisionSpec('revno:2:b/').in_history(None),
 
57
                          (2, 'b@r-0-2'))
 
58
 
 
59
 
30
60
    def test_revision_namespaces(self):
31
61
        """Test revision specifiers.
32
62