You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2008/03/18 17:38:04 UTC

SVN 1.5 - Beta 1 - mkdir behavior

Hi there,

i have observed a little bit odd behavior (in my opinion) of the mkdir
comment in relationship with the --parents option...

I have created a clean new repository and after that i have given the
following on the command line:

svn mkdir --parents \
    $URL/project1/trunk \
    $URL/project1/tags \
    $URL/project1/branches \
    $URL/project2/trunk \
    $URL/project2/tags \
    $URL/project2/branches -m"- First structure"

and got an error message:
svn: File already exists: filesystem '...', transaction '0-0', path
'/project1'

Is this intended behavior ? Or is my understanding not correct...
I had expected that those two intermediate directories (project1 and
project2) would have been created and the structure in the repository as
well....

Can someone enlighten me...
Thanks in advance...

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by "C. Michael Pilato" <cm...@collab.net>.
Karl Heinz Marbaise wrote:
> Hi there,
> 
> would it be a good choice to fill out an Bug issue into the issue tracker?

I went ahead and committed my fix (and an expansion to the related 
regression test) in r29950.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi there,

would it be a good choice to fill out an Bug issue into the issue tracker?

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi there,

thanks for the fast response....

> Yes, this is definitely a bug.  And the following is, I think, the fix:
> 
> Index: subversion/libsvn_client/add.c
> ===================================================================
> --- subversion/libsvn_client/add.c    (revision 29944)
> +++ subversion/libsvn_client/add.c    (working copy)
> @@ -34,6 +34,8 @@
>  #include "svn_io.h"
>  #include "svn_config.h"
>  #include "svn_props.h"
> +#include "svn_hash.h"
> +#include "svn_sorts.h"
>  #include "client.h"
> 
>  #include "svn_private_config.h"
> @@ -636,6 +638,7 @@
>    const char *log_msg;
>    apr_hash_t *revprop_table;
>    apr_array_header_t *targets;
> +  apr_hash_t *targets_hash;
>    svn_error_t *err;
>    const char *common;
>    int i;
> @@ -667,6 +670,8 @@
> 
>    /* Condense our list of mkdir targets. */
>    SVN_ERR(svn_path_condense_targets(&common, &targets, urls, FALSE,
> pool));
> +  SVN_ERR(svn_hash_from_cstring_keys(&targets_hash, targets, pool));
> +  SVN_ERR(svn_hash_keys(&targets, targets_hash, pool));
> 
>    if (! targets->nelts)
>      {
> @@ -702,6 +707,8 @@
>              }
>          }
>      }
> +  qsort(targets->elts, targets->nelts, targets->elt_size,
> +        svn_sort_compare_paths);
> 
>    /* Create new commit items and add them to the array. */
>    if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
> 
>> By the way, why isn't the '-p' short option available for this command?
> 
> Because we are very protective of our short option namespace.
> 
I have patched my installed SVN 1.5-beta1 version and rechecked the
behavior and it worked fine.

Thanks.

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by Troy Curtis Jr <tr...@gmail.com>.
On Tue, Mar 18, 2008 at 10:32 PM, Hyrum K. Wright
<hy...@mail.utexas.edu> wrote:
>
> C. Michael Pilato wrote:
>  > Troy Curtis Jr wrote:
>  >> On Tue, Mar 18, 2008 at 12:38 PM, Karl Heinz Marbaise
>  >> <kh...@gmx.de> wrote:
>  >>> Hi there,
>  >>>
>  >>>  i have observed a little bit odd behavior (in my opinion) of the mkdir
>  >>>  comment in relationship with the --parents option...
>  >>>
>  >>>  I have created a clean new repository and after that i have given the
>  >>>  following on the command line:
>  >>>
>  >>>  svn mkdir --parents \
>  >>>     $URL/project1/trunk \
>  >>>     $URL/project1/tags \
>  >>>     $URL/project1/branches \
>  >>>     $URL/project2/trunk \
>  >>>     $URL/project2/tags \
>  >>>     $URL/project2/branches -m"- First structure"
>  >>>
>  >>>  and got an error message:
>  >>>  svn: File already exists: filesystem '...', transaction '0-0', path
>  >>>  '/project1'
>  >>>
>  >>>  Is this intended behavior ? Or is my understanding not correct...
>  >>>  I had expected that those two intermediate directories (project1 and
>  >>>  project2) would have been created and the structure in the
>  >>> repository as
>  >>>  well....
>  >>>
>  >>>  Can someone enlighten me...
>  >>>  Thanks in advance...
>  >>>
>  >>>  Kind regards
>  >>>  Karl Heinz Marbaise
>  >>>  --
>  >>>  SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
>  >>>  Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
>  >>>  Hauptstrasse 177                         USt.IdNr: DE191347579
>  >>>  52146 Würselen                           http://www.soebes.de
>  >>>
>  >>>  ---------------------------------------------------------------------
>  >>>  To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>  >>>  For additional commands, e-mail: dev-help@subversion.tigris.org
>  >>>
>  >>>
>  >>
>  >> I am not really a developer here, but this is an interesting issue.  I
>  >> think you'll get an idea of what is going on if you allow it to open
>  >> an editor instead of providing a log message on the command-line.  You
>  >> get the following:
>  >>
>  >> A    $URL/project1
>  >> A    $URL/project1/trunk
>  >> A    $URL/project1
>  >> A    $URL/project1/tags
>  >> A    $URL/project1
>  >> A    $URL/project1/branches
>  >> A    $URL/project2
>  >> A    $URL/project2/trunk
>  >> A    $URL/project2
>  >> A    $URL/project2/tags
>  >> A    $URL/project2
>  >> A    $URL/project2/branches
>  >  >
>  >> So it seems that it is expanding the intermediate targets for each
>  >> argument
>  >> independently, not looking at any other targets being made.  I would
>  >> certainly
>  >> say that this is unexpected behavior.
>  >
>  > That's a great clue, Troy!
>  >
>  >> Personally I think it would be worth a bug report, as it really does
>  >> not match what you would get from the Linux command-line 'mkdir -p'
>  >> command.
>  >
>  > Yes, this is definitely a bug.  And the following is, I think, the fix:
>  >
>  > Index: subversion/libsvn_client/add.c
>  > ===================================================================
>  > --- subversion/libsvn_client/add.c    (revision 29944)
>  > +++ subversion/libsvn_client/add.c    (working copy)
>  > @@ -34,6 +34,8 @@
>  >  #include "svn_io.h"
>  >  #include "svn_config.h"
>  >  #include "svn_props.h"
>  > +#include "svn_hash.h"
>  > +#include "svn_sorts.h"
>  >  #include "client.h"
>  >
>  >  #include "svn_private_config.h"
>  > @@ -636,6 +638,7 @@
>  >    const char *log_msg;
>  >    apr_hash_t *revprop_table;
>  >    apr_array_header_t *targets;
>  > +  apr_hash_t *targets_hash;
>  >    svn_error_t *err;
>  >    const char *common;
>  >    int i;
>  > @@ -667,6 +670,8 @@
>  >
>  >    /* Condense our list of mkdir targets. */
>  >    SVN_ERR(svn_path_condense_targets(&common, &targets, urls, FALSE,
>  > pool));
>  > +  SVN_ERR(svn_hash_from_cstring_keys(&targets_hash, targets, pool));
>  > +  SVN_ERR(svn_hash_keys(&targets, targets_hash, pool));
>  >
>  >    if (! targets->nelts)
>  >      {
>  > @@ -702,6 +707,8 @@
>  >              }
>  >          }
>  >      }
>  > +  qsort(targets->elts, targets->nelts, targets->elt_size,
>  > +        svn_sort_compare_paths);
>  >
>  >    /* Create new commit items and add them to the array. */
>  >    if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
>  >
>
>  Nice use of hashes, Mike!  I haven't tested it, but the patch looks good
>  to me.
>
>  -Hyrum
>
>

It did at least fix the poster's issue in my test, which Michael
probably already knew.  I had to really think about why/how it fixed
the problem and I learned something new, so I second Hyrum's
accolades!

Troy
-- 
"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
C. Michael Pilato wrote:
> Troy Curtis Jr wrote:
>> On Tue, Mar 18, 2008 at 12:38 PM, Karl Heinz Marbaise 
>> <kh...@gmx.de> wrote:
>>> Hi there,
>>>
>>>  i have observed a little bit odd behavior (in my opinion) of the mkdir
>>>  comment in relationship with the --parents option...
>>>
>>>  I have created a clean new repository and after that i have given the
>>>  following on the command line:
>>>
>>>  svn mkdir --parents \
>>>     $URL/project1/trunk \
>>>     $URL/project1/tags \
>>>     $URL/project1/branches \
>>>     $URL/project2/trunk \
>>>     $URL/project2/tags \
>>>     $URL/project2/branches -m"- First structure"
>>>
>>>  and got an error message:
>>>  svn: File already exists: filesystem '...', transaction '0-0', path
>>>  '/project1'
>>>
>>>  Is this intended behavior ? Or is my understanding not correct...
>>>  I had expected that those two intermediate directories (project1 and
>>>  project2) would have been created and the structure in the 
>>> repository as
>>>  well....
>>>
>>>  Can someone enlighten me...
>>>  Thanks in advance...
>>>
>>>  Kind regards
>>>  Karl Heinz Marbaise
>>>  --
>>>  SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
>>>  Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
>>>  Hauptstrasse 177                         USt.IdNr: DE191347579
>>>  52146 Würselen                           http://www.soebes.de
>>>
>>>  ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>>>  For additional commands, e-mail: dev-help@subversion.tigris.org
>>>
>>>
>>
>> I am not really a developer here, but this is an interesting issue.  I
>> think you'll get an idea of what is going on if you allow it to open
>> an editor instead of providing a log message on the command-line.  You
>> get the following:
>>
>> A    $URL/project1
>> A    $URL/project1/trunk
>> A    $URL/project1
>> A    $URL/project1/tags
>> A    $URL/project1
>> A    $URL/project1/branches
>> A    $URL/project2
>> A    $URL/project2/trunk
>> A    $URL/project2
>> A    $URL/project2/tags
>> A    $URL/project2
>> A    $URL/project2/branches
>  >
>> So it seems that it is expanding the intermediate targets for each 
>> argument
>> independently, not looking at any other targets being made.  I would 
>> certainly
>> say that this is unexpected behavior.
> 
> That's a great clue, Troy!
> 
>> Personally I think it would be worth a bug report, as it really does
>> not match what you would get from the Linux command-line 'mkdir -p' 
>> command.
> 
> Yes, this is definitely a bug.  And the following is, I think, the fix:
> 
> Index: subversion/libsvn_client/add.c
> ===================================================================
> --- subversion/libsvn_client/add.c    (revision 29944)
> +++ subversion/libsvn_client/add.c    (working copy)
> @@ -34,6 +34,8 @@
>  #include "svn_io.h"
>  #include "svn_config.h"
>  #include "svn_props.h"
> +#include "svn_hash.h"
> +#include "svn_sorts.h"
>  #include "client.h"
> 
>  #include "svn_private_config.h"
> @@ -636,6 +638,7 @@
>    const char *log_msg;
>    apr_hash_t *revprop_table;
>    apr_array_header_t *targets;
> +  apr_hash_t *targets_hash;
>    svn_error_t *err;
>    const char *common;
>    int i;
> @@ -667,6 +670,8 @@
> 
>    /* Condense our list of mkdir targets. */
>    SVN_ERR(svn_path_condense_targets(&common, &targets, urls, FALSE, 
> pool));
> +  SVN_ERR(svn_hash_from_cstring_keys(&targets_hash, targets, pool));
> +  SVN_ERR(svn_hash_keys(&targets, targets_hash, pool));
> 
>    if (! targets->nelts)
>      {
> @@ -702,6 +707,8 @@
>              }
>          }
>      }
> +  qsort(targets->elts, targets->nelts, targets->elt_size,
> +        svn_sort_compare_paths);
> 
>    /* Create new commit items and add them to the array. */
>    if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
> 

Nice use of hashes, Mike!  I haven't tested it, but the patch looks good 
to me.

-Hyrum


Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by "C. Michael Pilato" <cm...@collab.net>.
Troy Curtis Jr wrote:
> On Tue, Mar 18, 2008 at 12:38 PM, Karl Heinz Marbaise <kh...@gmx.de> wrote:
>> Hi there,
>>
>>  i have observed a little bit odd behavior (in my opinion) of the mkdir
>>  comment in relationship with the --parents option...
>>
>>  I have created a clean new repository and after that i have given the
>>  following on the command line:
>>
>>  svn mkdir --parents \
>>     $URL/project1/trunk \
>>     $URL/project1/tags \
>>     $URL/project1/branches \
>>     $URL/project2/trunk \
>>     $URL/project2/tags \
>>     $URL/project2/branches -m"- First structure"
>>
>>  and got an error message:
>>  svn: File already exists: filesystem '...', transaction '0-0', path
>>  '/project1'
>>
>>  Is this intended behavior ? Or is my understanding not correct...
>>  I had expected that those two intermediate directories (project1 and
>>  project2) would have been created and the structure in the repository as
>>  well....
>>
>>  Can someone enlighten me...
>>  Thanks in advance...
>>
>>  Kind regards
>>  Karl Heinz Marbaise
>>  --
>>  SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
>>  Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
>>  Hauptstrasse 177                         USt.IdNr: DE191347579
>>  52146 Würselen                           http://www.soebes.de
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>>  For additional commands, e-mail: dev-help@subversion.tigris.org
>>
>>
> 
> I am not really a developer here, but this is an interesting issue.  I
> think you'll get an idea of what is going on if you allow it to open
> an editor instead of providing a log message on the command-line.  You
> get the following:
> 
> A    $URL/project1
> A    $URL/project1/trunk
> A    $URL/project1
> A    $URL/project1/tags
> A    $URL/project1
> A    $URL/project1/branches
> A    $URL/project2
> A    $URL/project2/trunk
> A    $URL/project2
> A    $URL/project2/tags
> A    $URL/project2
> A    $URL/project2/branches
 >
> So it seems that it is expanding the intermediate targets for each argument
> independently, not looking at any other targets being made.  I would certainly
> say that this is unexpected behavior.

That's a great clue, Troy!

> Personally I think it would be worth a bug report, as it really does
> not match what you would get from the Linux command-line 'mkdir -p' command.

Yes, this is definitely a bug.  And the following is, I think, the fix:

Index: subversion/libsvn_client/add.c
===================================================================
--- subversion/libsvn_client/add.c	(revision 29944)
+++ subversion/libsvn_client/add.c	(working copy)
@@ -34,6 +34,8 @@
  #include "svn_io.h"
  #include "svn_config.h"
  #include "svn_props.h"
+#include "svn_hash.h"
+#include "svn_sorts.h"
  #include "client.h"

  #include "svn_private_config.h"
@@ -636,6 +638,7 @@
    const char *log_msg;
    apr_hash_t *revprop_table;
    apr_array_header_t *targets;
+  apr_hash_t *targets_hash;
    svn_error_t *err;
    const char *common;
    int i;
@@ -667,6 +670,8 @@

    /* Condense our list of mkdir targets. */
    SVN_ERR(svn_path_condense_targets(&common, &targets, urls, FALSE, pool));
+  SVN_ERR(svn_hash_from_cstring_keys(&targets_hash, targets, pool));
+  SVN_ERR(svn_hash_keys(&targets, targets_hash, pool));

    if (! targets->nelts)
      {
@@ -702,6 +707,8 @@
              }
          }
      }
+  qsort(targets->elts, targets->nelts, targets->elt_size,
+        svn_sort_compare_paths);

    /* Create new commit items and add them to the array. */
    if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))

> By the way, why isn't the '-p' short option available for this command?

Because we are very protective of our short option namespace.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by Troy Curtis Jr <tr...@gmail.com>.
On Tue, Mar 18, 2008 at 12:38 PM, Karl Heinz Marbaise <kh...@gmx.de> wrote:
> Hi there,
>
>  i have observed a little bit odd behavior (in my opinion) of the mkdir
>  comment in relationship with the --parents option...
>
>  I have created a clean new repository and after that i have given the
>  following on the command line:
>
>  svn mkdir --parents \
>     $URL/project1/trunk \
>     $URL/project1/tags \
>     $URL/project1/branches \
>     $URL/project2/trunk \
>     $URL/project2/tags \
>     $URL/project2/branches -m"- First structure"
>
>  and got an error message:
>  svn: File already exists: filesystem '...', transaction '0-0', path
>  '/project1'
>
>  Is this intended behavior ? Or is my understanding not correct...
>  I had expected that those two intermediate directories (project1 and
>  project2) would have been created and the structure in the repository as
>  well....
>
>  Can someone enlighten me...
>  Thanks in advance...
>
>  Kind regards
>  Karl Heinz Marbaise
>  --
>  SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
>  Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
>  Hauptstrasse 177                         USt.IdNr: DE191347579
>  52146 Würselen                           http://www.soebes.de
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>  For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

I am not really a developer here, but this is an interesting issue.  I
think you'll get an idea of what is going on if you allow it to open
an editor instead of providing a log message on the command-line.  You
get the following:

A    $URL/project1
A    $URL/project1/trunk
A    $URL/project1
A    $URL/project1/tags
A    $URL/project1
A    $URL/project1/branches
A    $URL/project2
A    $URL/project2/trunk
A    $URL/project2
A    $URL/project2/tags
A    $URL/project2
A    $URL/project2/branches

So it seems that it is expanding the intermediate targets for each argument
independently, not looking at any other targets being made.  I would certainly
say that this is unexpected behavior.

Personally I think it would be worth a bug report, as it really does
not match what
you would get from the Linux command-line 'mkdir -p' command.

By the way, why isn't the '-p' short option available for this command?

Troy
-- 
Beware of spyware. If you can, use the Firefox browser. - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: SVN 1.5 - Beta 1 - mkdir behavior

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

i have found two entries in the issue database which have a relationship
to the above problem.

issue #2500
is in my opinion fixed and prints out a correct message:

svn: Path 'xxxx' not present.

So my suggestion would be to close the above issue (2500) and may be
make an entry in the ChangeLog...

But about the issue #2295 which is given as in relationship with #2500,
i'm not sure about it?

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org