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

r1039140 (or, spineless code is for the birds).

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Mon, 29 Nov 2010 11:56:31 -0500

> r1039140 | julianfoad | 2010-11-25 13:51:34 -0500 (Thu, 25 Nov 2010) | 4 lines
> Changed paths:
> M /subversion/trunk/subversion/svn/update-cmd.c
>
> Fix assertion failures.
>
> * subversion/svn/update-cmd.c
> (print_update_summary): Don't allow a URL to reach svn_dirent_*().

Why?

First, you've prevented the call to svn_dirent_get_absolute, yes. But
immediately below that are two more calls to svn_dirent_* APIs which are not
similarly avoided. I'll copy the code context here for your convenience:

      /* Convert to an absolute path if it's not already. */
      /* (It shouldn't be URL, but don't call svn_dirent_* if it is.) */
      if (! svn_path_is_url(path) && ! svn_dirent_is_absolute(path))
        SVN_ERR(svn_dirent_get_absolute(&path, path, iter_pool));

      /* Remove the current working directory prefix from PATH (if
         PATH is at or under $CWD), and convert to local style for
         display. */
      path_local = svn_dirent_skip_ancestor(path_prefix, path);
      path_local = svn_dirent_local_style(path_local, iter_pool);

But that's not my biggest concern. If, as you say, the path "shouldn't be
URL", then why is it a problem that an assertion verifies as much? I'm
really down on spineless code of this sort.

Please revert this change or provide a reasonable explanation for it.

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

Received on 2010-11-29 17:57:04 CET

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.