You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jay Crouch <ja...@safestream.com> on 2007/08/16 22:13:49 UTC

Anyone know how to put a file directly into a repository over command line - simulate checkin

I¹m writing a web based file system using subversion as the backend. Have
been using svn import command line statements to load files into the
repositories, but import requires any import targets to be deleted first ­
which breaks revisioning and deltas (i.e. the whole point of svn).

Anyone know of another method/script/tool to put a file directly into an svn
repository (without deleting first) :: note I do mean repository, not
working copy.

As in I¹ve been using:

Svn import file.txt file:///mnt/data/repos/repoid/folder/file.txt

Thanks

Re: Anyone know how to put a file directly into a repository over command line - simulate checkin

Posted by Rainer Sokoll <R....@intershop.de>.
On Fri, Aug 17, 2007 at 01:56:55AM -0500, Ryan Schmidt wrote:

>  If you're looking for a way to put files into the repository directly, 
>  possibly overwriting any previous version that was there, you may be 
>  interested in the "svnput" example:

Shouldn't that be possible by autoversioning, too?

Rainer

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

Re: Anyone know how to put a file directly into a repository over command line - simulate checkin

Posted by Jay Crouch <ja...@safestream.com>.
Perfect!

But like Ryan, I'm not versed enough with subversion or C to update this
example completely. Is there anyone available that could help me tweak it?

We'll be using this to 'put' files directly into the repositories as a
backend implementation --> meaning no prompting can be used. To this end we
need to modify the script so it supports the following cmd line args -> we
intent to make it very similar to svn import:

--

put: Commit a unversioned file(s) into the repository (overwriting any
versioned file at destination).
usage: svnput [PATH] URL

  Recursively commit a copy of PATH to URL.
  If PATH is omitted '.' is assumed.
  Parent directories are created as necessary in the repository.
  If PATH is a directory, the contents of the directory are added
  directly under URL.

Valid options:
  -N [--non-recursive]          : operate on singe directory only
  -m [--message] arg            : specify commit message ARG
  --username arg                : specify a username ARG
  --password arg                : specify a password ARG
  --non-interactive             : do no interactive prompting

--

I'm pretty sure I can figure out how to do the command line options, but the
recursion (even the iteration of multiple files in a single directory) will
be over my head.

Can anyone help?



On 8/17/07 7:11 AM, "John Peacock" <jp...@rowman.com> wrote:

> Ryan Schmidt wrote:
>> I haven't used it, and I'm not sufficiently versed in the Subversion
>> APIs to tell from the source code whether this is doing a
>> delete-then-add or whether it's updating the existing file. You could
>> try it out and see what the log looks like afterward.
> 
> It doesn't do a delete-then-add, but it also doesn't even check the contents
> of
> the existing rev in the repository.  Technically, it will store the new
> revision
> as a delta against the previous one, but there is no requirement that the
> files
> be in any way similar.  That's what makes it so dangers; it just stomps on
> whatever is in the repository at that path (so you could easily overwrite the
> wrong file).
> 
> HTH
> 
> John


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

Re: Anyone know how to put a file directly into a repository over command line - simulate checkin

Posted by John Peacock <jp...@rowman.com>.
Ryan Schmidt wrote:
> I haven't used it, and I'm not sufficiently versed in the Subversion
> APIs to tell from the source code whether this is doing a
> delete-then-add or whether it's updating the existing file. You could
> try it out and see what the log looks like afterward.

It doesn't do a delete-then-add, but it also doesn't even check the contents of
the existing rev in the repository.  Technically, it will store the new revision
as a delta against the previous one, but there is no requirement that the files
be in any way similar.  That's what makes it so dangers; it just stomps on
whatever is in the repository at that path (so you could easily overwrite the
wrong file).

HTH

John

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

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

Re: Anyone know how to put a file directly into a repository over command line - simulate checkin

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 17, 2007, at 02:13, Jay Crouch wrote:

> On 8/17/07 2:56 AM, "Ryan Schmidt" wrote:
>
>> On Aug 16, 2007, at 17:13, Jay Crouch wrote:
>>
>>> I’m writing a web based file system using subversion as the
>>> backend. Have been using svn import command line statements to load
>>> files into the repositories, but import requires any import targets
>>> to be deleted first – which breaks revisioning and deltas (i.e. the
>>> whole point of svn).
>>>
>>> Anyone know of another method/script/tool to put a file directly
>>> into an svn repository (without deleting first) :: note I do mean
>>> repository, not working copy.
>>>
>>> As in I’ve been using:
>>>
>>> Svn import file.txt file:///mnt/data/repos/repoid/folder/file.txt
>>
>> As you probably know, the supported method is: get a working copy,
>> modify it, and commit.
>>
>> If you're looking for a way to put files into the repository
>> directly, possibly overwriting any previous version that was there,
>> you may be interested in the "svnput" example:
>>
>> http://svn.collab.net/repos/svn/trunk/tools/examples/svnput.c
>>
>> Be sure to read the warning in the comments at the beginning of the
>> file.
>
> Question: does this example actually simulate a checkout-checkin in  
> that the
> file 'put' is kept in the revision history - and only a delta of  
> the changes
> is stored --- or is actually just a simulation of delete-import in  
> that the
> new file is not tied to the previous one in the revision history  
> and stored
> in its entirety?

I haven't used it, and I'm not sufficiently versed in the Subversion  
APIs to tell from the source code whether this is doing a delete-then- 
add or whether it's updating the existing file. You could try it out  
and see what the log looks like afterward.

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


Re: Anyone know how to put a file directly into a repository over command line - simulate checkin

Posted by Jay Crouch <ja...@safestream.com>.
Thanks for the link, I think it may be close to what I'm looking for...

Question: does this example actually simulate a checkout-checkin in that the
file 'put' is kept in the revision history - and only a delta of the changes
is stored --- or is actually just a simulation of delete-import in that the
new file is not tied to the previous one in the revision history and stored
in its entirety?


On 8/17/07 2:56 AM, "Ryan Schmidt" <su...@ryandesign.com> wrote:

> 
> On Aug 16, 2007, at 17:13, Jay Crouch wrote:
> 
>> I¹m writing a web based file system using subversion as the
>> backend. Have been using svn import command line statements to load
>> files into the repositories, but import requires any import targets
>> to be deleted first ­ which breaks revisioning and deltas (i.e. the
>> whole point of svn).
>> 
>> Anyone know of another method/script/tool to put a file directly
>> into an svn repository (without deleting first) :: note I do mean
>> repository, not working copy.
>> 
>> As in I¹ve been using:
>> 
>> Svn import file.txt file:///mnt/data/repos/repoid/folder/file.txt
> 
> As you probably know, the supported method is: get a working copy,
> modify it, and commit.
> 
> If you're looking for a way to put files into the repository
> directly, possibly overwriting any previous version that was there,
> you may be interested in the "svnput" example:
> 
> http://svn.collab.net/repos/svn/trunk/tools/examples/svnput.c
> 
> Be sure to read the warning in the comments at the beginning of the
> file.
> 
> 
> 


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


Re: Anyone know how to put a file directly into a repository over command line - simulate checkin

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 16, 2007, at 17:13, Jay Crouch wrote:

> I’m writing a web based file system using subversion as the  
> backend. Have been using svn import command line statements to load  
> files into the repositories, but import requires any import targets  
> to be deleted first – which breaks revisioning and deltas (i.e. the  
> whole point of svn).
>
> Anyone know of another method/script/tool to put a file directly  
> into an svn repository (without deleting first) :: note I do mean  
> repository, not working copy.
>
> As in I’ve been using:
>
> Svn import file.txt file:///mnt/data/repos/repoid/folder/file.txt

As you probably know, the supported method is: get a working copy,  
modify it, and commit.

If you're looking for a way to put files into the repository  
directly, possibly overwriting any previous version that was there,  
you may be interested in the "svnput" example:

http://svn.collab.net/repos/svn/trunk/tools/examples/svnput.c

Be sure to read the warning in the comments at the beginning of the  
file.



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