annotate tests/test-heads.py @ 141:ea80bd2775f6

hglib: introduce util.b() (issue4520) The util.b() function will be used to mark all string literals in the code base which should be treated as bytes instead of text. This is to help with supporting Python 3.
author Brett Cannon <brett@python.org>
date Sat, 07 Mar 2015 10:08:52 -0500
parents 2657fd6fef04
children 4359cabcb0cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 class test_heads(common.basetest):
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 def test_empty(self):
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 self.assertEquals(self.client.heads(), [])
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 def test_basic(self):
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.append('a', 'a')
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 rev, node0 = self.client.commit('first', addremove=True)
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 self.assertEquals(self.client.heads(), [self.client.tip()])
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 self.client.branch('foo')
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 self.append('a', 'a')
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 rev, node1 = self.client.commit('second')
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15
2657fd6fef04 client: add heads command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16 self.assertEquals(self.client.heads(node0, topological=True), [])