You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Roman Kellner <mu...@gmx.net> on 2011/12/05 09:59:44 UTC

svn_client_revert2 skips files for no obvious reasons

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@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 can be the cause?
How comes the directory works with svn_client_revert2() and svn revert and 
TortoiseSVN too but not the files?

The behaviour hints to the filenames, which are odd but did not cause a 
problem so far. Or do we have to somehow refresh/reload the wc_admin area 
to recognize the changes done by the SCC-SVN client, since both run in the 
same program/thread?

Did anyone have the same or a similar issue and knows how to solve it?

Thanks

Roman
    
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

Re: svn_client_revert2 skips files for no obvious reasons

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Dec 05, 2011 at 04:23:10PM +0100, Roman Kellner wrote:
> > What paths are you actually passing in the 'paths' array?
> 
> D:\NewFolder\iec61131\ProjectName\SCC\@POE@OriginalFilename.ZIP
> D:\NewFolder\iec61131\ProjectName\SCC\@POE@OriginalFilenameRENAMED.ZIP
> 
> > 
> > Are you passing absolute paths? 
> 
> Yes.
> 
> > Are you canonicalising the paths properly?
> 
> We are not doing extra things to the paths, but I would guess that the path 
> as above already is canonicalized. Wrong?

The paths are not canonical. Subversion always uses forward slashes
internally. Run the paths through svn_dirent_internal_style() and it
should work. This function will replace backslashes with forward slashes
and also canonicalise the paths.

Re: svn_client_revert2 skips files for no obvious reasons

Posted by Roman Kellner <mu...@gmx.net>.
> -------- Original-Nachricht --------
> Datum: Mon, 5 Dec 2011 11:38:12 +0100
> Von: Stefan Sperling <st...@elego.de>
> An: Roman Kellner <mu...@gmx.net>
> CC: users@subversion.apache.org
> Betreff: Re: svn_client_revert2 skips files for no obvious reasons
> 
>             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@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?

D:\NewFolder\iec61131\ProjectName\SCC\@POE@OriginalFilename.ZIP
D:\NewFolder\iec61131\ProjectName\SCC\@POE@OriginalFilenameRENAMED.ZIP

> 
> Are you passing absolute paths? 

Yes.

> Are you canonicalising the paths properly?

We are not doing extra things to the paths, but I would guess that the path 
as above already is canonicalized. Wrong?

> 
> 
> 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.
We had a look and could not recognize anything spezial that we could have 
forgotten (v.1.6.17). Now with 1.7.1 the new check function 
             SVN_ERR(svn_cl__check_targets_are_local_paths(targets));

has been added. The function basically check that it is not a URL, what I 
can tell from the code.

Thanks for the hints.

Roman            
> 
> 
        
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

Re: svn_client_revert2 skips files for no obvious reasons

Posted by Stefan Sperling <st...@elego.de>.
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@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.