Page MenuHomePhabricator

verifySubversionRoot generates a Error while updating the "example" repository
Open, Needs TriagePublic

Description

I stumbled over a small issue when using an svn vcs with a svn root like: svn+ssh://sometoken@svn.example.com/. See stacktrace below.
Subversion finds in the URI an @ char and treats it as Revision marker. And the tells tha svn.example.com is not a parsable revision.

Here is the commit which added this checks, which are ok: https://github.com/phacility/phabricator/commit/c9a0ffa1cfaf171da8199f7fa79254e64ff6d0ae
The PhabricatorRepositoryDiscoveryEngine::verifySubversionRoot function generates the 'svn info' request.

I found a possible solution for this issue here: how-to-escape-characters-in-subversion-managed-file-names
"You need only append an @ sign to the end of the path'

I don't know if this is the only location where to fix this issue.

Stacktrace from the daemon.log:

[14-Jan-2015 10:17:10] [2015-01-14 10:17:10] EXCEPTION: (PhutilProxyException) Error while updating the "example" repository. {>} (CommandException) Command failed with error #255!
COMMAND
'/home/phabricator/phabricator/bin/repository' update  -- 'example'

STDOUT
(empty)

STDERR
[2015-01-14 10:17:10] EXCEPTION: (CommandException) Command failed with error #1!
COMMAND
svn --non-interactive info --xml 'svn+ssh://xxxxx@svn.example.com'

STDOUT
<?xml version="1.0"?>
<info>


STDERR
svn: Try 'svn help' for more info
svn: Syntax error parsing revision 'svn.example.com'
 at [<phutil>/src/future/exec/ExecFuture.php:397]
  #0 ExecFuture::resolvex() called at [<phabricator>/src/applications/repository/storage/PhabricatorRepository.php:293]
  #1 PhabricatorRepository::execxRemoteCommand(string, string) called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:220]
  #2 PhabricatorRepositoryDiscoveryEngine::verifySubversionRoot(PhabricatorRepository) called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:148]
  #3 PhabricatorRepositoryDiscoveryEngine::discoverSubversionCommits() called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.... (796 more bytes) ... at [<phutil>/src/future/exec/ExecFuture.php:397]
[14-Jan-2015 10:17:10]   #0 ExecFuture::resolvex() called at [<phabricator>/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:328]
[14-Jan-2015 10:17:10]   #1 PhabricatorRepositoryPullLocalDaemon::resolveUpdateFuture(PhabricatorRepository, ExecFuture, integer) called at [<phabricator>/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:198]
[14-Jan-2015 10:17:10]   #2 PhabricatorRepositoryPullLocalDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:91]
[14-Jan-2015 10:17:10]   #3 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:111]

Possible Solution:

replace the

/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php

   private function verifySubversionRoot(PhabricatorRepository $repository) {
-    list($xml) = $repository->execxRemoteCommand(
-      'info --xml %s',
-      $repository->getSubversionPathURI());
+
+    $subversionPathURI = $repository->getSubversionPathURI();
+
+    if (strpos($subversionPathURI, 'svn+ssh') !== false && strpos($subversionPathURI, '@') !== false) {
+      $subversionPathURI .= '@';
+    }
+
+    list($xml) = $repository->execxRemoteCommand('info --xml %s', $subversionPathURI);

Event Timeline

taemtha raised the priority of this task from to Needs Triage.
taemtha updated the task description. (Show Details)
taemtha added a project: Repositories.
taemtha added a subscriber: taemtha.
chad renamed this task from verifySubversionRoot generates a Error while updating the "example" repository. (svn info request failes) to verifySubversionRoot generates a Error while updating the "example" repository.Jan 16 2015, 5:53 PM