def _get_buildout_url(): """Get the base buildout url """ scm = SCMFactory() wc = scm.get_scm_from_sandbox(os.getcwd()) sandbox_url = wc.get_url_from_sandbox(os.getcwd()) base_dir = wc.get_base_url_from_sandbox(os.getcwd()) return sandbox_url, base_dir
def testGetGitifySubversion(self): """ Support git-svn-helpers/gitify style dual git/svn checkouts/clones. """ # Simulate a git-svn-helpers/gitify style dual svn/git checkout/clone svn_url = urlparse.urlunsplit(('file', '', self.packagedir, '', '')) git_svn_clonedir = self.clonedir + '.git-svn' process = Process(quiet=True) process.system( 'git svn clone -s {0} {1}'.format(svn_url, git_svn_clonedir)) os.rename( os.path.join(git_svn_clonedir, '.git'), os.path.join(self.clonedir, '.git')) scms = SCMFactory() self.assertEqual(scms.get_scm_from_url(svn_url).name, 'svn') self.assertEqual(scms.get_scm_from_sandbox(self.clonedir).name, 'svn')
def testGetSubversion(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_type('svn').name, 'svn')
def testGetHttpsGitHub(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('https://[email protected]/jondoe/foo').name, 'git')
def testGetFromSandbox(self): scms = SCMFactory() self.destroy(name='svn') self.assertEqual(scms.get_scm(None, self.packagedir).name, 'hg')
def testGetHttpsByPath(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('https://jarn.com/hg/public/foo').name, 'hg')
def testGetSshByExtension(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('ssh://jarn.com/public/foo.git').name, 'git')
def testGetSvnSsh(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('svn+ssh://').name, 'svn')
def testGetSubversion(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_sandbox(self.clonedir).name, 'svn')
def testGetFromUrl(self): scms = SCMFactory() self.assertEqual(scms.get_scm(None, 'git://jarn.com/public').name, 'git')
def testGetFromType(self): scms = SCMFactory() self.assertEqual(scms.get_scm('git', self.packagedir).name, 'git')
def testGetFromSandbox(self): scms = SCMFactory() self.assertEqual(scms.get_scm(None, self.clonedir).name, 'svn')
def testGetFromType(self): scms = SCMFactory() self.assertEqual(scms.get_scm('svn', self.clonedir).name, 'svn')
def testGetMercurial(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_sandbox(self.packagedir).name, 'hg')
def testGetMercurial(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_type('hg').name, 'hg')
def testGetGit(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_type('git').name, 'git')
def testGetFromFileUrl(self): scms = SCMFactory() self.assertEqual(scms.get_scm(None, 'file://'+self.packagedir).name, 'git')
def testGetGit(self): scms = SCMFactory() self.destroy(name='svn') self.assertEqual(scms.get_scm_from_sandbox(self.packagedir).name, 'git')
def testGetFromSshUrl(self): scms = SCMFactory() self.assertEqual(scms.get_scm(None, '[email protected]:Jarn/jarn.mkrelease').name, 'git')
def testGetRsync(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('rsync://').name, 'git')
def testGetFromSandbox(self): scms = SCMFactory() self.assertEqual(scms.get_scm(None, self.packagedir).name, 'git')
def testGetHttpByHostWithUser(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('http://[email protected]/public/foo').name, 'hg')
def scm(self): return SCMFactory().get_scm_from_type(self.name)
def testGetRelativeFile(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('file:var/dist/public/foo.git').name, 'git')
def testGetSshGitHub(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('ssh://[email protected]/jondoe/foo').name, 'git')