OK this is not really a PHP question but rather an SVN question in the context of a PHP project.

We've got an extensively modified project based on OSCommerce. A couple of weeks ago a designer obtained a copy of our source code and started to make layout changes to it. In the meantime, we developers continued to make changes to the code base for functionality reasons. Anyone who has experience with OSCommerce knows that the functional code and the html code are all mixed up together.

So now, a couple weeks later our designer has returned and we want to incorporate his changes without destroying all the lovely bug fixes we did. The project is managed with an SVN repository. We did not create a branch for him to work on so this will be his first commit.

I'm wondering how to handle this merge. It's not something I ever really do. Any advice would be much appreciated.

    Sit down with the designer and then update his edited version with the current state of the trunk. If there is a merge conflict, go through the conflicts one by one (a 3 way merging tool like Beyond Compare might help), and when you are satisfied, commit.

      Thanks so much for your response.

      Hm. The designer did not create a working directory originally. He simply took a copy of the files and began work on them. We got him to download TortoiseSVN and then started to get worried that he'd destroy our trunk when the confused emails started coming back.

      As I understand things, the 'svn merge' command will make alterations to a working copy which must subsequently be committed to the repository. Do I need to create a working folder of the revision he originally obtained? I'm guessing that if I were to make a working directory of the HEAD revision of the trunk and copy his files over that some of the existing bug fixes might be lost.

        sneakyimp wrote:

        As I understand things, the 'svn merge' command will make alterations to a working copy which must subsequently be committed to the repository.

        Yes, but I don't think svn merge is necessary here.

        sneakyimp wrote:

        Do I need to create a working folder of the revision he originally obtained?

        Yeah, this is the approach that I would take. Just checkout the revision, replace the files with what the designer has now, then update, resolve conflicts and commit.

        sneakyimp wrote:

        I'm guessing that if I were to make a working directory of the HEAD revision of the trunk and copy his files over that some of the existing bug fixes might be lost.

        Yes, I would expect that too, since you would effectively be overwriting them with "new" changes. (Of course, they are not lost in that the changes are still in history, heh.)

          Thanks for the tips. This has been sorted out.

            Write a Reply...