You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by kf...@collab.net on 2004/05/07 15:05:38 UTC

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

Jon Scott Stevens <jo...@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

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

Posted by kf...@collab.net.
Jon Scott Stevens <jo...@latchkey.com> writes:
> It would probably make me 'happier' to always see a unique tmp file
> created. I dunno...just a personal preference. Might avoid reports
> like this in the future.

Oh, it is unique, it just doesn't *look* unique because it doesn't
have a scrambly-looking name (until you start getting more than one,
anyway).

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Jon Scott Stevens <jo...@latchkey.com>.
hypothesize.

I guess that I'm just used to seeing CVS always create a unique tmp 
file.

My external editor is BBEdit (on OSX), so it shows the filename/path...

It would probably make me 'happier' to always see a unique tmp file 
created. I dunno...just a personal preference. Might avoid reports like 
this in the future.

jon

On May 7, 2004, at 8:05 AM, kfogel@collab.net wrote:

> 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

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

Posted by John Peacock <jp...@rowman.com>.
kfogel@collab.net wrote:

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

My observation has been that if there is already a file named "svn-commit.tmp" 
in the directory, the code Karl highlighted will indeed kick in and subsequent 
files will be named something like "svn-commit.61640.00001.tmp" as designed.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org