Using sourceforge

Navigation: Main -> ns3 -> howto -> sourceforge

Introduction to Mercurial
The ns-3 code repository uses mercurial version control system. An overview of mercurial with tutorials can be found here. See also the ns3 tutorial.

Using Sourceforge
Sourceforge and Mercurial Tutorial: For the NS-3 Project Terminal: #for ubuntu/debian installations sudo apt-get install -y mercurial #this will let you know if it is installed correctly hg version

Create a file in your home directory called .hgrc with the following contents: #this is a Mercurial configuration file. [ui] username = Firstname Lastname 

Terminal: #navigate to the project/workspace you want cd workspace #this will ensure that you have a copy or "clone" of the current working source hg clone http://chic.hg.sourceforge.net/hgweb/chic/ns-3-dev/

From here: #Please follow the link to get started with building and working with the source: http://polywireless.wikia.com/wiki/Ns-3_Configuration_Using_the_Terminal

When you want to start working on the code: #get the status of your repo vs the online store hg status #if ahead of repo, do work, else hg pull http://chic.hg.sourceforge.net:8000/hgroot/chic/ns-3-dev

#now that your repo is at least up to date you want to branch this ensures that if you mess #anything up you can just throw this branch out and continue from the default branch which #should be up to date hg branch NameOfBranchToBeWorked #do work and when done hg commit -m "message here that adequately described what you did/changed" #when you are done with this branch, and want to push the content #navigate back to parent branch hg branch NameOfParentBranch #make sure there are no changes that have been pushed before you push hg status #if there are changes, hg pull http://chic.hg.sourceforge.net:8000/hgroot/chic/ns-3-dev #make sure to navigate back to the branch you worked on               hg branch NameOfBranchToBeWorked #merge primary with secondary hg merge NameOfParentBranch #fix any issues then hg commit -m "message detailing changes" #navigate back to parent hg branch NameOfParentBranch #go to else/nextstep #else/nextstep: hg merge NameOfBranchToBeWorked #commit, there should be no issues or complications at this point hg commit -m "just an update" #push to origin master #check hg status #you are getting the idea now that we need to check to see for changes always so as         #to not contaminate the repo if you are good to go                hg push ssh://username@chic.hg.sourceforge.net/hgroot/chic/ns-3-dev

The above details essentially the way to work within the branches and best practice methods to ensure the repo remains uncontaminated.

NOTES: Update: moves the pointer when specified to a changeset, else to the current. This will not the way to merge the information. Please use the merge command if you want to merge. example: hg update changeSetNumber Merge: the current working dir is updated with all changes made in the requested revision since the last common predecessor revision. example hg merge BranchNameToBeMergedToCurrentBranch

NOTE**: I believe the issue with merge/update command is that there needs to be a revision, and defaults to the working directory parent's revision. The revision may be required over the branch name.