The SVN conversion is now complete. All issues should be posted to email@example.com.
Moving to SVN FAQ
The following command lines might get you started, you should read the information below in any case!
The recommended way is to make a sparse checkout of the php-src only (see below for a more fully fledged example):
svn co https://svn.php.net/repository/php/php-src --depth immediates php-src cd php-src svn up branches tags --set-depth immediates svn up trunk branches/PHP_5_4 branches/PHP_5_3 --set-depth infinity
Or alternatively (but not recommended), you can fetch the current PHP source code and the (by the time this is written) active branches:
svn co https://svn.php.net/repository/php/php-src/trunk PHP_TRUNK svn co https://svn.php.net/repository/php/php-src/branches/PHP_5_3 PHP_5_3 svn co https://svn.php.net/repository/php/php-src/branches/PHP_5_4 PHP_5_4
Fetch the trunk (HEAD) of a PEAR module:
svn co https://svn.php.net/repository/pear/packages/$NAME/trunk $NAME
The same for a PECL package:
svn co https://svn.php.net/repository/pecl/$NAME/trunk $NAME
I tried to check out a module and svn said, "svn: Repository moved temporarily to '/viewvc/module'; please relocate". Why?
I tried committing but svn said something like, "Server sent unexpected return value (403 Forbidden) in response to MKACTIVITY request for '/repository/!svn/act/foo'". Why?
SVN commits require a SSL checkout. See https-svn for details.
I tried to add a new file to my checkout and svn said "svn:keywords not set on textual file". What does this mean?
The pre-commit hook on PHP's SVN repository forces the svn:keywords property to be set for all textual files. Detailed instructions on how to set up your svn:keywords properties correctly is given in section 5 of http://darkrainfall.org/phpsvn-guide.html. No, the pre-commit hook can not set the keywords for you. This is a limitation of SVN itself. Do not ask for it to be done automatically.
I tried to check out some branch or tag on Mac OS X or Windows, or some case-insensitive filesystem, and SVN said "svn: Can't move 'tags\something\tempfile.tmp' to 'tags\something\SOMETHING_ELSE': Access is denied.", or something similar
Some modules in SVN are known to have issues with case sensitivity. This usually happens in situations where, for example, both “LICENSE” and “License” exist in the same directory. Contact the person responsible for maintaining the module in question. If you are that person, then use SVN's move and/or delete commands with URL syntax to rename or remove the offending files. If you need help, contact firstname.lastname@example.org.
The MIME types file that was used to convert the CVS repository to SVN was a bit overzealous. Most of these mistaken MIME types have since been removed, but some may still be lurking. If you run into this issue, run the command “svn propdel svn:mime-type <path(s) to affected file(s)>” and commit the change.
Why didn't my commit email come through?
- You made a commit so amazingly encompassing that it was simply too large for the mail server. This should pretty much never happen.
- The commit email was sent to a mailing list you aren't subscribed to.
- You've run into a bug with our commit mailer. Please let us know by emailing email@example.com.
While making a commit, I get a 400 Bad Request error... what's the problem?
Your error may look like:
- “svn: Server sent unexpected return value (400 Bad Request) in response to MKACTIVITY request ...”
This is often caused by a proxy or firewall that is prohibiting the DeltaV and WebDAV HTTP extensions required by Subversion. There are two possible ways to remedy this issue:
- Somehow bypass the offending proxy or firewall
- or use SSL to connect to the repository as most proxies do not filter SSL connections at all
The PHP project made SSL available on around March 2, 2010, so you are strongly encouraged to start using that. See also http://news.php.net/php.internals/47085.
Sparse Directory Checkout Instructions
If you are going to be working with many parts of the code or documentation in SVN, a large sparse checkout might be useful.
It takes a bit of work to set up your checkout, but once you have done it, it becomes easy to work with. Here are my steps to creating a ~/src/ directory with the parts of the repository I commit to:
# Create initial top-level src dir svn co https://svn.php.net/repository --depth empty src # Fetch the parts of the repository I care about svn co https://svn.php.net/repository/php https://svn.php.net/repository/pecl \ https://svn.php.net/repository/pear https://svn.php.net/repository/phpdoc \ https://svn.php.net/repository/systems https://svn.php.net/repository/web \ --depth immediates src # Now, in php-src get all tags and branch names, but only # populate trunk and the PHP_5_3 and PHP_5_4 branches cd ~/src/php/php-src svn up branches tags --set-depth immediates svn up trunk branches/PHP_5_3 branches/PHP_5_4 --set-depth infinity # In pecl get all tags and branch names, # but only checkout out trunk for each cd ~/src/pecl svn update * --set-depth immediates svn update */tags */branches --set-depth immediates svn update */trunk --set-depth infinity # Same idea for pear cd ~/src/pear svn update * --set-depth immediates svn update */tags */branches --set-depth immediates svn update */trunk --set-depth infinity cd ~/src/pear/packages svn update * --set-depth immediates svn update */tags */branches --set-depth immediates svn update */trunk --set-depth infinity # and pick up the remaining flat modules (systems, web) cd ~/src svn update */tags */branches --set-depth immediates svn update */trunk --set-depth infinity
Once you have all this set up, you can then cd into any empty branch or tag directory and run:
svn update --set-depth infinity
to fully populate that directory on demand.
- The “directory structure” has changed slightly. The root directories represent “will probably be its own repository in the future”. Poke around on https://svn.php.net/ to see the specifics.
- You have to “validate your php.net account” to gain access to SVN
- You cannot checkout the entire repository on case-insensitive filesystem
Validating your account
To gain access to svn.php.net you have to “validate your SVN account”. This is automatically done by logging into master (https://master.php.net/login.php), the wiki (http://wiki.php.net) or reply to bugs on bugsweb (http://bugs.php.net/) from the developer tab. Your access credentials will be synchronized within 15minutes.
The SVN repository now has true anonymous access. The svnread user is no longer required and will no longer function.
- The “ChangeLog” script (used for php-src) hasn't been ported yet
We do anticipate problems for few days, which is why the commit freeze will last the weekend. The firedepartment will be around to extinguish fires that will burst out
New to SVN?
- CVS to SVN Crossover Guide (shows CVS commands and their SVN equivalent)
Miscellaneous topic (other DVCS bridges, etc.)
Using a DVCS mirror
There are various DVCS mirrors for the subversion repository that can be used.
The git repository can be found at http://github.com/php. It was imported using git-svn. The following modules exists:
php-src.git(at git://github.com/php/php-src.git). Ths module contains all branches and tags from https://svn.php.net/repository/php/php-src/. The repository is about 110M big.
phpdoc-*.git. These modules contain all branches and tags from the associated phpdoc repositories.
To commit back to the repository you have to setup a valid repository for git-svn first. This can be done using the following set of commands. It will setup the correct remotes to determine the upstream uuid maps.
Keep in mind that Github has become really slow lately (well, for me [tony2001] at least - 10-20Kb/sec is the maximum speed I get from it, so it's hardly usable).
The easy way
We offer a set of shell scripts that help you to setup branches or a full clone. The repository can be found at github. Download the scripts and execute them:
$ sh checkout-branch.sh php60.git trunk git://github.com/php/php-src.git // checkout php 6.0 branch $ sh checkout-branch.sh php53.git PHP_5_3 git://github.com/php/php-src.git // checkout php 5.3 branch $ sh checkout-tree.sh php-src.git git://github.com/php/php-src.git // checkout complete tree
The complex way
If you don't like to use the provided shell script, here is an step-by-step instruction how to setup the clone.
#!/bin/bash mkdir php-src.git cd php-src.git git init git remote add origin git://github.com/php/php-src.git git config remote.origin.fetch refs/remotes/*:refs/remotes/* git fetch # this step is important, if you don't use trunk, you'll end up reimporting everything. git checkout -b master trunk git svn init -s https://svn.php.net/repository/php/php-src/ # this will rebuild your the commit mapping. It will just list all the revision but it shouldn't import everything. git svn rebase
To develop with git you might either work directly on trunk or use a feature branch approach:
# create a branch and check it out git checkout -b feature/new-syntax-y master ..hack.hack.. git commit ..hack..hack.. git commit # keep up to date with the master git rebase master # merge back git checkout master git merge feature/new-syntax-y # commit back to svn git svn dcommit
To cherry pick commits (aka porting to the branches) you can use git's cherry-pick command. Assuming you worked on master (PHP 6 branch) and created a new commit that has to be ported you want to pick the last commit from the mast branch and apply it on top of other branches.
git checkout master ..hack..hack.. git commit # port: git checkout PHP_5_3 # get last commit from master (PHP 6) and try to apply it on top of PHP_5_3 git cherry-pick -e master git checkout PHP_5_2 git cherry-pick -e master
Fetch just one branch
mkdir php60.git; cd php60.git git init # replace trunk with PHP_5_3 for php5.3 git remote add origin git://github.com/php/php-src.git git config remote.origin.fetch refs/remotes/trunk:refs/remotes/git-svn git fetch git svn init https://svn.php.net/repository/php/php-src/trunk git checkout -b master remotes/trunk git svn rebase