当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorRepository::getSubversionPathURI方法代码示例

本文整理汇总了PHP中PhabricatorRepository::getSubversionPathURI方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorRepository::getSubversionPathURI方法的具体用法?PHP PhabricatorRepository::getSubversionPathURI怎么用?PHP PhabricatorRepository::getSubversionPathURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorRepository的用法示例。


在下文中一共展示了PhabricatorRepository::getSubversionPathURI方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSubversionPathInfo

 public function testSubversionPathInfo()
 {
     $svn = PhabricatorRepositoryType::REPOSITORY_TYPE_SVN;
     $repo = new PhabricatorRepository();
     $repo->setVersionControlSystem($svn);
     $repo->setDetail('remote-uri', 'http://svn.example.com/repo');
     $this->assertEqual('http://svn.example.com/repo', $repo->getSubversionPathURI());
     $repo->setDetail('remote-uri', 'http://svn.example.com/repo/');
     $this->assertEqual('http://svn.example.com/repo', $repo->getSubversionPathURI());
     $repo->setDetail('hosting-enabled', true);
     $repo->setLocalPath('/var/repo/SVN');
     $this->assertEqual('file:///var/repo/SVN', $repo->getSubversionPathURI());
     $repo->setLocalPath('/var/repo/SVN/');
     $this->assertEqual('file:///var/repo/SVN', $repo->getSubversionPathURI());
     $this->assertEqual('file:///var/repo/SVN/a@', $repo->getSubversionPathURI('a'));
     $this->assertEqual('file:///var/repo/SVN/a@1', $repo->getSubversionPathURI('a', 1));
     $this->assertEqual('file:///var/repo/SVN/%3F@22', $repo->getSubversionPathURI('?', 22));
     $repo->setDetail('svn-subpath', 'quack/trunk/');
     $this->assertEqual('file:///var/repo/SVN/quack/trunk/@', $repo->getSubversionBaseURI());
     $this->assertEqual('file:///var/repo/SVN/quack/trunk/@HEAD', $repo->getSubversionBaseURI('HEAD'));
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:21,代码来源:PhabricatorRepositoryTestCase.php

示例2: verifySubversionRoot

 private function verifySubversionRoot(PhabricatorRepository $repository)
 {
     list($xml) = $repository->execxRemoteCommand('info --xml %s', $repository->getSubversionPathURI());
     $xml = phutil_utf8ize($xml);
     $xml = new SimpleXMLElement($xml);
     $remote_root = (string) $xml->entry[0]->repository[0]->root[0];
     $expect_root = $repository->getSubversionPathURI();
     $normal_type_svn = PhabricatorRepositoryURINormalizer::TYPE_SVN;
     $remote_normal = id(new PhabricatorRepositoryURINormalizer($normal_type_svn, $remote_root))->getNormalizedPath();
     $expect_normal = id(new PhabricatorRepositoryURINormalizer($normal_type_svn, $expect_root))->getNormalizedPath();
     if ($remote_normal != $expect_normal) {
         throw new Exception(pht('Repository "%s" does not have a correctly configured remote URI. ' . 'The remote URI for a Subversion repository MUST point at the ' . 'repository root. The root for this repository is "%s", but the ' . 'configured URI is "%s". To resolve this error, set the remote URI ' . 'to point at the repository root. If you want to import only part ' . 'of a Subversion repository, use the "Import Only" option.', $repository->getDisplayName(), $remote_root, $expect_root));
     }
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:14,代码来源:PhabricatorRepositoryDiscoveryEngine.php

示例3: lookupRecursiveFileList

 private function lookupRecursiveFileList(PhabricatorRepository $repository, array $info)
 {
     $path = $info['rawPath'];
     $rev = $info['rawCommit'];
     $path_uri = $repository->getSubversionPathURI($path, $rev);
     $hashkey = md5($path_uri);
     // This method is quite horrible. The underlying challenge is that some
     // commits in the Facebook repository are enormous, taking multiple hours
     // to 'ls -R' out of the repository and producing XML files >1GB in size.
     // If we try to SimpleXML them, the object exhausts available memory on a
     // 64G machine. Instead, cache the XML output and then parse it line by line
     // to limit space requirements.
     $cache_loc = sys_get_temp_dir() . '/diffusion.' . $hashkey . '.svnls';
     if (!Filesystem::pathExists($cache_loc)) {
         $tmp = new TempFile();
         $repository->execxRemoteCommand('--xml ls -R %s > %s', $path_uri, $tmp);
         execx('mv %s %s', $tmp, $cache_loc);
     }
     $map = $this->parseRecursiveListFileData($cache_loc);
     Filesystem::remove($cache_loc);
     return $map;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:22,代码来源:PhabricatorRepositorySvnCommitChangeParserWorker.php


注:本文中的PhabricatorRepository::getSubversionPathURI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。