~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/whitebox.py

  • Committer: Martin Pool
  • Date: 2005-06-29 04:11:40 UTC
  • Revision ID: mbp@sourcefrog.net-20050629041140-6b17e65a23ffdf47
Merge John's log patch:

implements bzr log --forward --verbose
optimizes so that only logs to be printed are read (rather than reading
all and filtering out unwanted).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
                          ['hello.txt'])
20
20
 
21
21
 
22
 
 
23
 
class ValidateRevisionId(TestBase):
24
 
    def runTest(self):
25
 
        from bzrlib.revision import validate_revision_id
26
 
        validate_revision_id('mbp@sourcefrog.net-20050311061123-96a255005c7c9dbe')
27
 
        
28
 
        self.assertRaises(ValueError,
29
 
                          validate_revision_id,
30
 
                          ' asdkjas')
31
 
 
32
 
 
33
 
        self.assertRaises(ValueError,
34
 
                          validate_revision_id,
35
 
                          'mbp@sourcefrog.net-20050311061123-96a255005c7c9dbe\n')
36
 
 
37
 
 
38
 
        self.assertRaises(ValueError,
39
 
                          validate_revision_id,
40
 
                          ' mbp@sourcefrog.net-20050311061123-96a255005c7c9dbe')
41
 
 
42
 
        self.assertRaises(ValueError,
43
 
                          validate_revision_id,
44
 
                          'Martin Pool <mbp@sourcefrog.net>-20050311061123-96a255005c7c9dbe')
45
 
 
46
 
 
47
 
 
48
 
class PendingMerges(InTempDir):
49
 
    """Tracking pending-merged revisions."""
50
 
    def runTest(self):
51
 
        b = Branch('.', init=True)
52
 
 
53
 
        self.assertEquals(b.pending_merges(), [])
54
 
        
55
 
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
56
 
        
57
 
        self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
58
 
    
59
 
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
60
 
        
61
 
        self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
62
 
 
63
 
        b.add_pending_merge('wibble@fofof--20050401--1928390812')
64
 
        self.assertEquals(b.pending_merges(),
65
 
                          ['foo@azkhazan-123123-abcabc',
66
 
                           'wibble@fofof--20050401--1928390812'])
67
 
 
68
 
        b.commit("commit from base with two merges")
69
 
 
70
 
        rev = b.get_revision(b.revision_history()[0])
71
 
        self.assertEquals(len(rev.parents), 2)
72
 
        self.assertEquals(rev.parents[0].revision_id,
73
 
                          'foo@azkhazan-123123-abcabc')
74
 
        self.assertEquals(rev.parents[1].revision_id,
75
 
                           'wibble@fofof--20050401--1928390812')
76
 
 
77
 
        # list should be cleared when we do a commit
78
 
        self.assertEquals(b.pending_merges(), [])
79
 
        
80
 
        
81
 
        
82
 
 
83
22
class Revert(InTempDir):
84
23
    """Test selected-file revert"""
85
24
    def runTest(self):