Ivan Zhakov | 1 Oct 2005 01:04
Picon

Re: How to get prop path for SVN_WC_THIS_DIR?

On 10/1/05, Daniel Rall <dlr <at> finemaltcoding.com> wrote:
> On Fri, 30 Sep 2005, Ivan Zhakov wrote:
>
> > Hi!
> > I am working to make svn_wc_revert2() loggy. For write log file I need
> > get relative path for dir-props files. I use function
> > svn_wc__prop_path(), but if I pass SVN_WC_THIS_DIR as path it returns
> > prop path for file property instead for dir-props, but it works with
> > full directory path. Problem occurs when svn_wc__prop_path() calls
> > svn_wc_entry() and didn't find entry for SVN_WC_THIS_DIR. I see two
> > ways how this should be fixed:
> > 1. Teach svn_wc_entry to handle SVN_WC_THIS_DIR argument as edge case
> > and return entry for adm_access itself.
> > 2. Teach svn_wc__adm_retrieve_internal handle SVN_WC_THIS_DIR
> > situation and return associated adm_acces.
> >
> > Ideas?
>
> Would getting the path from svn_wc_adm_access_path(adm_access) work to
> simply avoid the issue?
Yes, in this case svn_wc__prop_path returns valid path, but it will be
full path therefore I need implement ugly logic to remove
svn_wc_adm_access_path(adm_access) prefix from it. As it done in
svn_wc__merge_props().

--
Ivan Zhakov
Ivan Zhakov | 1 Oct 2005 01:10
Picon

Re: How to get prop path for SVN_WC_THIS_DIR?

On 10/1/05, Philip Martin <philip <at> codematters.co.uk> wrote:
> Ivan Zhakov <chemodax <at> gmail.com> writes:
>
> > I am working to make svn_wc_revert2() loggy. For write log file I need
> > get relative path for dir-props files. I use function
> > svn_wc__prop_path(), but if I pass SVN_WC_THIS_DIR as path it returns
>
> SVN_WC_THIS_DIR is not a path.
>
> > prop path for file property instead for dir-props, but it works with
> > full directory path. Problem occurs when svn_wc__prop_path() calls
> > svn_wc_entry() and didn't find entry for SVN_WC_THIS_DIR. I see two
> > ways how this should be fixed:
> > 1. Teach svn_wc_entry to handle SVN_WC_THIS_DIR argument as edge case
> > and return entry for adm_access itself.
> > 2. Teach svn_wc__adm_retrieve_internal handle SVN_WC_THIS_DIR
> > situation and return associated adm_acces.
>
> Pass the directory path instead of SVN_WC_THIS_DIR.
In this case I will get full path for prop file. It's inconveniently
because for writing log I need relative path. Therefore I need remove
it by ugly logic similar to svn_wc__merge_props().

--
Ivan Zhakov
Philip Martin | 1 Oct 2005 01:14
Picon

Re: How to get prop path for SVN_WC_THIS_DIR?

Ivan Zhakov <chemodax <at> gmail.com> writes:

> On 10/1/05, Philip Martin <philip <at> codematters.co.uk> wrote:
>>
>> Pass the directory path instead of SVN_WC_THIS_DIR.
> In this case I will get full path for prop file. It's inconveniently
> because for writing log I need relative path. Therefore I need remove
> it by ugly logic similar to svn_wc__merge_props().

Move the "ugly logic" into a function and have both places call it.

--

-- 
Philip Martin
Ivan Zhakov | 1 Oct 2005 01:23
Picon

Re: How to get prop path for SVN_WC_THIS_DIR?

On 10/1/05, Philip Martin <philip <at> codematters.co.uk> wrote:
> Ivan Zhakov <chemodax <at> gmail.com> writes:
>
> > On 10/1/05, Philip Martin <philip <at> codematters.co.uk> wrote:
> >>
> >> Pass the directory path instead of SVN_WC_THIS_DIR.
> > In this case I will get full path for prop file. It's inconveniently
> > because for writing log I need relative path. Therefore I need remove
> > it by ugly logic similar to svn_wc__merge_props().
>
> Move the "ugly logic" into a function and have both places call it.
You really think so? For me removing path from computed path is
errorful and darkly:
<<
[snip]
  const char *access_path = svn_wc_adm_access_path (adm_access);
  int access_len = strlen (access_path);

  /* Empty path and paths ending in / don't need an extra slash removed */
  if (access_len == 0 || access_path[access_len - 1] == '/')
    slash = 0;
  else
    slash = 1;
[snip]
  /* Compute pathnames for the "mv" log entries.  Notice that these
     paths are RELATIVE pathnames (each beginning with ".svn/"), so
     that each .svn subdir remains separable when executing run_log().  */
  tmp_props = apr_pstrdup (pool, local_prop_tmp_path + access_len + slash);
  real_props = apr_pstrdup (pool, local_propfile_path + access_len + slash);
>>
(Continue reading)

Branko Čibej | 1 Oct 2005 01:32
Picon

Re: [Patch] Fix position of apr_initialize() in Python bindings

David James wrote:

>On 9/30/05, Max Bowsher <maxb <at> ukf.net> wrote:
>  
>
>>Move apr initialization into the C code that runs as a result of "import
>>libsvn._core", which should be imported as a result of importing any other
>>module.
>>
>>I'd commit this, but I'm about to go out for a few hours, so I'll just post
>>it here for now.
>>
>>
>>Index: subversion/bindings/swig/core.i
>>===================================================================
>>--- subversion/bindings/swig/core.i (revision 16377)
>>+++ subversion/bindings/swig/core.i (working copy)
>> <at>  <at>  -635,6 +635,8  <at>  <at> 
>> PyObject *svn_swig_py_register_cleanup(PyObject *py_pool, apr_pool_t
>>*pool);
>>
>> %init %{
>>+apr_initialize();
>>    
>>
>Can we add "atexit(apr_terminate)" here, and remove apr_terminate from
>proxy_apr.swg? I think this would be a good idea, because it would
>guarantee that no pools are used after APR is terminated.
>  
>
(Continue reading)

Branko Čibej | 1 Oct 2005 01:36
Picon

Re: [Patch] Fix position of apr_initialize() in Python bindings

Branko Čibej wrote:

> David James wrote:
>
>> On 9/30/05, Max Bowsher <maxb <at> ukf.net> wrote:
>>  
>>
>>> Move apr initialization into the C code that runs as a result of 
>>> "import
>>> libsvn._core", which should be imported as a result of importing any 
>>> other
>>> module.
>>>
>>> I'd commit this, but I'm about to go out for a few hours, so I'll 
>>> just post
>>> it here for now.
>>>
>>>
>>> Index: subversion/bindings/swig/core.i
>>> ===================================================================
>>> --- subversion/bindings/swig/core.i (revision 16377)
>>> +++ subversion/bindings/swig/core.i (working copy)
>>>  <at>  <at>  -635,6 +635,8  <at>  <at> 
>>> PyObject *svn_swig_py_register_cleanup(PyObject *py_pool, apr_pool_t
>>> *pool);
>>>
>>> %init %{
>>> +apr_initialize();
>>>   
>>
(Continue reading)

Philip Martin | 1 Oct 2005 01:38
Picon

Re: How to get prop path for SVN_WC_THIS_DIR?

Ivan Zhakov <chemodax <at> gmail.com> writes:

> On 10/1/05, Philip Martin <philip <at> codematters.co.uk> wrote:
>> Move the "ugly logic" into a function and have both places call it.
> You really think so? For me removing path from computed path is
> errorful and darkly:
> <<
> [snip]
>   const char *access_path = svn_wc_adm_access_path (adm_access);
>   int access_len = strlen (access_path);
>
>   /* Empty path and paths ending in / don't need an extra slash removed */
>   if (access_len == 0 || access_path[access_len - 1] == '/')
>     slash = 0;
>   else
>     slash = 1;
> [snip]
>   /* Compute pathnames for the "mv" log entries.  Notice that these
>      paths are RELATIVE pathnames (each beginning with ".svn/"), so
>      that each .svn subdir remains separable when executing run_log().  */
>   tmp_props = apr_pstrdup (pool, local_prop_tmp_path + access_len + slash);
>   real_props = apr_pstrdup (pool, local_propfile_path + access_len + slash);
>>>
> Also this code assumes that how svn_wc__prop_path() makes it's path.

Moving that code into a new function would seem to be an improvement;
the new function could be put in the same file as svn_wc__prop_path.

> Why we need interpret things that just joined? Why our wc code wories
> about slash characters?
(Continue reading)

Max Bowsher | 1 Oct 2005 01:41

Publicly visible variable _global_svn_swig_py_is_local_pool needs to be properly namespaced.

The variable _global_svn_swig_py_is_local_pool is publicly visible.

Any public symbol ought to be properly namespaced, so it needs to be 
renamed, possibly to svn_swig_py__global_is_local_pool. What exactly does 
this variable record? Is there possibly a better name for it?

Max.
Max Bowsher | 1 Oct 2005 01:44

Re: svn commit: r16379 - trunk/subversion/clients/cmdline/schema

Philip Martin wrote:
> lundblad <at> tigris.org writes:
>
>> Author: lundblad
>> Date: Fri Sep 30 16:06:24 2005
>> New Revision: 16379
>
>> +namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
>
> $ wget http://relaxng.org/ns/compatibility/annotations/1.0
> --22:24:16--  http://relaxng.org/ns/compatibility/annotations/1.0
>           => `1.0'
> Resolving relaxng.org... 161.58.244.53
> Connecting to relaxng.org[161.58.244.53]:80... connected.
> HTTP request sent, awaiting response... 404 Not Found
> 22:24:16 ERROR 404: Not Found.

An XML namespace URI is required to be unique and persistent, but there is 
no requirement for it to actually point to anything.

Max.
Ivan Zhakov | 1 Oct 2005 01:53
Picon

Re: How to get prop path for SVN_WC_THIS_DIR?

On 10/1/05, Philip Martin <philip <at> codematters.co.uk> wrote:
> Ivan Zhakov <chemodax <at> gmail.com> writes:
>
> > On 10/1/05, Philip Martin <philip <at> codematters.co.uk> wrote:
> >> Move the "ugly logic" into a function and have both places call it.
> > You really think so? For me removing path from computed path is
> > errorful and darkly:
> > <<
> > [snip]
> >   const char *access_path = svn_wc_adm_access_path (adm_access);
> >   int access_len = strlen (access_path);
> >
> >   /* Empty path and paths ending in / don't need an extra slash removed */
> >   if (access_len == 0 || access_path[access_len - 1] == '/')
> >     slash = 0;
> >   else
> >     slash = 1;
> > [snip]
> >   /* Compute pathnames for the "mv" log entries.  Notice that these
> >      paths are RELATIVE pathnames (each beginning with ".svn/"), so
> >      that each .svn subdir remains separable when executing run_log().  */
> >   tmp_props = apr_pstrdup (pool, local_prop_tmp_path + access_len + slash);
> >   real_props = apr_pstrdup (pool, local_propfile_path + access_len + slash);
> >>>
> > Also this code assumes that how svn_wc__prop_path() makes it's path.
>
> Moving that code into a new function would seem to be an improvement;
> the new function could be put in the same file as svn_wc__prop_path.
Of course I could do so, but I consider that only svn_path_* functions
should know about slashes and etc?
(Continue reading)


Gmane