1

I have two projects in the same Subversion repository. They both use some standard code/classes (Zend/PEAR/phpMyAdmin etc) for various things. The repo is organized like this:

  • \shared\trunk - stuff used by both projects
  • \main\project1\trunk\shared svn:external of \shared\trunk
  • \main\project2\trunk\shared svn:external of \shared\trunk

This works great in the way that I only need to update the common code in one location. I am also sure it will work in both local, demo and production environments.

However, I notice that TortoiseSVN always seem to use some time checking out all there three directories everytime. And now that I have some tags and branches, it is even slower. The classes folder consists of about 3500 files and 1500 folders.

What to do? Is it good practice to keep standard classes version controlled?

Possible alternative: Drop the externals, and instead let Phing deal with exporting the classes folders?

elaxsj
  • 474
  • 1
  • 5
  • 16

1 Answers1

0

It is a common (and good actually) practice to keep references to dependent code with svn:external.

It really worth to wait for some time on svn ups for getting this convenience.

zerkms
  • 249,484
  • 69
  • 436
  • 539
  • Thanks for your answer! Will keep it in SVN. One followup question: How should I upgrade the classes? Now I used Tortoise to copy a whole new release on top of the old, but then **all** files gets marked as modified, and when I diff them I see the whole old file being removed, and the whole new file added... – elaxsj Jul 08 '11 at 17:45
  • @elaxsj: I'm not sure I can get your problem :-( – zerkms Jul 08 '11 at 22:17
  • An example: Let's say there is a new release of PHPExcel. I download the zip file from the PHPExcel website and unzip it to `\shared\trunk\classes` folder in my TortoiseSVN working copy. Windows asks me if I want to replace the existing files (from the previous version), and I click yes. I then commit. When I use Redmine to look at the revision I just made, I will see that **all** the about 500 PHPExcel files are marked as modified. With all the previous contents removed, and the new content added. Even on the files that were identical. I should probably use a more SVN-friendly procedure? – elaxsj Jul 08 '11 at 23:19
  • @elaxsj: if file hasn't been changed - it shouldn't be marked as changed – zerkms Jul 08 '11 at 23:22
  • Strange problem! I initially did a svn import from an existing code base. If I now replace a file in SVN that has not been changed since the import, with the exact same file from the old non-version controlled directory, SVN marks all the old content as removed, and the same content added again. Luckily it looks like it only happens once per file. So after one upgrade operation, new upgrades seems to be handled correctly; with only the actual changes marked as changed. Case closed, I guess. Thanks for all your help! – elaxsj Jul 09 '11 at 20:37