Setting up Mercurial with BitBucket (and FlashDevelop)

Atlassian have already written up a great tutorial for the basics, but here’s my trimmed down, TIGJamAU specific version.

~INGREDIENTS~
TortoiseHG
Bitbucket Account
PuttyGEN
FlashDevelop

~METHOD~
1) Install TortoiseHG, FlashDevelop and create yourself a Bitbucket Account.

2a) Open up PuttyGEN and click the “Generate” button to create an SSH key.  Add in a Passphrase as well if you want.
2b)Click “Save private key”.  It’s an important file, so keep it somewhere safe.  Eg. TortoiseHG install directory or otherwise.  Don’t close PuttyGEN yet!

3a) From the Bitbucket Home Page, pop down the user menu under your username, and open your account settings.
3b) From the nav bar on the left select “SSH Keys” and paste the entire contents of the “Public Key for pasting…” in PuttyGEN into the box under “SSH Key” on the BitBucket page.
3c) Finally, using the button at the bottom of the page, add the public key to BitBucket.  You can now close PuttyGEN.

4a) Open up FlashDevelop and create yourself a new project.
4b) Under Tools > Project Settings, scroll down to SourceControl.  Under HG; check EnableHG, point “HG Path” to hg.exe in the Tortoise folder, and the “Proc Path” to thgw.exe.
4c) Close FlashDevelop again.

4.5) From the TortoiseHG folder, open up “Pageant.exe”, and open up the SSH key you created with PuttyGEN earlier.

5a) With TortoiseHG installed, you should be able to navigate to the FlashDevelop Project folder with Windows Explorer, right-click it, and select TortoiseHG > Create Repository Here.
5b) Check “Show in Workbench after init” and create.
5c) With TortoiseHG now open, we’re almost there. Right-click on the newly created repository on the right, and open up the Settings.
5d) Switch to the Global Settings tab, select “Edit File” at the top right, and enter the following:

[ui]
username = JOEBLOGGER <USERNAME@email.com>
ssh = “C:\Program Files\TortoiseHg\TortoisePlink.exe” -ssh -2 -batch -C

It is of course recommended that you change JOEBLOGGER to your name used for Mercurial commits, and alter the TortoiseHG path if appropriate.
5e) Save and close that, switch to the Repository specific tab, and once again, “Edit File”.  Input the following:
[paths]
default = ssh://hg@bitbucket.org/BITBUCKET_USERNAME/BITBUCKET_REPO
[tortoisehg]
cipushafter = default
defaultpush = all
closeci = True
The path for “default” can be found on the BitBucket project overview page.  The other settings make it easier to sync stuff from FlashDev.



And done!  Try commiting and pushing the project at this point, and if there’s any problems, write me in the comments.  (I might even get around to adding pretty pictures after the Jam is over.)

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*