Archive for the ‘Subversion’ Category

Saturday, December 19th, 2009

I just recently released a new OSS project called jixedbar, a jQuery plugin that stick/fix a Div element on the bottom of a page/website. Inspired by Facebook’s fixed app/menu bar, the code is based on the jstcky (deprecated project) but with improved codebase, features, and written as a jQuery plugin to maximize the use of jQuery’s rich features.

Here’s a quick demo: http://ryan.rawswift.com/sandbox/jixedbar-0.0.2/demo/

You can get the Beta release from Google Code Project Host, either by downloading the archive file or through Subversion (SVN) repository.

Send your comments and suggestions to rawswift at gmai dot com.

Cheers!

Saturday, March 21st, 2009

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.

Wednesday, August 13th, 2008

This command can be handy. Let say you want to archive your project from the repository and you don’t want to include the ‘.svn‘ directories.

First, checkout your project from the repository:

svn co http://myproject.domain.org/svn/trunk/ myproject-dir

Second, remove the .svn directories:

rm -rf `find myproject-dir -type d -name .svn`

Then archive it using tar command:

tar -cvzf myproject_archive.tgz myproject-dir

…and there you have it!

Friday, August 8th, 2008

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.