1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

Fix an issue with SVN path construction in the presence of subpath configuration

Summary: D7590 made path construction more consistent, but affected this callsite if a subpath is configured. Currently, we end up with double `@@` in the URI.

Test Plan:
  - Ran unit tests.
  - Ran `bin/repostitory discover`.

Reviewers: staticshock, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7619
This commit is contained in:
epriestley 2013-11-21 14:41:38 -08:00
parent 3a035c02e7
commit e99c53da2e
3 changed files with 15 additions and 5 deletions

View file

@ -88,10 +88,9 @@ final class PhabricatorRepositoryDiscoveryEngine
try {
list($xml, $stderr) = $repository->execxRemoteCommand(
'log --xml --quiet --limit %d %s@%s',
'log --xml --quiet --limit %d %s',
$limit,
$repository->getSubversionBaseURI(),
$at_rev);
$repository->getSubversionBaseURI($at_rev));
} catch (CommandException $ex) {
$stderr = $ex->getStdErr();
if (preg_match('/(path|File) not found/', $stderr)) {

View file

@ -155,12 +155,12 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
return $this->getDetail('local-path');
}
public function getSubversionBaseURI() {
public function getSubversionBaseURI($commit = null) {
$subpath = $this->getDetail('svn-subpath');
if (!strlen($subpath)) {
$subpath = null;
}
return $this->getSubversionPathURI($subpath);
return $this->getSubversionPathURI($subpath, $commit);
}
public function getSubversionPathURI($path = null, $commit = null) {

View file

@ -94,6 +94,17 @@ final class PhabricatorRepositoryTestCase
$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'));
}