Tuesday, February 03, 2009

Project Hosting Upgraded to Subversion 1.5



We're pleased to announce that the Subversion component of Google Code Project Hosting has been upgraded to version 1.5. What does this mean to users? If you're using a Subversion 1.5 client, you can now take advantage of Subversion's improved "merge tracking" feature to manage branches.

Prior to Subversion 1.5, branching wasn't very friendly to users. A developer had to manually keep track of the revision from which a branch was copied. She also had to keep track of exactly which changes had been merged into a branch already (to avoid repeated application of changesets), and to always specify the exact range of revisions to merge next. Merging a branch back to trunk was even more difficult, since it required comparing two precise URLs in a very specific way.

With improved merge-tracking, users never have to type a single revision number. Here's a basic example of branch workflow.
  1. Make a branch for your experimental work:
    $ cd trunk-working-copy
    $ svn cp trunkURL branchURL
    $ svn switch branchURL

  2. Work on the branch for a while:
    # ...edit files
    $ svn commit
    # ...edit files
    $ svn commit

  3. Sync your branch with the trunk, so it doesn’t fall behind:
    $ svn merge trunkURL
    --- Merging r3452 through r3580 into '.':
    U button.c
    U integer.c
    ...
    $ svn commit

  4. Repeat the prior two steps until you’re done coding.

  5. Merge your branch back into the trunk:
    $ svn switch trunkURL
    $ svn merge --reintegrate branchURL
    --- Merging differences between repository URLs into '.':
    U button.c
    U integer.c
    ...
    $ svn commit

For a more detailed discussion of merge-tracking (and its limitations), see chapter 4 of the online Subversion Book. Live in fear of branches no more!

8 comments:

  1. Great news! Do you recommend any 1.5 client for MacOS X? It still comes shipped with 1.4.4

    ReplyDelete
  2. @Dirk: sure, just grab a prebuilt svn commandline binary from the subversion project homepage: http://subversion.tigris.org/getting.html#osx

    ReplyDelete
  3. I'm happy for happy subversion users, but now that I've used git, I'm can't imagine going back to a non-DVCS.

    Sign me "still anxiously awaiting git support..."

    ReplyDelete
  4. hey you guys, i want to know if the google code platform itself is open source? in other words, can i set up a similar platform for my company like google code??
    or is there any platform open source like google code?

    ReplyDelete
  5. @Key - I think you have an excellent questions. I would also love to be able to use the platform in different environments, and also be able to make improvements to the platform.

    However, I also understand the opposing reasoning. Any truly open source project should have no reason why it couldn't be hosted on Google's servers. Having a version that could be run on an internal company platform would remove part of the incentive to create open source software.

    ReplyDelete
  6. So, did Google convert all repositories? Or does this feature only work for branches that are created from now on? Would love to see a follow-up article on this issue.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete