You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Peter Flynn <pe...@silmaril.ie> on 2012/03/05 20:29:33 UTC

Getting initial sync from multiple users to single repository

I can't seem to find this particular problem in the archives, but that 
may be my ignorance of the terminology.

I want to start using svn for a project which currently has four user 
machines, each with their own copy of the codebase, kept in sync by 
manual scp to and from one of the machines which has been acting as master.

I have created an svn repository on another host, and added all the 
files from one user machine to it (some weeks ago), so everything was 
present but unversioned. Since then, a few of those files have been 
manually edited on that user machine, without checking them out, so the 
first question is, how do I push those few files to the server so that 
the repository contains the updated copies? If I use add or checkin, it 
fails on the first changed file, saying it already exists:

> Adding         0007.pdf
> svn: Commit failed (details follow):
> svn: File '/svn/interfaces/0007.pdf' already exists

which is perfectly understandably as it was never checked out but edited 
locally. Is there a command that will force the server to accept a file 
that has been modified locally, or should I just wipe the whole repo and 
start afresh?

Assuming I can solve that one, I then need to add the other user 
machines' files. All the major components of the project will already be 
identical, so they can be checked out from the repository, but many 
smaller files, mostly reference and historical material, will be 
different on each user machine, but the most recent one is what I need 
(all the machines run ntp, so I am assuming I can trust the timestamps). 
None of these are critical, but it would be nice to have them added and 
checked in only if their timestamp is more recent than any copy already 
in the repository. Can this be done using svn, or do I need to do it 
manually (well, maybe with rsync) and then checkin the result?

///Peter


Re: Getting initial sync from multiple users to single repository

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Peter Flynn,
am Montag, 5. März 2012 um 20:29 schrieben Sie:

> Is there a command that will force the server to accept a file
> that has been modified locally, or should I just wipe the whole repo and
> start afresh?

As already said, checkout your current repo to a new directory, copy
the files you want to update over the working copy and commit the
changes.

> Assuming I can solve that one, I then need to add the other user 
> machines' files. All the major components of the project will already be
> identical, so they can be checked out from the repository, but many 
> smaller files, mostly reference and historical material, will be 
> different on each user machine, but the most recent one is what I need
> (all the machines run ntp, so I am assuming I can trust the timestamps).
> None of these are critical, but it would be nice to have them added and
> checked in only if their timestamp is more recent than any copy already
> in the repository. Can this be done using svn, or do I need to do it 
> manually (well, maybe with rsync) and then checkin the result?

Do as the first time, checkout the repo, with the already updated
contents now, and copy the local files over the working copy. The
easiest is to copy all files regardless of timestamps or else and let
svn using svn status or svn commit see itself what was changed and
commit the changes again as needed.

Consider that on this simple setup with all working copies presenting
the same directory structure and files, you can't have different file
contents of special files on each of your machines/users because each
user's commit would change the contents of the committed file for all
other users resulting in changes or even conflicts for the other
users, depending on the nature of the changes made. You may need to
separate user specific files in different directories, but this would
heavily depend on the nature of the file changes you are talking
about.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon.............030-2 1001-310
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hanover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Getting initial sync from multiple users to single repository

Posted by Peter Flynn <pe...@silmaril.ie>.
On 05/03/12 19:29, Peter Flynn wrote:
> I want to start using svn for a project[...]

Thank you all very much for the advice. That should do the job.

///Peter

Re: Getting initial sync from multiple users to single repository

Posted by Daniel Shahaf <da...@elego.de>.
May be useful here: 'svn checkout --force' will take an existing tree
and make it into a working copy.  (Preexisting files will show as
local mods when the command finishes.)

Les Mikesell wrote on Mon, Mar 05, 2012 at 14:06:55 -0600:
> On Mon, Mar 5, 2012 at 1:29 PM, Peter Flynn <pe...@silmaril.ie> wrote:
> >
> > I have created an svn repository on another host, and added all the files
> > from one user machine to it (some weeks ago), so everything was present but
> > unversioned. Since then, a few of those files have been manually edited on
> > that user machine, without checking them out, so the first question is, how
> > do I push those few files to the server so that the repository contains the
> > updated copies? If I use add or checkin, it fails on the first changed file,
> > saying it already exists:
> 
> Check out a working copy, replace the files in it with the
> corresponding modified files and commit them.  Better yet, make each
> of the users making the changes do this step themselves and add
> meaningful log messages, and then they can keep on working in their
> working copies and remove the original unversioned directory.
> 
> -- 
>   Les Mikesell
>      lesmikesell@gmail.com

Re: Getting initial sync from multiple users to single repository

Posted by Les Mikesell <le...@gmail.com>.
On Mon, Mar 5, 2012 at 1:29 PM, Peter Flynn <pe...@silmaril.ie> wrote:
>
> I have created an svn repository on another host, and added all the files
> from one user machine to it (some weeks ago), so everything was present but
> unversioned. Since then, a few of those files have been manually edited on
> that user machine, without checking them out, so the first question is, how
> do I push those few files to the server so that the repository contains the
> updated copies? If I use add or checkin, it fails on the first changed file,
> saying it already exists:

Check out a working copy, replace the files in it with the
corresponding modified files and commit them.  Better yet, make each
of the users making the changes do this step themselves and add
meaningful log messages, and then they can keep on working in their
working copies and remove the original unversioned directory.

-- 
  Les Mikesell
     lesmikesell@gmail.com