Mercurial > python-hglib
annotate tests/test-diff.py @ 134:1b47146a4a2c 1.4
style: fix long lines
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 30 Sep 2014 12:48:04 -0500 |
parents | 86ff8611a8fa |
children | 4359cabcb0cc |
rev | line source |
---|---|
37 | 1 import common |
2 | |
3 class test_diff(common.basetest): | |
4 def test_basic(self): | |
5 self.append('a', 'a\n') | |
6 self.client.add('a') | |
7 diff1 = """diff -r 000000000000 a | |
8 --- /dev/null | |
9 +++ b/a | |
10 @@ -0,0 +1,1 @@ | |
11 +a | |
12 """ | |
13 self.assertEquals(diff1, self.client.diff(nodates=True)) | |
14 self.assertEquals(diff1, self.client.diff(['a'], nodates=True)) | |
15 rev0, node0 = self.client.commit('first') | |
16 diff2 = """diff -r 000000000000 -r %s a | |
17 --- /dev/null | |
18 +++ b/a | |
19 @@ -0,0 +1,1 @@ | |
20 +a | |
21 """ % node0[:12] | |
22 self.assertEquals(diff2, self.client.diff(change=rev0, nodates=True)) | |
23 self.append('a', 'a\n') | |
24 rev1, node1 = self.client.commit('second') | |
25 diff3 = """diff -r %s a | |
26 --- a/a | |
27 +++ b/a | |
28 @@ -1,1 +1,2 @@ | |
29 a | |
30 +a | |
31 """ % node0[:12] | |
32 self.assertEquals(diff3, self.client.diff(revs=[rev0], nodates=True)) | |
33 diff4 = """diff -r %s -r %s a | |
34 --- a/a | |
35 +++ b/a | |
36 @@ -1,1 +1,2 @@ | |
37 a | |
38 +a | |
39 """ % (node0[:12], node1[:12]) | |
134 | 40 self.assertEquals(diff4, self.client.diff(revs=[rev0, rev1], |
41 nodates=True)) | |
105
86ff8611a8fa
client: always set HGPLAIN=1 (issue3502)
Siddharth Agarwal <sid0@fb.com>
parents:
37
diff
changeset
|
42 |
86ff8611a8fa
client: always set HGPLAIN=1 (issue3502)
Siddharth Agarwal <sid0@fb.com>
parents:
37
diff
changeset
|
43 def test_basic_plain(self): |
86ff8611a8fa
client: always set HGPLAIN=1 (issue3502)
Siddharth Agarwal <sid0@fb.com>
parents:
37
diff
changeset
|
44 open('.hg/hgrc', 'a').write('[defaults]\ndiff=--git\n') |
86ff8611a8fa
client: always set HGPLAIN=1 (issue3502)
Siddharth Agarwal <sid0@fb.com>
parents:
37
diff
changeset
|
45 self.test_basic() |