52
|
1 import common
|
|
2
|
|
3 class test_annotate(common.basetest):
|
|
4 def test_basic(self):
|
|
5 self.append('a', 'a\n')
|
|
6 rev, node0 = self.client.commit('first', addremove=True)
|
|
7 self.append('a', 'a\n')
|
|
8 rev, node1 = self.client.commit('second')
|
|
9
|
134
|
10 self.assertEquals(list(self.client.annotate('a')), [('0',
|
|
11 'a'), ('1', 'a')])
|
|
12 self.assertEquals(list(
|
|
13 self.client.annotate(
|
|
14 'a', user=True, file=True,
|
|
15 number=True, changeset=True, line=True, verbose=True)),
|
52
|
16 [('test 0 %s a:1' % node0[:12], 'a'),
|
|
17 ('test 1 %s a:2' % node1[:12], 'a')])
|
|
18
|
|
19 def test_files(self):
|
|
20 self.append('a', 'a\n')
|
|
21 rev, node0 = self.client.commit('first', addremove=True)
|
|
22 self.append('b', 'b\n')
|
|
23 rev, node1 = self.client.commit('second', addremove=True)
|
|
24 self.assertEquals(list(self.client.annotate(['a', 'b'])),
|
|
25 [('0', 'a'), ('1', 'b')])
|
|
26
|
|
27 def test_two_colons(self):
|
|
28 self.append('a', 'a: b\n')
|
|
29 self.client.commit('first', addremove=True)
|
|
30 self.assertEquals(list(self.client.annotate('a')), [('0', 'a: b')])
|