Mercurial > python-hglib
annotate tests/test-diff.py @ 124:cc7569bffb26
context: add 'hidden' method to check if the changeset is hidden
This method should not be a static property obtained at creation as the hidden
status may change.
author | Paul Tonelli <paul.tonelli@logilab.fr> |
---|---|
date | Thu, 15 May 2014 15:12:13 +0200 |
parents | 86ff8611a8fa |
children | 1b47146a4a2c |
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]) | |
40 self.assertEquals(diff4, self.client.diff(revs=[rev0, rev1], nodates=True)) | |
105
86ff8611a8fa
client: always set HGPLAIN=1 (issue3502)
Siddharth Agarwal <sid0@fb.com>
parents:
37
diff
changeset
|
41 |
86ff8611a8fa
client: always set HGPLAIN=1 (issue3502)
Siddharth Agarwal <sid0@fb.com>
parents:
37
diff
changeset
|
42 def test_basic_plain(self): |
86ff8611a8fa
client: always set HGPLAIN=1 (issue3502)
Siddharth Agarwal <sid0@fb.com>
parents:
37
diff
changeset
|
43 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
|
44 self.test_basic() |