Mercurial > python-hglib
comparison tests/test-merge.py @ 46:ebcc5d7dd528
client: introduce merge handlers
These can control the behaviour when Mercurial prompts what to do with regard
to a specific file
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Tue, 16 Aug 2011 23:58:24 +0300 |
parents | 191855a9d813 |
children | 4359cabcb0cc |
comparison
equal
deleted
inserted
replaced
45:191855a9d813 | 46:ebcc5d7dd528 |
---|---|
25 +aa | 25 +aa |
26 \ No newline at end of file | 26 \ No newline at end of file |
27 """ % (node2[:12], node[:12]) | 27 """ % (node2[:12], node[:12]) |
28 | 28 |
29 self.assertEquals(diff, self.client.diff(change=node, nodates=True)) | 29 self.assertEquals(diff, self.client.diff(change=node, nodates=True)) |
30 | |
31 def test_merge_prompt_abort(self): | |
32 self.client.update(self.node0) | |
33 self.client.remove('a') | |
34 self.client.commit('remove') | |
35 | |
36 self.assertRaises(hglib.error.CommandError, self.client.merge) | |
37 | |
38 def test_merge_prompt_noninteractive(self): | |
39 self.client.update(self.node0) | |
40 self.client.remove('a') | |
41 rev, node = self.client.commit('remove') | |
42 | |
43 self.client.merge(cb=hglib.merge.handlers.noninteractive) | |
44 | |
45 diff = """diff -r %s a | |
46 --- /dev/null | |
47 +++ b/a | |
48 @@ -0,0 +1,1 @@ | |
49 +aa | |
50 \ No newline at end of file | |
51 """ % node[:12] | |
52 self.assertEquals(diff, self.client.diff(nodates=True)) | |
53 | |
54 def test_merge_prompt_cb(self): | |
55 self.client.update(self.node0) | |
56 self.client.remove('a') | |
57 rev, node = self.client.commit('remove') | |
58 | |
59 def cb(output): | |
60 return 'c' | |
61 | |
62 self.client.merge(cb=cb) | |
63 | |
64 diff = """diff -r %s a | |
65 --- /dev/null | |
66 +++ b/a | |
67 @@ -0,0 +1,1 @@ | |
68 +aa | |
69 \ No newline at end of file | |
70 """ % node[:12] | |
71 self.assertEquals(diff, self.client.diff(nodates=True)) |