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

Re: 'svn mergeinfo URL'

From: David Glasser <glasser_at_davidglasser.net>
Date: 2007-09-28 01:45:27 CEST

On 9/27/07, masaru tsuchiyama <m.tmatma@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_at_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
Received on Fri Sep 28 01:45:36 2007

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

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