views:

59

answers:

2

I am developing a semi-complicated site that is available in several countries at once. Much effort has been put in to make the code bases as similar as possible to one another and ultimately only the config file and some representational data will differ between them.

Each project has its own SVN repository which maps directly to a live test site. That part is handled by the IDE we use to work.

Now I am in need to create a some sort of system to keep all these projects in sync.

The best theoretical solution so far is to create a local hook script that would fire on committing and

  1. Merge the committed files from the project that is being committed to all other projects

  2. Optionally upload them to the live site, replacing previous files

The first problem is that I don't know how I would do the merging - I guess it would be like applying a SVN patch or something. The second is if I do not want to upload the changes to the live server, how would I go about synching the live and local code bases (replace older files?).

I am posting this question, not going through the potentially huge trouble of solving the aforementioned problems myself is that I believe this is a pretty common situation and someone would already have a solution and others may benefit from the answers in the future.

Lastly, I'm on windows7, develop PHP and use tortoiseSVN.

+8  A: 

If these projects are identical except for a few files, why not setup several projects (folders in SVN) each of which only contains these differing files and an external reference to a project (folder) with all the common stuff?

Something like this:

--+
  +-+ project1
  | +- => common
  | +- config.file
  | +-+ data
  |   +- blah
  |   +- wrxgl
  |   +...
  +-+ project2
  | +- => common
  | +- config.file
  | +-+ data
  |   +- blah
  |   +- wrxgl
  |   +...
  +-+ project2
  | +- => common
  | ...
  +-+ common
    +- foo
    +- bar
    +- baz
    +...
sbi
+2  A: 

Unless each site is significantly unique, I personally would have only had one branch with translations in resource files. My data models would have the ability to be local so when the whole thing went live there was one set of files and one database feeding the whole lot.

Perhaps I'm spoilt. I get a lot of this functionality for free with Django but gettext is pretty universal and sorting routing (et al) isn't that tough.

Oli