Mercurial > hgsubversion
comparison tests/test_util.py @ 257:ffccf0080e54
Move wrappers for hg commands to their own module.
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Fri, 10 Apr 2009 22:38:29 -0500 |
| parents | 06130689a2c8 |
| children | 2848d17eae71 |
comparison
equal
deleted
inserted
replaced
| 256:7932d098cb5f | 257:ffccf0080e54 |
|---|---|
| 11 from mercurial import context | 11 from mercurial import context |
| 12 from mercurial import hg | 12 from mercurial import hg |
| 13 from mercurial import node | 13 from mercurial import node |
| 14 from mercurial import ui | 14 from mercurial import ui |
| 15 | 15 |
| 16 import svncommands | 16 import wrappers |
| 17 | 17 |
| 18 # Fixtures that need to be pulled at a subdirectory of the repo path | 18 # Fixtures that need to be pulled at a subdirectory of the repo path |
| 19 subdir = {'truncatedhistory.svndump': '/project2', | 19 subdir = {'truncatedhistory.svndump': '/project2', |
| 20 'fetch_missing_files_subdir.svndump': '/foo', | 20 'fetch_missing_files_subdir.svndump': '/foo', |
| 21 } | 21 } |
| 46 | 46 |
| 47 def load_fixture_and_fetch(fixture_name, repo_path, wc_path, stupid=False, subdir=''): | 47 def load_fixture_and_fetch(fixture_name, repo_path, wc_path, stupid=False, subdir=''): |
| 48 load_svndump_fixture(repo_path, fixture_name) | 48 load_svndump_fixture(repo_path, fixture_name) |
| 49 if subdir: | 49 if subdir: |
| 50 repo_path += '/' + subdir | 50 repo_path += '/' + subdir |
| 51 svncommands.pull(ui.ui(), svn_url=fileurl(repo_path), | 51 wrappers.clone(None, ui.ui(), source=fileurl(repo_path), |
| 52 hg_repo_path=wc_path, stupid=stupid) | 52 dest=wc_path, stupid=stupid, noupdate=True) |
| 53 repo = hg.repository(ui.ui(), wc_path) | 53 repo = hg.repository(ui.ui(), wc_path) |
| 54 return repo | 54 return repo |
| 55 | 55 |
| 56 def rmtree(path): | 56 def rmtree(path): |
| 57 # Read-only files cannot be removed under Windows | 57 # Read-only files cannot be removed under Windows |
| 119 def repo(self): | 119 def repo(self): |
| 120 return hg.repository(ui.ui(), self.wc_path) | 120 return hg.repository(ui.ui(), self.wc_path) |
| 121 | 121 |
| 122 def pushrevisions(self, stupid=False): | 122 def pushrevisions(self, stupid=False): |
| 123 before = len(self.repo) | 123 before = len(self.repo) |
| 124 svncommands.push(ui.ui(), repo=self.repo, hg_repo_path=self.wc_path, | 124 wrappers.push(None, ui.ui(), repo=self.repo, stupid=stupid) |
| 125 svn_url=fileurl(self.repo_path), stupid=stupid) | |
| 126 after = len(self.repo) | 125 after = len(self.repo) |
| 127 self.assertEqual(0, after - before) | 126 self.assertEqual(0, after - before) |
| 128 | 127 |
| 129 def svnls(self, path, rev='HEAD'): | 128 def svnls(self, path, rev='HEAD'): |
| 130 path = self.repo_path + '/' + path | 129 path = self.repo_path + '/' + path |
