annotate tests/test-resolve.py @ 213:388820908580 2.6.2

hglib: update grep to cope with behavior change in hg 5.2. Since version 5.2, revision filed not printed without all argument. Fixed inaccurate pasring result with lastest hg and changed test case.
author Daehyeok Mun <daehyeok@gmail.com>
date Sat, 21 Mar 2020 19:59:50 -0700
parents c1b966866ed7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
148
c1b966866ed7 hglib: make all imports absolute (issue4520)
Brett Cannon <brett@python.org>
parents: 143
diff changeset
1 from tests import common
c1b966866ed7 hglib: make all imports absolute (issue4520)
Brett Cannon <brett@python.org>
parents: 143
diff changeset
2 import hglib
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
3 from hglib.util import b
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 class test_resolve(common.basetest):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 def setUp(self):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 common.basetest.setUp(self)
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 self.append('a', 'a')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 self.append('b', 'b')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
11 rev, self.node0 = self.client.commit(b('first'), addremove=True)
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 self.append('a', 'a')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 self.append('b', 'b')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
15 rev, self.node1 = self.client.commit(b('second'))
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 def test_basic(self):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 self.client.update(self.node0)
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 self.append('a', 'b')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
20 self.append('b', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
21 rev, self.node3 = self.client.commit(b('third'))
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22
134
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
23 self.assertRaises(hglib.error.CommandError, self.client.merge,
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
24 self.node1)
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
25 self.assertRaises(hglib.error.CommandError,
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
26 self.client.resolve, all=True)
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
28 self.assertEquals([(b('U'), b('a')), (b('U'), b('b'))],
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
29 self.client.resolve(listfiles=True))
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
30
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
31 self.client.resolve(b('a'), mark=True)
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
32 self.assertEquals([(b('R'), b('a')), (b('U'), b('b'))],
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
33 self.client.resolve(listfiles=True))