threads / discuss / 8298

git-svn and SVK mirror between two repositories

Subject: git-svn and SVK mirror between two repositories

## tl;dr

6 messages between May 24, 2007 and May 26, 2007.

replies: 5people: 3as markdown or json

Vinubalaji Gopal· May 24, 2007, 17:04 UTC · lore
Hi all,
    I have been trying hard to find if it is possible to mirror (or
clone in git-svn terms) two svn repositories and update changes from
one to other or do even more complex operations with these two
repositories. I did check the git-svn man page, but was lost without a
proper example. Can someone please provide me with an example of using
two svn repositories in git-svn and doing merge operations, etc .

I have used SVK for a long time and it was very much possible to use two svn repositories using the SVK FAQ entry as shown below:

Repository ONE in Paris, repository TWO in London and be able to create 2 mirrors then smerge both, doing it on a node in Berlin and using the mirror function? Sure. Simply do this:

svk mirror svn://svn.paris.fr/ //paris svk mirror svn://svn.london.uk/ //london

# pick a sensible base, or use --baseless svk smerge --base=1234 //paris //london

# ... and smerge between them normally ... svk smerge -I //london //paris svk smerge -I //paris //london

-- 
Vinu

In a world without fences who needs Gates?
Sam Vilain· May 25, 2007, 02:13 UTC · re: Vinubalaji Gopal · lore

Re: git-svn and SVK mirror between two repositories

Vinubalaji,

You should be able to track both of the svn repositories as different git-svn remotes. You can then move patches between them with git-format-patch and git-apply (or git-cherry-pick).

git-merge-base calculations won't work when operating like this - so git-merge won't work - however the simple merge base token used by SVK to track this would be easy to implement using git-tag and git-update-ref, so you could get yourself something as useful as svk smerge (which is really just mass cherry picking, using a token to remember what it last picked).

A better implementation would be to allow git-svn to spot that the repositories are tracking the same history and make sure they end up with the same commits, then git-merge could work.

However, you are in a relatively obscure use case, most projects wouldn't do this. Note also that the merge tickets SVK would use are not portable between different SVK mirrors so the merge information is not retrievable for anyone other than the person who did the merge. Use "svn pg svk:merge svn://svn.paris.fr/" if you don't believe me... the UUID and revision numbers in the property will not refer to revisions in svn://svn.paris.fr/ but to the (private) SVN repository in the SVK depot.

Sam.
Vinubalaji Gopal wrote:
Show 28 quoted lines
> Hi all,
>     I have been trying hard to find if it is possible to mirror (or
> clone in git-svn terms) two svn repositories and update changes from
> one to other or do even more complex operations with these two
> repositories. I did check the git-svn man page, but was lost without a
> proper example. Can someone please provide me with an example of using
> two svn repositories in git-svn and doing merge operations, etc .
> 
> I have used SVK for a long time and it was very much possible to use
> two svn repositories using the SVK FAQ entry as shown below:
> 
> Repository ONE in Paris, repository TWO in London and be able to
> create 2 mirrors then smerge both, doing it on a node in Berlin and
> using the mirror function?
> Sure. Simply do this:
> 
> svk mirror svn://svn.paris.fr/ //paris
> svk mirror svn://svn.london.uk/ //london
> 
> # pick a sensible base, or use --baseless
> svk smerge --base=1234 //paris //london
> 
> # ... and smerge between them normally ...
> svk smerge -I //london //paris
> svk smerge -I //paris //london
> 
> 
> 
Vinubalaji Gopal· May 26, 2007, 03:26 UTC · re: Sam Vilain · lore

Re: git-svn and SVK mirror between two repositories

Hi Sam,
On 5/24/07, Sam Vilain <sam@vilain.net> wrote:
> However, you are in a relatively obscure use case, most projects
> wouldn't do this.  Note also that the merge tickets SVK would use are

hm I am not looking for a complete bidirectional flow. I have a project (say my great open source project) in svn for which I have only read access. Since I don't have a write access, I have a personal svn sandbox for which I have complete read-write access and I branch the trunk into this svn sandbox. I commit all my changes to my sandbox so that I don't loose all my data in case my system fails! I also setup a local branch to which I can commit when I don't have a network access.

With Svk it has been (skipping the local branch step for now) svk mirror <myproject_svn_url>/trunk //trunk svk mirror <myproject_svn_sandbox_url>/mybranch //mybranch svk smerge --baseless //trunk //mybranch -m 'first merge'

I also have a local branch in svk: (local branch setup) svk copy //mybranch //localbranch -m 'local svk branch'

and occasionally enter the following commands to get the latest in trunk: svk smerge //trunk //mybranch or svk smerge //mybranch //localbranch

>the UUID and revision numbers in the property will not refer to revisions in
>svn://svn.paris.fr/ but to the (private) SVN repository in the SVK depot.
that is scary since I am not sure if I still have that local repository now.

I would look into your patch suggestion for sure, but also open for other suggestions . I am thinking if I should host the project in a different public git server (for now) instead of my svn sandbox and it will be easier :).

-- 
Vinu

In a world without fences who needs Gates?
Steven Grimm· May 25, 2007, 20:50 UTC · re: Vinubalaji Gopal · lore

Re: git-svn and SVK mirror between two repositories

Vinubalaji Gopal wrote:
Show 5 quoted lines
> Hi all,
>    I have been trying hard to find if it is possible to mirror (or
> clone in git-svn terms) two svn repositories and update changes from
> one to other or do even more complex operations with these two
> repositories. 

I don't know how svk would change things, but I did something similar and wrote it up here:

http://thread.gmane.org/gmane.comp.version-control.git/45060
-Steve
Vinubalaji Gopal· May 26, 2007, 23:34 UTC · re: Steven Grimm · lore

Re: git-svn and SVK mirror between two repositories

On 5/25/07, Steven Grimm <koreth@midwinter.com> wrote:
> I don't know how svk would change things, but I did something similar
> and wrote it up here:
> http://thread.gmane.org/gmane.comp.version-control.git/45060

Looks good and I am almost looking for the same thing. I just want to get rid of svk and use only git to manage the same thing. It would be great if you could share the commands you used to have that kind of setup.

-- 
Vinu

In a world without fences who needs Gates?
Vinubalaji Gopal· May 26, 2007, 23:48 UTC · lore

Re: git-svn and SVK mirror between two repositories

On 5/25/07, Sam Vilain <sam@vilain.net> wrote:
> Sounds a bit simpler than I thought - check out my tutorial on this
> http://utsl.gen.nz/talks/git-svn/intro.html

I did go through that link before posting here. I don't have my svk depotmap now and I want to skip the svk initialization again. I reread that tutorial again to see if I missed something, but could not find anything that I could use.

Here is how it is now - I had a project which I branched using svk. Say the project I branched was at revision r1000. I added a lot of changes to r1000 in my local svk branch. I committed all this changes to my svn sandbox using smerge. At times I also updated from the trunk using smerge. So the svn sandbox has all my local changes and the latest from the trunk upto some point.

Now I have a different machine with no svk - I have my svn sandbox with all my changes and changes from the trunk upto some point (say r1500 and the trunk is now at r1650). How do I setup git to use my svn sandbox and the svn trunk with no svk anywhere now and have the same kind of setup?

-- 
Vinu

In a world without fences who needs Gates?

← back to recent threads