def get_repo(project): """Returns the active repository for the given project name. It is assumed that the given project exists in the database.""" repo = Repository.objects.get(project=project) vcs_api = pyvcal.get_api(repo.type) vcs_repo = vcs_api.Repository(repo.path) return vcs_repo
from unittest import TestSuite import os import subprocess import signal import pyvcal from ...util import rmrf api = pyvcal.get_api('git') path = os.path.join(os.path.dirname(__file__), '..', 'repositories', 'git') class BasicRepository(object): """Represents our 'basic' test repository""" def __init__(self): """Run the create_basic_repository script""" super(BasicRepository, self).__init__() os.chdir(path) if (os.path.exists(os.path.join(path, 'testrepo01'))): self.teardown() subprocess.Popen(['bash', 'create_basic_repository.sh'], stdout=subprocess.PIPE).wait() def repo(self): """Return a newly initiated PyVCAL Repository""" return api.Repository(path=os.path.join(path, 'testrepo01')) def teardown(self): """Clean up the created repository""" rmrf(os.path.join(path, 'testrepo01')) test_git = TestSuite()
from unittest import TestSuite import os import subprocess import signal import pyvcal from ...util import rmrf api = pyvcal.get_api('perforce') path = os.path.join(os.path.dirname(__file__), '..', 'repositories', 'perforce') class BasicRepository(object): """Represents our 'basic' test repository""" def __init__(self): """Run the create_basic_repository script and connect to the created repository.""" super(BasicRepository, self).__init__() os.chdir(path) subprocess.Popen(['bash', 'create_basic_repository.sh'], stdout=subprocess.PIPE).wait() os.chdir(os.path.join('basic', 'repo')) ## A running perforce server process. self.p4d = subprocess.Popen(['p4d'], stdout=subprocess.PIPE) import time time.sleep(2)
from unittest import TestSuite import os import subprocess import pyvcal from ...util import rmrf api = pyvcal.get_api('subversion') path = os.path.join(os.path.dirname(__file__), '..', 'repositories', 'subversion') class BasicRepository(object): """Represents our 'basic' test repository""" def __init__(self): super(BasicRepository, self).__init__() os.chdir(path) subprocess.Popen(['bash', 'create_basic_repository.sh'], stdout=subprocess.PIPE).wait() def repo(self): """Return the PyVCAL Repository""" return api.Repository(path="file://" + os.path.join(path, 'svn-basic')) def teardown(self): rmrf(os.path.join(path, 'svn-basic')) rmrf(os.path.join(path, 'repo01')) test_subversion = TestSuite()
from unittest import TestSuite import os import subprocess import signal import pyvcal from ...util import rmrf api = pyvcal.get_api('git') path = os.path.join(os.path.dirname(__file__), '..', 'repositories', 'git') class BasicRepository(object): """Represents our 'basic' test repository""" def __init__(self): """Run the create_basic_repository script""" super(BasicRepository, self).__init__() os.chdir(path) if (os.path.exists(os.path.join(path, 'testrepo01'))): self.teardown() subprocess.Popen(['bash', 'create_basic_repository.sh'], stdout=subprocess.PIPE).wait() def repo(self): """Return a newly initiated PyVCAL Repository""" return api.Repository(path=os.path.join(path, 'testrepo01')) def teardown(self): """Clean up the created repository""" rmrf(os.path.join(path, 'testrepo01'))
from unittest import TestSuite import os import subprocess import signal import pyvcal from ...util import rmrf api = pyvcal.get_api('perforce') path = os.path.join(os.path.dirname(__file__), '..', 'repositories', 'perforce') class BasicRepository(object): """Represents our 'basic' test repository""" def __init__(self): """Run the create_basic_repository script and connect to the created repository.""" super(BasicRepository, self).__init__() os.chdir(path) subprocess.Popen(['bash', 'create_basic_repository.sh'], stdout=subprocess.PIPE).wait() os.chdir(os.path.join('basic', 'repo')) ## A running perforce server process. self.p4d = subprocess.Popen(['p4d'], stdout=subprocess.PIPE) import time time.sleep(2) def repo(self): """Return the PyVCAL Repository"""