annotate tests/test-merge.py @ 45:191855a9d813

client: add merge command
author Idan Kamara <idankk86@gmail.com>
date Tue, 16 Aug 2011 23:57:21 +0300
parents
children ebcc5d7dd528
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common, hglib
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 class test_merge(common.basetest):
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 def setUp(self):
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 common.basetest.setUp(self)
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 self.append('a', 'a')
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 rev, self.node0 = self.client.commit('first', addremove=True)
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 self.append('a', 'a')
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11 rev, self.node1 = self.client.commit('change')
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 def test_basic(self):
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 self.client.update(self.node0)
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15 self.append('b', 'a')
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16 rev, node2 = self.client.commit('new file', addremove=True)
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 self.client.merge(self.node1)
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 rev, node = self.client.commit('merge')
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 diff = """diff -r %s -r %s a
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
20 --- a/a
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21 +++ b/a
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22 @@ -1,1 +1,1 @@
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
23 -a
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24 \ No newline at end of file
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
25 +aa
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
26 \ No newline at end of file
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27 """ % (node2[:12], node[:12])
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
28
191855a9d813 client: add merge command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
29 self.assertEquals(diff, self.client.diff(change=node, nodates=True))