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

Re: Modifying a file in the repository without prior checkout

From: Markus Kuhn <Markus.Kuhn_at_cl.cam.ac.uk>
Date: 2007-06-27 19:23:48 CEST

Ryan Schmidt wrote on 2007-06-27 16:59 UTC:
> On Jun 27, 2007, at 06:10, Markus Kuhn wrote:
> > I want to write a CGI script that allows users to edit text files in a
> > Subversion repository. [snip]
>
> Then I expect you will want to read about svnput:
>
> http://svn.collab.net/repos/svn/trunk/tools/examples/svnput.c
>
> You should be able to write your editor so that it can "svn export"
> just the one file you care about, then "svnput" the modified file
> back into the repo.

Thanks for the pointer, I hadn't seen that yet!

> I trust you're aware of the arguments against svnput-like functionality.

The only problem that I see is the one related to the warning

      printf ("\n*** WARNING ***\n\n");
      printf ("You're about to overwrite r%ld of this file.\n", rev);
      printf ("It was last changed by user '%s',\n",
              dirent->last_author ? dirent->last_author : "?");
      printf ("on %s.\n", svn_time_to_human_cstring (dirent->time, pool));
      printf ("\nSomebody *might* have just changed the file seconds ago,\n"
              "and your upload would be overwriting their changes!\n\n");

That looks like svnput lacks the ability for me to specify that the
overwrite should only happen under the condition that the overwritten
file has the revision number that I specified. I think that if overwrite
something, it is important that I know exactly which version that was.

The checking of the overwritten version and the overwriting itself must
be one atomic operation. If they are not, I would have to implement lots
of mechanics to examine the log after svnput in order to find out after
the fact that there had been a collision, and put it right then, which
does not sound like much fun.

Markus

-- 
Markus Kuhn, Computer Laboratory, University of Cambridge
http://www.cl.cam.ac.uk/~mgk25/ || CB3 0FD, Great Britain
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 27 19:24:12 2007

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.