Hello,

On 2024/05/01 18:28, Daniel Sahlberg wrote:
> Hi,
> 
> This is based on a problem we have in the TortoiseSVN project and I'm not
> proficient enough in the API to resolve it myself.
> 
> We know of a path that existed at one point in time (basically a peg
> revision). We would like to connect to the repository and figure out the
> current HEAD revision (we don't care about the repository content at this
> time).
> 
> We use svn_client_open_ra_session2() for the connection and send in the
> path. This may fail if the path has subsequently been removed. So we
> instead tried to send in "/", but that failed for some users who don't have
> read access to the repository root but only on certain subdirectories.

const char *wri_abspath in svn_client_open_ra_session2() can be NULL,
and const char *url can be pointed to non-exist node within the repository.

Here is an example using Python bindings
(svn_client_open_ra_session() acts as wri_abspath is NULL):
[[[
$ sudo -u mailman -g mailman svn ls svn+ssh://svn-agent-sysadmin@localhost/@
svn: E170001: Authorization failed
$ sudo -u mailman -g mailman python
Python 2.7.5 (default, Nov 14 2023, 16:14:06)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from svn import core,client,ra
>>> ctx = client.create_context()
>>> session = client.open_ra_session('svn+ssh://svn-agent-sysadmin@localhost/', 
>>> ctx)
>>> ra.get_latest_revnum(session)
2221
>>> session2 = 
>>> client.open_ra_session('https://svn.apache.org/repos/asf/non-existent/',ctx)
>>> ra.get_latest_revnum(session2)
1917447
>>> quit()
]]]

Cheers,
-- 
Yasuhito FUTATSUKI <futat...@yf.bsdclub.org>

Reply via email to