예제 #1
0
    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')
예제 #2
0
 def testGetRelativeFile(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('file:var/dist/public/foo.git').name, 'git')
예제 #3
0
 def testGetHttpsByPath(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('https://jarn.com/hg/public/foo').name, 'hg')
예제 #4
0
 def testGetHttpByHostWithUser(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('http://[email protected]/public/foo').name, 'hg')
예제 #5
0
 def testGetSshByExtension(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('ssh://jarn.com/public/foo.git').name, 'git')
예제 #6
0
 def testGetRsync(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('rsync://').name, 'git')
예제 #7
0
 def testGetSvnSsh(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('svn+ssh://').name, 'svn')
예제 #8
0
 def testGetHttpsGitHub(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('https://[email protected]/jondoe/foo').name, 'git')
예제 #9
0
 def testGetSshGitHub(self):
     scms = SCMFactory()
     self.assertEqual(scms.get_scm_from_url('ssh://[email protected]/jondoe/foo').name, 'git')