~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
class TestLog(ExternalBase):
29
29
 
30
 
    def _prepare(self):
31
 
        self.runbzr("init")
 
30
    def _prepare(self, format=None):
 
31
        if format:
 
32
            self.runbzr("init --format="+format)
 
33
        else:
 
34
            self.runbzr("init")
32
35
        self.build_tree(['hello.txt', 'goodbye.txt', 'meep.txt'])
33
36
        self.runbzr("add hello.txt")
34
37
        self.runbzr("commit -m message1 hello.txt")
116
119
        self.assertContainsRe(
117
120
            err, 'Path does not have any revision history: does-not-exist')
118
121
 
 
122
    def test_log_with_tags(self):
 
123
        self._prepare(format='dirstate-tags')
 
124
        self.runbzr('tag -r1 tag1')
 
125
        self.runbzr('tag -r1 tag1.1')
 
126
        self.runbzr('tag tag3')
 
127
        
 
128
        log = self.runbzr("log -r-1")[0]
 
129
        self.assertTrue('tags: tag3' in log)
 
130
 
 
131
        log = self.runbzr("log -r1")[0]
 
132
        # I guess that we can't know the order of tags in the output
 
133
        # since dicts are unordered, need to check both possibilities
 
134
        self.assertContainsRe(log, r'tags: (tag1, tag1\.1|tag1\.1, tag1)')
 
135
 
 
136
    def test_merged_log_with_tags(self):
 
137
        os.mkdir('branch1')
 
138
        os.chdir('branch1')
 
139
        self._prepare(format='dirstate-tags')
 
140
        os.chdir('..')
 
141
        self.runbzr('branch branch1 branch2')
 
142
        os.chdir('branch1')
 
143
        self.runbzr('commit -m foobar --unchanged')
 
144
        self.runbzr('tag tag1')
 
145
        os.chdir('../branch2')
 
146
        self.runbzr('merge ../branch1')
 
147
        self.runbzr('commit -m merge_branch_1')
 
148
        log = self.runbzr("log -r-1")[0]
 
149
        self.assertContainsRe(log, r'    tags: tag1')
 
150
 
 
151
 
119
152
class TestLogMerges(ExternalBase):
120
153
 
121
154
    def test_merges_are_indented_by_level(self):