How To Contribute Code To BlogEngine.NET

3. June 2010 17:05 by rtur.net in BlogEngine  //  Tags: ,   //   Comments (14)
codeplex

BlogEngine is a CodePlex-based project and uses Mercurial as source control. Most of described below equally applied to any CodePlex project that uses Mercurial. Here is step-by-step what you need to do to share your code on CodePlex.

Prerequisites

To work with BlogEngine you need Visual Studio 2010 (free express edition is fine) which can be downloaded from Microsoft site.

vs2010

You also need TortoiseHg to move files to and from repository. If you used to work with TortoiseSVN you know the concept. It works as Windows Explorer shell and very easy to use.

tortoisehg

Branching Out

First step is to create branch (fork) and clone code to your local computer. If you don’t have CodePlex account, go get one – registration is fast and easy. Once account created, log into CodePlex and navigate to BlogEngine and then go to “Source Code” tab. Hit “Create Fork” to create your own copy of code in the CodePlex repository.

source

Give your fork some descriptive name and click save button.

newfork

CodePlex will generate new branch and show you a URL where it will be stored. Copy it as you going to use it in TortoiseHg, we are done here.

cloneurl

Clone to Local

Now create folder on your local drive where you going to work with source code. In my case it is D:\temp\be, can be anything you like. Right-click this folder and choose TortoiseHg/Clone. Paste path to your CodePlex fork into “Source path” box and click “Clone” button, TortoiseHg will pull files from CodePlex to your computer.

hgclonedlg

You should be all set now to work with project files. BlogEngine structure is very simple, it has only two projects: web site and class library. Set website as startup project and default.aspx as start page and then hit “F5” – make sure Visual Studio can build and run project. Then do your changes, TortoiseHg will keep track on any changes you done.

Commit and Push

When you ready to save your work, you first save it into you local repository by right-clicking project folder and selecting “Commit” in the TortoiseHg menu. TortoiseHg will ask you to provide any description/notes for this commit, type in brief description of changes you done and push “Commit” button. Your work saved now on your local drive.

commitdlg

When all completed, you need to push changesets from your local repository to CodePlex. Again, right-click project folder and in the TortoiseHg menu group select “Hg Repository Explorer”. Review change sets you committed and if it looks good click “Push Outgoing Changesets” button. Tortoise will ask your user name and password at this point and copy all changes to CodePlex.

hgpush

Go to CodePlex and make sure all changes showed up in your fork.

verifypush

Last step – use “Send Pull Request” link to notify project team that you want your code merged into main project trunk. There!

pullrequest

At this point it is responsibility of the team to keep it going. Someone will receive notification, pull your fork and review changes. If everything looks ok, all will be merged with main trunk. You should always get back notification on the status of your request, even if it was not implemented.

It might look like a lot of steps but it really very simple and straight forward process. Have something you need to fix every time you upgrade to new version? Bringing it to the core project might be a good way of making your life easier and may be you’ll make someone else happy as a bonus.

Comments (14) -

Ben Amada
Ben Amada
6/4/2010 12:30:53 AM #

Great step-by-step.  Happy you took the time to document this.

Aaron
Aaron
6/4/2010 9:34:45 PM #

Thanks for posting this! I was thinking recently about a couple of things I wanted to do with the BlogEngine core but I had no idea how to go about actually contributing to the project. This post says it all though!

Michel
Michel
6/7/2010 1:43:46 AM #

Is there a reasonw hy SVN is not supported I thought it was an option on codeplex?

rtur.net
rtur.net
6/8/2010 10:52:17 AM #

It is. But you can't use both SVN and Mercurial. BlogEngine is on Mercurial since version 1.6

Michel Tol
Michel Tol
6/9/2010 12:20:03 AM #

ah that makes sence! tnx for explanation :)

Pravesh Soni
Pravesh Soni
7/10/2010 1:54:51 AM #

Is there any way to update fork with the latest changes in trunk to ensure fork is having almost latest code and getting changes from other contributers?

rtur.net
rtur.net
7/10/2010 9:42:51 AM #

Yes, go to "repository explorer" in TortoiseHg and click "pull incoming changesets" to update to latest committed code. You can even pull changes from other forks if you wish.

Pravesh Soni
Pravesh Soni
7/10/2010 11:24:42 AM #

Thanks.

Jack
Jack
10/20/2010 5:49:07 PM #

Is there any further information you can give on that? Anytime I go to "pull incoming changesets" on one of my forks, it just says there's no incoming changes. Even if there's updates to the main trunk!

Daniel
Daniel
8/26/2010 10:31:17 PM #

Does the pull request apply to the changeset or the entire fork?  I've got a pull request pending, and I'd like to submit another minor change I'd like to contribute.  Do I need another fork, or should I make it in the same one and submit another pull request?

rtur.net
rtur.net
8/27/2010 8:09:43 AM #

Hey Daniel, thanks for your contribution and sorry that request is pending for so long... It really depends on new change you made. If it is separated and not depends on your previous work, better put it as new request. This way it will get in fast and easy. But this is just due to relative complexity of your initial request, normally you would just change you fork and fire another pull request.

hilary
hilary
9/2/2010 2:05:08 AM #

Thanks for posting this!I was also thinking about this but I had no idea how actually contributing to the project.Thanks for providing step by step instruction.you have done a great job.

Vipul Taneja
Vipul Taneja
10/21/2010 2:21:08 PM #

Loooks great

Gina
Gina
11/29/2010 3:41:11 AM #

I followed your instructions step by step and it wasn't that hard as I thought it would be. I did it, I shared my code on CodePlex. Thank you :)

Pingbacks and trackbacks (3)+

Comments are closed

Recent Comments

Comment RSS