Subversion: How to copy a branch to an empty trunk

Here’s the scenario:

You have this really cool idea of an OSS project and you have already coded some of its source, though not stable enough for release you’d decided to create and uploaded it on Google Code repository to track the development history. “Trunk tree should only have the stable source”, with this in mind you’d decided to create a branch directory (/1.0) and upload your unstable source in there. After days of hacking and cracking, you finally have a source candidate for the trunk tree. So, how do you copy your candidate branch to the empty trunk?

Remember that when you create a new project on Google Code, your initial repository will already have a branches, tags, and trunk tree.

Using “svn merge” will not do, because you still have an empty trunk.

But how about “svn copy“?

> svn copy https://your-project.googlecode.com/svn/branches/1.0 \
   https://your-project.googlecode.com/svn/trunk/

That wouldn’t do either. Yes it’ll copy all the files and directories inside the “/branch/1.0” directory but it’ll include the “/1.0” directory. Meaning the end result will be “/trunk/1.0“.

https://your-project.googlecode.com/svn/trunk/1.0

You don’t want that, do you? Remember that Trunk directory should always contain the latest and stable source. So the “/1.0” directory will be inappropriate. What you wanted to achieve in your project repository tree, is to look like this:

  • /svn/branches
    • /1.0
      • source.file.1
      • source.file.2
  • /tags
  • /trunk
    • source.file.1
    • source.file.2

Solution

The way to do this (without temporarily deleting the trunk directory) is to first, checkout the candidate branch, change working directory and import.

  1. Checkout the candidate/stable branch:
    > svn co https://your-project.googlecode.com/svn/branches/1.0 branch-1.0
    > cd branch-1.0
    
  2. Import to the empty trunk:
    > svn import https://your-project.googlecode.com/svn/trunk \
       -m 'Stable source from branches/1.0, revision 26.'
    

Pros: Quick and easy, without deleting the current trunk tree.
Cons: What happened on the branch (history) stays on the branch.

Got another solution? I’d love to hear from you.

Recently activated Google App Engine account

Google App Engine

Google App Engine

I’ve been on hiatus for a couple of days. I had an early holiday vacation. And when I finally check my emails today and skimming through a lot of spam, I saw that I receive a mail invitation from Google App Engine, saying my account has been activated and I can start creating my application. I was surprised and got me thinking, when the hell did I request for a Google App Engine account? I paused for a moment then said to myself, what the heck! I’ll just jump in and start creating an application. I click the link provided by Google and sign in using my Google account. Then when I saw the “Create an Application” button, I was reluctant to click it, so I stop and think of what application I’ll write but couldn’t think of anything. So I decided to take a time to read the documentation and how to get started. I’m excited to start an application using Google App Engine, imagine your application can use Google infrastructure. Sweet!

Working with google code and subversion

First, create your project then upload your unversioned source code using svn client:

svn import sourcedir https://myproject.googlecode.com/svn/trunk --username myaccount

- when prompt for authentication, get your password from the ‘Source’ tab

Get a working copy of your versioned source code:

svn checkout https://myproject.googlecode.com/svn/trunk/

If you’ve made changes on your working copy you can apply those changes on the repository by simply this command:

svn commit -m "Put a descriptive comment."

- you have to be inside your working copy/directory.

And if by chance you forgot or simply wanna change your comment on that revision, you can add or change it:

svn propset --revprop -r 26 svn:log "Fixed someMethod() parameter."

If multiple developers are currently working on the project/repository, you can use this command to update your working copy:

svn update

- this will incorporate their changes into your working copy.
- again you must be on the working copy/directory.

Philippine Google TechTalk 2007

Phil Google Tech Talk 2007

Phil Google Tech Talk 2007

Monday (nov. 19, 2007) i’ve attended a talk (techtalk) in makati. the talk was about google apps like google gadgets, google open social and a short touch on android. i actually came late, i arrived in ayala from shaw blvd, past 7, then i have to find AIM building which took a lot of walking to get there. anyway the talk was ok, i think the speaker clearly explained the topic very well. and at the end of the talk there was a free snacks for everyone, plus i get to take home a google swag (t-shirt). lucky me! =)

big thanks to all the people who organize that event, especially to ms. aileen apolo and the speakers; jay and franklin. and also to the one participant who keep asking silly questions. here’s the thing grandpa! if you are not sure about questions that you’re going to ask, please don’t raise them, you’re just making fun of yourself. just sit there quietly and listen. sheesh! just when did gadget/app became a UI?

vic & joey: KAHAPON LANG!!! =)

quote of the day:
that is impossible!” and “…you call it gadget or whatever! but we call it UI!
— grandpa_tech