annotate tests/test-tags.py @ 75:f4f636ecca3e

tests: add a nose plugin that allows specifying a custom hg to run tests
author Idan Kamara <idankk86@gmail.com>
date Sat, 15 Oct 2011 20:03:04 +0200
parents 77ebb51f5f36
children 4359cabcb0cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2 import hglib
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 class test_tags(common.basetest):
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 def test_basic(self):
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 self.append('a', 'a')
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 rev, node = self.client.commit('first', addremove=True)
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.client.tag('my tag')
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 self.client.tag('local tag', rev=rev, local=True)
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11 # filecache that was introduced in 2.0 makes us see the local tag, for
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 # now we have to reconnect
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 if self.client.version < (2, 0, 0):
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 self.client = hglib.open()
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16 tags = self.client.tags()
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 self.assertEquals(tags, [('tip', 1, self.client.tip().node[:12], False),
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 ('my tag', 0, node[:12], False),
77ebb51f5f36 client: add tags command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 ('local tag', 0, node[:12], True)])