~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Shannon Weyrick
  • Date: 2011-11-04 13:40:04 UTC
  • mfrom: (6238 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6256.
  • Revision ID: weyrick@mozek.us-20111104134004-033t2wqhc3ydzm0a
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
 
21
from bzrlib.revision import NULL_REVISION
21
22
from bzrlib.tests import TestCaseWithTransport
22
23
 
23
24
 
36
37
        self.build_tree(['branch/b'])
37
38
        wt.add('b')
38
39
        wt.commit('adding b', rev_id='r2')
39
 
 
40
 
        self.revisions = wt.branch.revision_history()
41
40
        return wt
42
41
 
43
42
    def test_basic(self):
44
 
        self.create_tree()
 
43
        wt = self.create_tree()
45
44
 
46
45
        txt = self.run_bzr('version-info branch')[0]
47
46
        self.assertContainsRe(txt, 'date:')
48
47
        self.assertContainsRe(txt, 'build-date:')
49
48
        self.assertContainsRe(txt, 'revno: 2')
50
 
        self.assertContainsRe(txt, 'revision-id: ' + self.revisions[-1])
 
49
        self.assertContainsRe(txt, 'revision-id: ' + wt.branch.last_revision())
51
50
 
52
51
    def test_all(self):
53
52
        """'--all' includes clean, revision history, and file revisions"""
54
 
        self.create_tree()
 
53
        wt = self.create_tree()
55
54
        txt = self.run_bzr('version-info branch --all')[0]
56
55
        self.assertContainsRe(txt, 'date:')
57
56
        self.assertContainsRe(txt, 'revno: 2')
58
 
        self.assertContainsRe(txt, 'revision-id: ' + self.revisions[-1])
 
57
        self.assertContainsRe(txt, 'revision-id: ' + wt.branch.last_revision())
59
58
        self.assertContainsRe(txt, 'clean: True')
60
59
        self.assertContainsRe(txt, 'revisions:')
61
 
        for rev_id in self.revisions:
 
60
        for rev_id in wt.branch.repository.all_revision_ids():
62
61
            self.assertContainsRe(txt, 'id: ' + rev_id)
63
62
        self.assertContainsRe(txt, 'message: adding a')
64
63
        self.assertContainsRe(txt, 'message: adding b')
166
165
        
167
166
        self.assertContainsString(out, commit_message.encode('utf-8'))
168
167
 
 
168
    def test_revision(self):
 
169
        tree = self.create_tree()
 
170
        branch = self.make_branch('just_branch')
 
171
        branch.pull(tree.branch)
169
172
 
 
173
        txt = self.run_bzr('version-info -r1 just_branch')[0]
 
174
        self.assertStartsWith(txt, 'revision-id: r1\n')