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

svn diff segfault (issue 1093 again?)

From: Robert Pluim <rpluim_at_bigfoot.com>
Date: 2003-04-07 19:16:03 CEST

Move a file:

  rpluim: ~/wc-test/local-wc1/foo
  $ svn mv 1000 1001-moved
  A 1001-moved
  D 1000

Add some stuff to it, run diff (BTW, since this now gives me only
local changes, perhaps issue 1061 is no longer relevant) :

  $ svn diff 1001-moved
  Index: 1001-moved
  ===================================================================
  --- 1001-moved (revision 28)
  +++ 1001-moved (working copy)
  @@ -43,3 +43,4 @@
   # compression = yes
   ### See http://subversion.tigris.org/issues/show_bug.cgi?id=668
   ### for what else will soon be customized in this file.
  +more stuff

Everything seems ok, except:

  rpluim: ~/wc-test/local-wc1/foo
  $ svn diff -r 27 1001-moved
  Segmentation fault (core dumped)
  rpluim: ~/wc-test/local-wc1/foo

This is coming from subversion/libsvn_client/diff.c:1227, where we do:

      SVN_ERR (convert_to_url (&URL1, path1, pool));
      
      /* Trickiness: possibly split up path2 into anchor/target. If
         we do so, then we must split URL1 as well. We shouldn't go
         assuming that URL1 is equal to path2's URL, as we used to. */
      SVN_ERR (svn_wc_get_actual_target (path2, &anchor, &target, pool));
      if (target)
        {
          svn_path_split (URL1, &url_anchor, &url_target, pool);

And surprise, surprise, URL1 is NULL, since path1 was a moved file.

I'm not sure of the best way to handle this. convert_to_url can't
give me the actual previous URL, because that's rev-dependent. Giving
back the URL as it was just prior to the move would work in 90% of the
cases, but would fail dismally if the file has been moved more than
once. Issue 1093 seems to classify this as an 'annoyance', so maybe I
should close my eyes and ignore it :)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 7 19:16:10 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.