Skip to content

Commit 5b27149

Browse files
Standardised all export repository methods across clients.
Signed-off-by: Leander Stephen D'Souza <[email protected]>
1 parent 8330c80 commit 5b27149

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

test/test_bzr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_checkout_existing_directory_fails(self):
6565

6666
@unittest.skipIf(not bzr, '`bzr` was not found')
6767
class TestExportRepository(unittest.TestCase):
68-
"""Integration tests for BzrClient _export_repository functionality."""
68+
"""Integration tests for BzrClient export_repository functionality."""
6969

7070
def setUp(self):
7171
self.test_dir = tempfile.mkdtemp()
@@ -89,7 +89,7 @@ def test_export_repository(self):
8989
os.chdir(self.repo_path)
9090

9191
# Test export with a specific revision
92-
result = self.client._export_repository(None, self.export_path)
92+
result = self.client.export_repository(None, self.export_path)
9393
self.assertTrue(result, 'Export should return True on success')
9494

9595
archive_path = self.export_path + '.tar.gz'
@@ -115,7 +115,7 @@ def test_export_repository_git_version_unsupported(self):
115115
os.chdir(self.repo_path)
116116

117117
# Test export with invalid version
118-
result = self.client._export_repository('999999999', self.export_path)
118+
result = self.client.export_repository('999999999', self.export_path)
119119
self.assertFalse(result, 'Version is not supported for git repositories.')
120120

121121
archive_path = self.export_path + '.tar.gz'

test/test_hg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_checkout_existing_directory(self):
6464

6565
@unittest.skipIf(not hg, '`hg` was not found')
6666
class TestExportRepository(unittest.TestCase):
67-
"""Integration tests for HgClient _export_repository functionality."""
67+
"""Integration tests for HgClient export_repository functionality."""
6868

6969
def setUp(self):
7070
"""Set up test fixtures for each test"""
@@ -97,7 +97,7 @@ def _ensure_repo_cloned(self):
9797

9898
def test_export_repository_specific_revision(self):
9999
"""Test exporting a specific revision"""
100-
result = self.hg_client._export_repository('1', self.export_base_path)
100+
result = self.hg_client.export_repository('1', self.export_base_path)
101101
self.assertTrue(result, "Export should succeed for revision '1'")
102102

103103
# Verify files were created correctly
@@ -108,7 +108,7 @@ def test_export_repository_invalid_revision(self):
108108
"""Test exporting with an invalid revision"""
109109
invalid_revision = 'nonexistent123456789'
110110

111-
result = self.hg_client._export_repository(
111+
result = self.hg_client.export_repository(
112112
invalid_revision, self.export_base_path
113113
)
114114
self.assertFalse(result, 'Export should fail for invalid revision')

test/test_svn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_existing_non_empty_dir_should_fail(self):
8888

8989
@unittest.skipIf(not svn, '`svn` was not found')
9090
class TestSvnExportRepository(unittest.TestCase):
91-
"""Integration tests for SvnClient _export_repository functionality."""
91+
"""Integration tests for SvnClient export_repository functionality."""
9292

9393
def setUp(self):
9494
self.test_dir = tempfile.mkdtemp()
@@ -110,7 +110,7 @@ def test_export_repository_with_version(self):
110110
try:
111111
os.chdir(self.repo_path)
112112

113-
result = client._export_repository('1928014', self.export_path)
113+
result = client.export_repository('1928014', self.export_path)
114114
self.assertTrue(result, 'Export should return True on success')
115115

116116
# Verify tar.gz file was created
@@ -136,7 +136,7 @@ def test_export_repository_invalid_version(self):
136136
try:
137137
os.chdir(self.repo_path)
138138

139-
result = client._export_repository('999999999', self.export_path)
139+
result = client.export_repository('999999999', self.export_path)
140140
self.assertFalse(result, 'Export should return False for invalid version')
141141

142142
archive_path = self.export_path + '.tar.gz'

vcs2l/clients/bzr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def _get_parent_branch(self):
194194
result['output'] = branch
195195
return result
196196

197-
def _export_repository(self, version, basepath):
197+
def export_repository(self, version, basepath):
198198
"""Export the bzr repository at a given version to a tar.gz file."""
199199
self._check_executable()
200200

vcs2l/clients/hg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def _check_color(self, cmd):
340340
if HgClient._config_color:
341341
cmd[1:1] = '--color', 'always'
342342

343-
def _export_repository(self, version, basepath):
343+
def export_repository(self, version, basepath):
344344
"""Export the hg repository at a given version to a tar.gz file."""
345345
self._check_executable()
346346

vcs2l/clients/svn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def validate(self, command):
261261

262262
return {'cmd': cmd, 'cwd': self.path, 'output': output, 'returncode': None}
263263

264-
def _export_repository(self, version, basepath):
264+
def export_repository(self, version, basepath):
265265
"""Export the svn repository at a given version to a tar.gz file."""
266266
self._check_executable()
267267

0 commit comments

Comments
 (0)