Adrian Schröter
e7fbd5920f
Mon Feb 13 15:52:19 GMT 2012 - aspiers@suse.com Add test suite and fix two bugs it found: 1. --subdir was not working 2. --scm bzr was not working FWIW it also works on SLE11 now. I will issue a separate request for my enhancements to tar_scm, since they are much more intrusive (but have about 90% test coverage). OBS-URL: https://build.opensuse.org/request/show/105040 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-tar_scm?expand=0&rev=32
31 lines
797 B
Python
31 lines
797 B
Python
#!/usr/bin/python
|
|
|
|
import os
|
|
|
|
from fixtures import Fixtures
|
|
from utils import mkfreshdir, run_bzr
|
|
|
|
class BzrFixtures(Fixtures):
|
|
def init(self):
|
|
self.create_repo()
|
|
self.create_commits(2)
|
|
|
|
def run(self, cmd):
|
|
return run_bzr(self.repo_path, cmd)
|
|
|
|
def create_repo(self):
|
|
os.makedirs(self.repo_path)
|
|
os.chdir(self.repo_path)
|
|
self.run('init')
|
|
self.run('whoami "%s"' % self.name_and_email)
|
|
self.wd = self.repo_path
|
|
print "created repo", self.repo_path
|
|
|
|
def do_commit(self, newly_created):
|
|
self.run('add .')
|
|
self.run('commit -m%d' % self.next_commit_rev)
|
|
|
|
def record_rev(self, rev_num):
|
|
self.revs[rev_num] = str(rev_num)
|
|
self.scmlogs.annotate("Recorded rev %d" % rev_num)
|