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

Re: [PATCH] issue 1780: Keyword values with dollar signs causebadness.

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-02-12 21:13:49 CET

Lieven Govaerts wrote:
>
> I updated my patch of last week to fix issue 1780.

Thanks.

> The algorithm implemented here isn't changed, so this patch will not solve
> the problem of usernames starting or ending with '$'. It only solves user-
> or filenames containing a '$'.

More precisely, it solves the problem of user names or URLs containing dollar
signs, unless a dollar sign is the first character or follows a space.

I think this level of functionality is worth having, and I would commit it
except that I have two concerns with the implementation.

1) It fails (with an assert) when searching for a keyword in a line which is
longer than SVN_KEYWORD_MAX_LEN. Although we don't support arbitrarily long
keywords, we must continue to support arbitrarily long lines. To reproduce,
just let it try keyword translation on a line consisting of "$" plus (MAX - 2)
spaces plus "$$".

2) It takes order(N-squared) time to process a line containing N dollar signs.
  On my system I found many text files with more than 25 dollar signs in the
same line, including:

* Text representations of binary data, e.g. /etc/X11/xdm/pixmaps/xorg.xpm
* Shell scripts, makefiles, etc., e.g. subversion/build/libtool.m4
* Config files referencing env-vars, e.g. .kde/share/config/kdeglobals
* Our test for cases like this: subversion/tests/libsvn_wc/translate-test.c

I wouldn't think it strange for someone to use a line of about eighty dollar
signs to separate sections in a text file. Processing ten lines, each
consisting of 250 dollar signs, took over a second on my rather slow system.
Certainly that's not a huge amount of time for a rare case, but we ought to
cope well with unusual cases if we can.

I note that "svn status" processes the locally-modified file every time I run
"svn status"; that's a separate problem that we might want to look at.

The bug (1) should be straightforward to fix. I'm not sure what to say about
the efficiency issue (2). I'd very much like to see it improved, but I might
not insist on it.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 12 21:31:07 2006

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.