Setting up version control + ToME on Windows
Posted: Tue Sep 21, 2010 3:56 pm
If you would like to hack on ToME, perhaps submit patches containing new monsters or your own class, then version control can make your life a lot easier. Below I will outline how to set up the Mercurial distributed version control software (VCS) on Windows and get hacking on ToME. First a bit of background, though. The ToME code itself is using the SVN version control software. SVN is a centralized VCS, which means that there is a central copy and only people that have write privileges can make changes. On the other hand Mercurial is a distributed VCS and everyone that links this to ToME will be able to have their own, local copy to which they can make as many changes as they want. The local Mercurial copy can then be kept in sync with the ToME SVN copy (this is one of the reasons VCS is so powerful), and once you are ready you can submit one large patch to DG for acceptance into the official SVN copy. Other distributed VCS have good coupling with SVN (eg. Git) but I am personally familiar with Mercurial so that is what I will highlight here.
Enough background, lets get moving. First you will need to install the proper tools onto Windows. Install TortoiseHG (http://tortoisehg.bitbucket.org/) for a nice GUI version that integrates into the File Explorer (or whatever that thing is called). Next we need to install the HgSubversion extension to allow us to access the ToME SVN repository:
Once you are ready to send your work to DG you can right-click in your "t-engine4-hgsubversion" folder and select "Hg Repository Explorer." Click on the little button that point up (the tooltip is "Determine and mark outgoing changesets." This should add little up arrows to the graph on the far left side of the scrolling view and help you find where DG's official SVN revisions stop and your revision start. Left-click on your first (bottom-most) revision. Then scoll up and right-click on your last revision. Select the "Export Patches from here to selected" option. This will create a patch file for each of your revisions which you can now zip up and send to DG.
Enough background, lets get moving. First you will need to install the proper tools onto Windows. Install TortoiseHG (http://tortoisehg.bitbucket.org/) for a nice GUI version that integrates into the File Explorer (or whatever that thing is called). Next we need to install the HgSubversion extension to allow us to access the ToME SVN repository:
- Navigate in the File Explorer to a place you feel comfortable adding the HgSubversion folder. (eg. a folder "coding" in your home directory)
- Right-click on some white space in the folder. You should see a "TortoiseHg" menu. Select "Clone..."
- Enter this into the source (without the double quotes): "http://bitbucket.org/durin42/hgsubversion"
- Add this to the end of the destination (without the double quotes): "\hgsubversion"
- Hit "Clone".
- Right-click on some white space in any folder. Select "TortoiseHG -> Global Settings."
- Select the "Extensions" tab on the left-hand side.
- Click on the "rebase" checkbox and hit Apply.
- Click the "Edit File" button on the top.
- Find the "[extensions]" section and add this below it: "hgsubversion = C:\path\to\your\hgsubversion\hgsubversion". (remember to replace the "path\to\your\hgsubversion" with the destination directory from the HgSubversion installation. The additional "hgsubversion" added to the end is intended, DO NOT FORGET IT!
)
- Save and exit.
- Click "Ok" to exit the Extensions settings.
- Click "Ok" again to exit the Global settings.
- Navigate to a place you feel comfortable putting the ToME directory. (eg. a folder "coding" in your home directory).
- Right-click on some white space in the folder. Select "TortoiseHG -> Clone..."
- Enter this as your source (without the double quotes): "svn+http://svn.net-core.org/repos/t-engine4"
- Add this to the end of the destination (without the double quote): "\t-engine4-hgsubversion"
- Expand the "Advanced Options" menu.
- Check the "Clone to revision" option. Enter 100 in the textbox to side.
- Click "Clone". This step may take a while depending on your internet connection. Close the Clone window after the operation has completed.
- Right-click on your new "t-engine4-hgsubversion" folder. Select "TortoiseHG -> Synchronize".
- Click "Pull". This step WILL take a long time. Close the Synchronize window after the operation has completed.
- Right-click the "t-engine4-hgsubversion" folder again. Select "TortoiseHG -> Repository Settings."
- Select the "Synchronize" tab on the left-hand side.
- Select "rebase" in the "After Pull Operation" pull-down menu.
- Click "Apply" and then "Ok" (I am a bit paranoid about setting
).
Once you are ready to send your work to DG you can right-click in your "t-engine4-hgsubversion" folder and select "Hg Repository Explorer." Click on the little button that point up (the tooltip is "Determine and mark outgoing changesets." This should add little up arrows to the graph on the far left side of the scrolling view and help you find where DG's official SVN revisions stop and your revision start. Left-click on your first (bottom-most) revision. Then scoll up and right-click on your last revision. Select the "Export Patches from here to selected" option. This will create a patch file for each of your revisions which you can now zip up and send to DG.