Page MenuHomePhorge

"arc browse <file>" does not support Subversion
Open, LowPublic

Description

It seems to me that arc browse does not support files in a Subversion repository.

Steps to reproduce:

Have a Subversion repository hosted in Phorge and have a file (example: README.md).

Have a similar .arcconfig:

.arcconfig
{
  "phabricator.uri" : "https://phorge.example.com/"
}

Run:

arc browse README.md

Your browser web will visit this HTTP 404 Page not found page:

https://phorge.example.com/browse/master/README.md

This should happen instead:

https://phorge.example.com/source/<repo>/browse/README.md

To me, we have two bugs:

  1. the repository is not recognized
  2. the branch should be omitted in a Subversion URL

About the point n. 2, this is a related TODO:

https://we.phorge.it/source/arcanist/browse/master/src/ref/ArcanistRepositoryRef.php;152ba1f02a31b7e48ed2923b611e66f951c9fdf0$95-96

Event Timeline

valerio.bozzolan created this task.
valerio.bozzolan created this object in space S1 Public.

Hi @speck are you still a Mercurial user? Does arc browse <file> work for you? Just for my curiosity

Since Subversion allows to checkout just a sub-directory,

Arcanist should probably query svn info to get that relative URL.

Example output, from one svn checkout ... from the /trunk sub-directory:

$ svn info
Path: .
Working Copy Root Path: /home/boz/example_repo
URL: svn+ssh://phorge@phorge.example.com/source/example_repo/trunk
Relative URL: ^/trunk
Repository Root: svn+ssh://phorge@phorge.example.com/source/example_repo
Repository UUID: stuff-stuff-stuff
Revision: 1854
Node Kind: directory
Schedule: normal
Last Changed Author: valerio.bozzolan
Last Changed Rev: 1854
Last Changed Date: 2024-02-27 19:01:57 +0100 (mar, 27 feb 2024)

Checking from the / directory instead:

$ svn info
Path: .
Working Copy Root Path: /home/boz/example_repo
URL: svn+ssh://phorge@phorge.example.com/source/example_repo
Relative URL: ^/
Repository Root: svn+ssh://phorge@phorge.example.com/source/example_repo
Repository UUID: stuff-stuff-stuff
Revision: 1854
Node Kind: directory
Schedule: normal
Last Changed Author: valerio.bozzolan
Last Changed Rev: 1854
Last Changed Date: 2024-02-27 19:01:57 +0100 (mar, 27 feb 2024)

So apparently we should parse the Relative URL and use that path to build the browse URI. Instead of just appending "master" that has no sense there.