annotate tests/test-outgoing-incoming.py @ 71:20ffb6486412

tests: put some characters in HGRCPATH so Windows actually sees the variable
author Idan Kamara <idankk86@gmail.com>
date Mon, 26 Sep 2011 22:25:36 +0300
parents 46908f4b87d5
children 4359cabcb0cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2 import hglib
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 class test_outgoing_incoming(common.basetest):
26
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
5 def test_no_path(self):
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
6 self.assertRaises(hglib.error.CommandError, self.client.incoming)
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
7
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
8 def test_empty(self):
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
9 self.client.clone(dest='other')
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
10 self.other = hglib.open('other')
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
11
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
12 self.assertEquals(self.other.incoming(), [])
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
13 self.assertEquals(self.other.outgoing(), [])
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
14
7
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15 def test_basic(self):
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16 self.append('a', 'a')
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 self.client.commit('first', addremove=True)
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 self.append('a', 'a')
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 self.client.commit('second')
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
20
26
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
21 self.client.clone(dest='other')
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
22 other = hglib.open('other')
7
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
23
26
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
24 self.assertEquals(self.client.log(), other.log())
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
25 self.assertEquals(self.client.outgoing(path='other'), other.incoming())
7
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
26
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27 self.append('a', 'a')
15
f1af31960414 client: change return value of commit() to (rev, node)
Idan Kamara <idankk86@gmail.com>
parents: 7
diff changeset
28 rev, node = self.client.commit('third')
26
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
29 out = self.client.outgoing(path='other')
7
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
30
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
31 self.assertEquals(len(out), 1)
15
f1af31960414 client: change return value of commit() to (rev, node)
Idan Kamara <idankk86@gmail.com>
parents: 7
diff changeset
32 self.assertEquals(out[0].node, node)
7
eac8be119d81 tests: rearrange tests and use nosetests
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
33
26
b4e5c8745ef3 client: add missing options to outgoing
Idan Kamara <idankk86@gmail.com>
parents: 15
diff changeset
34 self.assertEquals(out, other.incoming())
27
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
35
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
36 def test_bookmarks(self):
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
37 self.append('a', 'a')
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
38 self.client.commit('first', addremove=True)
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
39 self.append('a', 'a')
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
40 self.client.commit('second')
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
41
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
42 self.client.clone(dest='other')
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
43 other = hglib.open('other')
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
44
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
45 self.client.bookmark('bm1', 1)
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
46
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
47 self.assertEquals(other.incoming(bookmarks=True),
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
48 [('bm1', self.client.tip().node[:12])])
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
49
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
50 self.assertEquals(self.client.outgoing(path='other', bookmarks=True),
46908f4b87d5 client: add bookmarks support to incoming and outgoing
Idan Kamara <idankk86@gmail.com>
parents: 26
diff changeset
51 [('bm1', self.client.tip().node[:12])])