annotate tests/test-manifest.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 e89dd99638ce
children 4359cabcb0cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
64
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common, hglib, os, stat
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 class test_manifest(common.basetest):
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 def test_basic(self):
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 self.append('a', 'a')
69
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
6 files = ['a']
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
7 manifest = [('047b75c6d7a3ef6a2243bd0e99f94f6ea6683597', '644', False,
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
8 False, 'a')]
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
9
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
10 if os.name == 'posix':
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
11 self.append('b', 'b')
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
12 os.chmod('b', os.stat('b')[0] | stat.S_IEXEC)
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
13 os.symlink('b', 'c')
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
14
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
15 files.extend(['b', 'c'])
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
16 manifest.extend([('62452855512f5b81522aa3895892760bb8da9f3f', '755',
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
17 True, False, 'b'),
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
18 ('62452855512f5b81522aa3895892760bb8da9f3f', '644',
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
19 False, True, 'c')])
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
20
64
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21 self.client.commit('first', addremove=True)
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22
69
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
23 self.assertEquals(list(self.client.manifest(all=True)), files)
64
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
25 self.assertEquals(list(self.client.manifest()), manifest)