info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cvs diff output PATCH input? (was: synchronize two repositories)


From: Robert Bresner
Subject: cvs diff output PATCH input? (was: synchronize two repositories)
Date: Fri, 06 Oct 2000 22:07:00 -0500

I'm dealing with the problem right now...

My company has its repository, and another company has taken control
of a branch of our repository. So, we cvs exported the branch, and 
they created their own repository from that export. Now their files 
are all at version 2.1 (don't ask) while our files are 1.x.x.x etc.
(Would CVSUp be able to deal with that?)

Now, both companies will be developing enhancements and bug fixes for 
a while, us in our branch, them in their mainline. And we're gonna keep
these bad-boys in sync. With a magical perl script, my friend. I've got 
it almost finished, with only one remaining issue -- I'm a tad weak on 
the whole patch utility.

So. Is there a way to get "cvs diff" to output information that
can then be used by patch?

So:

        Repo A                          Repo B
        ---------------                 -----------------
        foo.c (2.1)                     foo.c (1.233.2.18)

Lets say (A) foo.c gets checked in and is now at 2.2.
My perl script will want to get the diffs of foo.c from 2.1 to 2.2
and apply THOSE changes to (B) foo.c 1.233.2.18. 

This script should be done by Monday if I can figure out how to do
this last piece, and (my bosses permitting) I'd be happy to put it 
up to this list if anyone else would find it helpful.


More details if your interested:
Two repositories, on two seperate cvs servers.
One client machine, with both repositories checked out to a local area.

        cvsynch.pl init 

Creates */CVS/SyncRoot and */CVS/SyncEntries files. SyncRoot contains the path 
to
the directory that must be kept in sync with the current dir. 
SyncEntries looks like this:
        file_name/Repo_A_Revision_Number/Repo_B_Revision_Number
SyncEntries info shows when the file in the two repositories was last sync'd.
If the file has changed, and those changes have been checked in, then the
SyncEntries revision number will not match the CVS/Entries revision number,
indicating that a sync needs to happen.

If the file only changed on one side, then I can just copy over the file in the 
other
area and check that it.

But, if it's changed in both areas, I need to PATCH one direction, then I
can copy that patched file back. 

Tada? Sure, if I can get that patch working. 

Of course there's more details than just that, but I reckon that's the gist.

Thanks,

Rob



W.Pröpper wrote:
> 
> We have the problem that we have to synchronize the sources of two
> repositories. We are two independant companies with their own cvs
> repositories and we build the software with the sources of both
> repositories. I think there are two possibilities:
> 
> 1. checkout from both repositories and building the software with both
> working directories
> 
> 2. checkout one repository and import it to the other
> 
> Are there any other ways to synchronize the repositories ? Are there any
> experinces with the same or a similar problem ?
> 
> Thanks for answering
> 
> Wolf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]