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

Re: http://subversion.tigris.org/issues/show_bug.cgi?id=767

From: <kfogel_at_collab.net>
Date: 2004-05-07 17:05:38 CEST

Jon Scott Stevens <jon@latchkey.com> writes:
> I would post this to the issue tracker, but I'm waiting for the
> observer role.
>
> I noticed that the current behavior (with 1.0.2) is to create a file
> called 'svn-commit.tmp' in the directory where the commit is happening.
>
> The problem with this is that if I open another terminal and want to
> do another commit in the same directory while a commit is previously
> in progress, then I'm going to get a filename clash since the name
> isn't unique.
>
> Obviously not a huge problem for most people, but it is something to
> note that CVS does this process properly I suspect by using something
> like tempnam().
>
> I suspect that the hard coded string "svn-commit" used in
>
> clients/cmdline/util.c:493
>
> ...is the problem...

Hi, Jon! Saw your comment appended to issue #767. Before I make more
comments there, let me ask some questions here. Looking at the code
in svn_cl__get_log_message(), we have:

   /* Use the external edit to get a log message. */
   err = svn_cl__edit_externally (&msg2, &lmb->tmpfile_left,
                                  lmb->editor_cmd, lmb->base_dir,
                                  tmp_message->data, "svn-commit",
                                  lmb->config, pool);

But here's what svn_cl__edit_externally() does with that hardcoded
string (it's the parameter 'prefix' below):

   /* Ask the working copy for a temporary file that starts with
      PREFIX. */
   err = svn_io_open_unique_file (&tmp_file, &tmpfile_name,
                                  prefix, ".tmp", FALSE, pool);

So, we *should* be avoiding clashes already... Unless there's a bug,
of course.

Did you actually observe a clash, or just hypothesize one based on
seeing a file named "svn-commit.tmp"?

> p.s. wow. it's been a long ass time since I have seen someone use
> "goto" in code.

We were originally going to write Subversion in Basic.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat May 8 01:00:29 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.