annotate tests/test-clone.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 a4fcece7dd8e
children 4359cabcb0cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
93
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import os
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2 import common
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 import hglib
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 class test_clone(common.basetest):
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 def test_basic(self):
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 self.append('a', 'a')
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.client.commit('first', addremove=True)
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 cloned = hglib.clone('.', 'cloned')
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 self.assertRaises(ValueError, cloned.log)
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11 cloned.open()
a4fcece7dd8e hglib: add top level clone method
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12 self.assertEquals(self.client.log(), cloned.log())