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 testGetRelativeFile(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('file:var/dist/public/foo.git').name, 'git')
def testGetHttpsByPath(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('https://jarn.com/hg/public/foo').name, 'hg')
def testGetHttpByHostWithUser(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('http://[email protected]/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 testGetRsync(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('rsync://').name, 'git')
def testGetSvnSsh(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('svn+ssh://').name, 'svn')
def testGetHttpsGitHub(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('https://[email protected]/jondoe/foo').name, 'git')
def testGetSshGitHub(self): scms = SCMFactory() self.assertEqual(scms.get_scm_from_url('ssh://[email protected]/jondoe/foo').name, 'git')