[p4] Tips for syncing with SVN

Andrew May acmay at acmay.homeip.net
Wed Nov 29 22:54:37 PST 2006


R. Tyler Ballance wrote:
> There are a few open source projects I deal with on a daily basis,  
> and for some of my work I need to maintain custom builds and/or patch  
> sets, and I was wondering if anybody had come up with any decent  
> solution to keeping perforce quasi-in-sync with a subversion directory.

I have wanted to do this too, but I have never gone through with it.
This prompted me to try yet again.

SVK and VCP seem to be some promising tools.
http://svk.bestpractical.com/view/HomePage
http://public.perforce.com/public/revml/index.html

With CVS and VCP it seems to work just fine.
vcp -d
cvs::pserver:anonymous at buildbot.cvs.sourceforge.net:/cvsroot/buildbot:buildbot/...
p4:localhost:1666://depot/buildbot/head/...

The one thing missing is the SVN source driver for VCP. I am not sure
how hard that is to do. And I am not sure how to repeat that command
nightly.

With SVK, I think the sequence would be:
svk mirror p4://depot/something/head/... //mirror/to_p4
svk mirror svn://xxxx.org/trunk/something //mirror/something_svn

svk sync //mirror/something_svn
svk smerge -B -I //mirror/something_svn //mirror/to_p4
But the error I get is:
merge back editor for VCP not implemented yet at
/usr/share/perl5/SVN/Mirror/VCP.pm line 153.

But if that were to work, it would seem you could just have a cron job
doing the sync/smerge to get the full svn history into perforce.

Getting stuff from perforce to svn seems to work just fine. If you
wanted to go the other way, but that doesn't really help. Those open
source people just like to run away from the closed source tools. :)



More information about the perforce-user mailing list