Adrian Schröter
6e55d7df19
- add new 'versionformat' option to determine how version is extracted via git show --pretty=... (and similar for svn / hg / bzr) - support caching of cloned repositories to speed up fetch from upstream - use mktemp -u because git/hg refuse to clone into an empty directory on SLES11 OBS-URL: https://build.opensuse.org/request/show/105386 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-tar_scm?expand=0&rev=33
30 lines
1023 B
Python
30 lines
1023 B
Python
#!/usr/bin/python
|
|
|
|
from commontests import CommonTests
|
|
from bzrfixtures import BzrFixtures
|
|
from utils import run_bzr
|
|
|
|
class BzrTests(CommonTests):
|
|
scm = 'bzr'
|
|
initial_clone_command = 'bzr checkout'
|
|
update_cache_command = 'bzr update'
|
|
fixtures_class = BzrFixtures
|
|
|
|
def default_version(self):
|
|
return self.rev(2)
|
|
|
|
def test_versionformat_rev(self):
|
|
self.tar_scm_std('--versionformat', 'myrev%r.svn')
|
|
self.assertTarOnly(self.basename(version = 'myrev2.svn'))
|
|
|
|
def test_version_versionformat(self):
|
|
self.tar_scm_std('--version', '3.0', '--versionformat', 'myrev%r.svn')
|
|
self.assertTarOnly(self.basename(version = 'myrev2.svn'))
|
|
|
|
def test_versionformat_revision(self):
|
|
self.fixtures.create_commits(4)
|
|
self.tar_scm_std('--versionformat', 'foo%r', '--revision', self.rev(2))
|
|
basename = self.basename(version = 'foo2')
|
|
th = self.assertTarOnly(basename)
|
|
self.assertTarMemberContains(th, basename + '/a', '2')
|