[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn_client_revert2 skips files for no obvious reasons

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 5 Dec 2011 11:38:12 +0100

On Mon, Dec 05, 2011 at 09:59:44AM +0100, Roman Kellner wrote:
> Hi
>
> We are implementing a wrapper around a SCC-SVN client in order to over come
> some flaws between the IDE and the SCC-SVN client.
>
> Now we need to use the svn_client_revert2 function in order to revert
> scheduled actions (add, delete) when the commit fails due to the commit
> hock.
>
> Order:
> WrapperSccRename()
> -> rtn = SccSvnClientSccRename()
> --> rtn != OK : svn_client_revert2() with the same files passed to
> SccRenameSccSvnClient()
> return from WrapperSccRename()
>
> When using the
>
> * svn_client_revert2 (  const
> apr_array_header_t *  paths,
> svn_depth_t  depth,
> const apr_array_header_t *  changelists,
> svn_client_ctx_t * 
> ctx, apr_pool_t
> *  pool
>
> function it skips the files given in paths. The function thinks the files
> are not under version control (notify says -> skip file).
>
> The filenames from the IDE are somewhat unusual/weird: e.g.
> @POE_at_ProgramUnitName.ZIP
>
> On the command line we had to add the extra @ to prevent half of the
> filename be eaten as PEG revision. But with the extra @ reverting from the
> command line or with TortoiseSVN works well.
> Also if instead of the files in paths the directory where the files are
> located is passed, then svn_client_revert2() does the job.
> But reverting the whole directory is not what we need and want.

What paths are you actually passing in the 'paths' array?
Are you passing absolute paths? Are you canonicalising the paths properly?

The @ syntax parsing is done by the 'svn' client before it calls into
the client library. So you should not append '@' to the filenames passed
to svn_client_revert2().

> What can be the cause?
> How comes the directory works with svn_client_revert2() and svn revert and
> TortoiseSVN too but not the files?

Have you taken a look at how the command line client handles its arguments
and what it passes to svn_client_revert2()?
See https://svn.apache.org/repos/asf/subversion/trunk/subversion/svn/revert-cmd.c
and the functions it calls.
Received on 2011-12-05 11:38:55 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.