Mercurial > hgsubversion
diff tests/test_util.py @ 22:95d0109e495e
Refactor tests so I can reuse code more.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Wed, 08 Oct 2008 20:09:28 -0500 |
parents | 48a44546c12f |
children | 1f8854804795 |
line wrap: on
line diff
--- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,6 +1,11 @@ import os import popen2 +from mercurial import ui +from mercurial import hg + +import fetch_command + FIXTURES = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'fixtures') @@ -14,3 +19,11 @@ def load_svndump_fixture(path, fixture_n proc.tochild.write(inp.read()) proc.tochild.close() proc.wait() + +def load_fixture_and_fetch(fixture_name, repo_path, wc_path): + load_svndump_fixture(repo_path, fixture_name) + fetch_command.fetch_revisions(ui.ui(), + svn_url='file://%s' % repo_path, + hg_repo_path=wc_path) + repo = hg.repository(ui.ui(), wc_path) + return repo