You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@xbc.nu> on 2004/11/12 05:48:16 UTC
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
kfogel@tigris.org wrote:
>+static const char *
>+path_for_err_msg (const char *path, apr_pool_t *pool)
>+{
>+ const char *abs_path;
>+ svn_error_t *err = svn_path_get_absolute (&abs_path, path, pool);
>+ if (err)
>+ {
>+ /* We can't return an error, because this is for use within errors. */
>+ svn_error_clear (err);
>+ /* Do the best we can. */
>+ abs_path = (*path == '\0') ? "." : path;
>
>
This conversion is unnecessary...
>+ }
>+ return apr_psprintf (pool, "%s", svn_path_local_style (abs_path, pool));
>
>
...because you call svn_path_local_style, which, incidentally, already
converts "" to ".".
BTW, when did we decide to always return absolute paths in error messages?
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
Posted by Branko Čibej <br...@xbc.nu>.
kfogel@collab.net wrote:
>Branko Čibej <br...@xbc.nu> writes:
>
>>TW, when did we decide to always return absolute paths in error messages?
>>
>>
>
>Frankly, I'm not sure, although I can think of arguments for and
>against. I think I lean slightly toward "for". But mainly I was
>assuming (perhaps wrongly) that issue #1538 indicated some sort of
>pre-existing consensus about this.
>
>Are you just asking out of curiosity, or would you like to do
>something different?
>
>
I'm not sure. I think that, for the command-line client, relative paths
are better; but tools like TortoiseSVN would probably work better with
absolute paths. Unfortunately we don't have a choice, not having
structured error messages.
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
Posted by kf...@collab.net.
Julian Foad <ju...@btopenworld.com> writes:
> kfogel@collab.net wrote:
> > Julian Foad <ju...@btopenworld.com> writes:
> >>I'll fix up that function soon (and not have it convert paths to
> >>absolute) if Karl doesn't get to it before me.
> > Go for it -- I'm bogged down (rewardingly, but still bogged) in
> > #2122.
>
> Done in r11873. I left "path_for_err_msg" as a static function, even
> though it is now just forwarding to "svn_path_local_style".
Thanks, Julian!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
Posted by Julian Foad <ju...@btopenworld.com>.
kfogel@collab.net wrote:
> Julian Foad <ju...@btopenworld.com> writes:
>>I'll fix up that function soon (and not have it convert paths to
>>absolute) if Karl doesn't get to it before me.
>
> Go for it -- I'm bogged down (rewardingly, but still bogged) in #2122.
Done in r11873. I left "path_for_err_msg" as a static function, even though it
is now just forwarding to "svn_path_local_style".
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
Posted by kf...@collab.net.
Julian Foad <ju...@btopenworld.com> writes:
> I'll fix up that function soon (and not have it convert paths to
> absolute) if Karl doesn't get to it before me.
Go for it -- I'm bogged down (rewardingly, but still bogged) in #2122.
> I should go through any other outstanding patches that I might have
> filed, and see if they are still OK. Not promising I will, though.
> Just take old patches with caution.
I'll keep it in mind.
Thanks!
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
Posted by Julian Foad <ju...@btopenworld.com>.
Greg Hudson wrote:
> On Fri, 2004-11-12 at 09:24, kfogel@collab.net wrote:
>
>>>BTW, when did we decide to always return absolute paths in error messages?
>>
>>Frankly, I'm not sure, although I can think of arguments for and
>>against. I think I lean slightly toward "for". But mainly I was
>>assuming (perhaps wrongly) that issue #1538 indicated some sort of
>>pre-existing consensus about this.
>
> Well, I'm pretty strongly against. It looks clunky to type "svn update
> foo" and see an absolute path to 'foo' in the error message.
Oh dear. I've just seen in the log that this was a preliminary patch of mine
from over a year ago. I remember now that the objection to reporting an
absolute path was raised. Philip Martin replied with some good reasons against
doing so. Also the "###" comments don't belong in it (suggestions about future
evolution of the software generally belong on the mailing list or issue tracker
or whatever rather than in the code). Also the final "apr_psprintf" is
redundant (it was there because I had been going to use it to add single quote
marks around the file name, and remove them from all the individual messages,
but then I decided not to).
I'll fix up that function soon (and not have it convert paths to absolute) if
Karl doesn't get to it before me.
I should go through any other outstanding patches that I might have filed, and
see if they are still OK. Not promising I will, though. Just take old patches
with caution.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
Posted by Greg Hudson <gh...@MIT.EDU>.
On Fri, 2004-11-12 at 09:24, kfogel@collab.net wrote:
> > BTW, when did we decide to always return absolute paths in error messages?
>
> Frankly, I'm not sure, although I can think of arguments for and
> against. I think I lean slightly toward "for". But mainly I was
> assuming (perhaps wrongly) that issue #1538 indicated some sort of
> pre-existing consensus about this.
Well, I'm pretty strongly against. It looks clunky to type "svn update
foo" and see an absolute path to 'foo' in the error message.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r11838 - trunk/subversion/libsvn_subr
Posted by kf...@collab.net.
Branko Čibej <br...@xbc.nu> writes:
> >+ svn_error_clear (err);
> >+ /* Do the best we can. */
> >+ abs_path = (*path == '\0') ? "." : path;
> >
> This conversion is unnecessary...
>
> >+ }
> >+ return apr_psprintf (pool, "%s", svn_path_local_style (abs_path, pool));
> >
> ...because you call svn_path_local_style, which, incidentally, already
> converts "" to ".".
Thanks! I'll tweak.
> BTW, when did we decide to always return absolute paths in error messages?
Frankly, I'm not sure, although I can think of arguments for and
against. I think I lean slightly toward "for". But mainly I was
assuming (perhaps wrongly) that issue #1538 indicated some sort of
pre-existing consensus about this.
Are you just asking out of curiosity, or would you like to do
something different?
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org