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

Re: 301 error on merge

From: John Szakmeister <john_at_szakmeister.net>
Date: 2003-12-20 13:28:00 CET

On Sunday 14 December 2003 20:27, Ross Mark wrote:
> John Szakmeister wrote:
> >Can you post a script that causes this error? I tried following what was
> >listed in the mail yesterday and couldn't get it to fail. It would be
> > useful in tracking this problem down and getting rid of it. :-)
> >
> >-John
>
> I've attached a log for a complete session which shows the problem.

Sorry it's taken me so long to get back to you... I've had a couple of other
fish to fry, and my company just got bought out, which has left me little
time in the past couple of weeks.

Thanks for posting a script to repeat the problem. What's happening is that
in the case that the target is '.', it is converted to "" (an empty string).
Well, it turns out that in some other logic in svn_cl__merge() that "" is
being used as a flag to indicate 'find the wc path for me'. What ends up
happening is the following code snippet pulls the last part of the URL,
'prodA' and looks for that in the current directory. It, of course, finds a
file called 'prodA' and then passes that into svn_client_merge() as the
target.

  if (! strcmp (targetpath, ""))
    {
      char *sp1_basename, *sp2_basename;
      sp1_basename = svn_path_basename (sourcepath1, pool);
      sp2_basename = svn_path_basename (sourcepath2, pool);

      if (! strcmp (sp1_basename, sp2_basename))
        {
          svn_node_kind_t kind;
          SVN_ERR (svn_io_check_path (sp1_basename, &kind, pool));
          if (kind == svn_node_file)
            {
              targetpath = sp1_basename;
            }
        }
    }

It appears we need to do some better checking here, but I'm not sure how to
proceed with this since it has some impact on how the command line client can
be used. Therefore, I've moved this to the dev@ list to get some more input
from other developers. I currently have a small patch that adds an explicit
target flag to make sure this doesn't happen even if target_path is "". The
problem is that 'svn merge -r X:Y url::/to/a/file ." will no longer work.
How does the rest of the community feel about that? Any other suggestions on
how to fix this problem?

-John

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Dec 20 13:20:46 2003

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.