def create_mercurial_repo(self, repo_name='test hg repo', create_temp_repo=False):

        repo_path = os.path.join(self.TMP_DIR, 'hgrepo_{0}'.format(uuid.uuid4()))

        mercurial_repo = create_repo(**{
            'url': 'hg+file://' + os.path.join(repo_path, repo_name),
            'cwd': self.TMP_DIR,
            'name': repo_name
        })

        if create_temp_repo:
            os.mkdir(repo_path)
            run([
                'hg', 'init', mercurial_repo['name']], cwd=repo_path
                )

            mercurial_repo.obtain()

            testfile_filename = 'testfile.test'

            run([
                'touch', testfile_filename
                ], cwd=os.path.join(repo_path, repo_name))
            run([
                'hg', 'add', testfile_filename
                ], cwd=os.path.join(repo_path, repo_name))
            run([
                'hg', 'commit', '-m', 'a test file for %s' % mercurial_repo['name']
                ], cwd=os.path.join(repo_path, repo_name))

        return os.path.join(repo_path, repo_name), mercurial_repo
Traverse and get all facets.
dataset/ETHPy150Open tony/vcspull/vcspull/testsuite/helpers.py/RepoTestMixin.create_mercurial_repo--crossover with--dataset/ETHPy150Open pudo/aleph/aleph/search/facets.py/convert_document_aggregations