You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by masaru tsuchiyama <m....@gmail.com> on 2007/09/27 23:38:31 UTC

'svn mergeinfo URL'

Hello

I found a bug on 'svn mergeinfo'

I run 'svn mergeinfo' on Windows. But the slashes in the URL
is backslashes.

D:\...\trunk>svn mergeinfo  http://svn.collab.net/repos/svn/trunk
Path: http:\\svn.collab.net\repos\svn\trunk

D:\...\trunk>svn mergeinfo .
Path: .
  Source path: /trunk
    Merged ranges: r0:26218, r26233:26405, r26463:26468
    Eligible ranges: r26218:26233, r26405:26463, r26468:26819

Can 'svn mergeinfo' take URL as the parameter by the design?

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

Re: 'svn mergeinfo URL'

Posted by "C. Michael Pilato" <cm...@collab.net>.
Patch is fine.  Though, it makes me wonder if svn_path_local_style()
shouldn't be smart enough to know that URL is a URL is a URL regardless of
"style".

David Glasser wrote:
> On 9/27/07, masaru tsuchiyama <m....@gmail.com> wrote:
>> Hello
>>
>> I found a bug on 'svn mergeinfo'
>>
>> I run 'svn mergeinfo' on Windows. But the slashes in the URL
>> is backslashes.
>>
>> D:\...\trunk>svn mergeinfo  http://svn.collab.net/repos/svn/trunk
>> Path: http:\\svn.collab.net\repos\svn\trunk
>>
>> D:\...\trunk>svn mergeinfo .
>> Path: .
>>   Source path: /trunk
>>     Merged ranges: r0:26218, r26233:26405, r26463:26468
>>     Eligible ranges: r26218:26233, r26405:26463, r26468:26819
>>
>> Can 'svn mergeinfo' take URL as the parameter by the design?
> 
> How does something like this look?
> 
> Index: subversion/svn/mergeinfo-cmd.c
> ===================================================================
> --- subversion/svn/mergeinfo-cmd.c	(revision 26819)
> +++ subversion/svn/mergeinfo-cmd.c	(working copy)
> @@ -80,6 +80,7 @@ svn_cl__mergeinfo(apr_getopt_t *os,
>    for (i = 0; i < targets->nelts; i++)
>      {
>        const char *target = APR_ARRAY_IDX(targets, i, const char *);
> +      svn_boolean_t is_url = svn_path_is_url(target);
>        const char *truepath;
>        svn_opt_revision_t peg_revision;
>        apr_hash_t *mergeinfo;
> @@ -95,20 +96,23 @@ svn_cl__mergeinfo(apr_getopt_t *os,
> 
>        /* If no peg-rev was attached to a URL target, then assume HEAD. */
>        if ((peg_revision.kind == svn_opt_revision_unspecified)
> -          && svn_path_is_url(target))
> +          && is_url)
>          peg_revision.kind = svn_opt_revision_head;
> 
>        /* If no peg-rev was attached to a non-URL target, then assume BASE. */
>        if ((peg_revision.kind == svn_opt_revision_unspecified)
> -          && (! svn_path_is_url(target)))
> +          && (! is_url))
>          peg_revision.kind = svn_opt_revision_base;
> 
>        /* Get the already-merged information. */
>        SVN_ERR(svn_client_mergeinfo_get_merged(&mergeinfo, truepath,
>                                                &peg_revision, ctx, subpool));
> 
> -      svn_cmdline_printf(pool, _("Path: %s\n"),
> -                         svn_path_local_style(truepath, pool));
> +      if (is_url)
> +        svn_cmdline_printf(pool, _("URL: %s\n"), truepath);
> +      else
> +        svn_cmdline_printf(pool, _("Path: %s\n"),
> +                           svn_path_local_style(truepath, pool));
>        if (! mergeinfo)
>          {
>            svn_cmdline_printf(pool, "\n");
> 
> 


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


Re: 'svn mergeinfo URL'

Posted by David Glasser <gl...@davidglasser.net>.
On 9/27/07, masaru tsuchiyama <m....@gmail.com> wrote:
> Hello
>
> I found a bug on 'svn mergeinfo'
>
> I run 'svn mergeinfo' on Windows. But the slashes in the URL
> is backslashes.
>
> D:\...\trunk>svn mergeinfo  http://svn.collab.net/repos/svn/trunk
> Path: http:\\svn.collab.net\repos\svn\trunk
>
> D:\...\trunk>svn mergeinfo .
> Path: .
>   Source path: /trunk
>     Merged ranges: r0:26218, r26233:26405, r26463:26468
>     Eligible ranges: r26218:26233, r26405:26463, r26468:26819
>
> Can 'svn mergeinfo' take URL as the parameter by the design?

How does something like this look?

Index: subversion/svn/mergeinfo-cmd.c
===================================================================
--- subversion/svn/mergeinfo-cmd.c	(revision 26819)
+++ subversion/svn/mergeinfo-cmd.c	(working copy)
@@ -80,6 +80,7 @@ svn_cl__mergeinfo(apr_getopt_t *os,
   for (i = 0; i < targets->nelts; i++)
     {
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
+      svn_boolean_t is_url = svn_path_is_url(target);
       const char *truepath;
       svn_opt_revision_t peg_revision;
       apr_hash_t *mergeinfo;
@@ -95,20 +96,23 @@ svn_cl__mergeinfo(apr_getopt_t *os,

       /* If no peg-rev was attached to a URL target, then assume HEAD. */
       if ((peg_revision.kind == svn_opt_revision_unspecified)
-          && svn_path_is_url(target))
+          && is_url)
         peg_revision.kind = svn_opt_revision_head;

       /* If no peg-rev was attached to a non-URL target, then assume BASE. */
       if ((peg_revision.kind == svn_opt_revision_unspecified)
-          && (! svn_path_is_url(target)))
+          && (! is_url))
         peg_revision.kind = svn_opt_revision_base;

       /* Get the already-merged information. */
       SVN_ERR(svn_client_mergeinfo_get_merged(&mergeinfo, truepath,
                                               &peg_revision, ctx, subpool));

-      svn_cmdline_printf(pool, _("Path: %s\n"),
-                         svn_path_local_style(truepath, pool));
+      if (is_url)
+        svn_cmdline_printf(pool, _("URL: %s\n"), truepath);
+      else
+        svn_cmdline_printf(pool, _("Path: %s\n"),
+                           svn_path_local_style(truepath, pool));
       if (! mergeinfo)
         {
           svn_cmdline_printf(pool, "\n");


-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

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