annotate tests/test-bookmarks.py @ 123:cdde1656346f

client: add 'hidden' property to show hidden changesets. This enables interactions with the obsolete changesets in the repository: - add the attribute in client class - add the keyword to the relevant commands - enable log without hidden changesets even when self.hidden is True - add a few tests with the hidden keyword This changeset mirrors the behavior of the mercurial global command --hidden: an attribute is added to the client library. If set at True, adds the hidden keyword to all command which can use it to show hidden changesets. The alternative would be to add the keyword in rawcommand, but the hidden flag is not relevant for commands such as add or branch.
author Paul Tonelli <paul.tonelli@logilab.fr>
date Thu, 22 May 2014 15:23:12 +0200
parents 2e2055fc66c3
children 4359cabcb0cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 class test_bookmarks(common.basetest):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 def test_empty(self):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 self.assertEquals(self.client.bookmarks(), ([], -1))
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 def test_basic(self):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.append('a', 'a')
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 rev0, node0 = self.client.commit('first', addremove=True)
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 self.append('a', 'a')
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11 rev1, node1 = self.client.commit('second')
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12
107
5fe53db61aa4 tests: fix tests that use integer bookmarks
Durham Goode <durham@fb.com>
parents: 24
diff changeset
13 self.client.bookmark('zero', rev0)
24
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 self.assertEquals(self.client.bookmarks(),
107
5fe53db61aa4 tests: fix tests that use integer bookmarks
Durham Goode <durham@fb.com>
parents: 24
diff changeset
15 ([('zero', rev0, node0[:12])], -1))
24
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16
107
5fe53db61aa4 tests: fix tests that use integer bookmarks
Durham Goode <durham@fb.com>
parents: 24
diff changeset
17 self.client.bookmark('one', rev1)
114
2e2055fc66c3 tests: ignore bookmarks active mark for testing with pre-2.6
Matt Mackall <mpm@selenic.com>
parents: 112
diff changeset
18 self.assertEquals(self.client.bookmarks()[0],
2e2055fc66c3 tests: ignore bookmarks active mark for testing with pre-2.6
Matt Mackall <mpm@selenic.com>
parents: 112
diff changeset
19 [('one', rev1, node1[:12]),
2e2055fc66c3 tests: ignore bookmarks active mark for testing with pre-2.6
Matt Mackall <mpm@selenic.com>
parents: 112
diff changeset
20 ('zero', rev0, node0[:12])])
24
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22 #def test_spaces(self):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
23 # self.client.bookmark('s pace', self.rev0)
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24 # self.assertEquals(self.client.bookmarks(),
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
25 # ([('s pace', 0, self.rev0.node[:12])], -1))