Contributing to Symfony with SVK
What is SVK ?
From the project's homepage :
svk is a decentralized version control system. It uses the Subversion filesystem but provides additional, powerful features. svk plays well with others, it can mirror remote Subversion, Perforce, and CVS repositories to perform offline operations.
Windows, Debian and Mac OS X installation are pretty straightforward.
$ apt-get install svk $ svk depotmap --init
Download the installer from http://svk.elixus.org/?SVKWin32 and launch it.
Mac OS X
Download the package from http://rt.openfoundry.org/Foundry/Project/Download/?Queue=82 (or follow the dowload link from the project's homepage) launch the installer SVK.pkg
$ svk depotmap --init
Compiling SVK from sources is not an easy task. You have been warned.
Mirroring the Symfony SVN repository
We will just take care of Symfony's 1.2 branch for this example :
$ svk mirror //symfony/1.2 http://svn.symfony-project.com/branches/1.2
Synchronise the local mirror with the remote repository :
$ svk sync //symfony/1.2
We now have a full mirror of Symfony's svn 1.2 branch (with history).
This is the branch we are going to work on, periodically synchronising it with Symfony's version.
$ svk cp -pm 'creating local branch for symfony/1.2' //symfony/1.2 //symfony/local/1.2
Let's grab a working copy of that branch :
$ svk co //symfony/local/1.2 ~/dev/symfony-1.2
We are now ready to contribute.
A session's lifecycle
We synchronise with the remote repository :
$ svk sync //symfony/1.2 Syncing http://svn.symfony-project.com/branches/1.2 Retrieving log information from 773 to 774 Committed revision 753 from revision 773. Committed revision 754 from revision 774.
and merge updates into our local branch :
$ svk pull //symfony/local/1.2 Auto-merging (750, 754) /symfony/1.2 to /symfony/local/1.2 (base /symfony/1.2:750). g lib/addon/propel/builder/SfPeerBuilder.php D data/skeleton/app/app/i18n/global New merge ticket: ee427ae8-e902-0410-961c-c3ed070cd9f9:/1.2:774 Committed revision 755
Commiting code to the local branch
This is exactly the same as with Subversion :
- Edit some files.
- Commit the files
$ svk ci
Now that we have updated the local branch we need to generate a patch against the sources. SVK makes this really easy :
$ svk push -P MyFantasticPatch //symfony/local/1.2
The patch has been produced. Let's check :
$ svk patch --list MyFantasticPatch@1:
We can consult now the patch :
$ svk patch --view MyFantasticPatch $ svk patch --view MyFantasticPatch > MyFantasticPatch.patch
SVK's patch commandset is rich. You can :
- update patches to the latest version of remote repository sources :
svk patch --update MyFantasticPatch
- regenerate patch after further source modification
svk patch --regen MyFantasticPatch