These are the steps I took to get TortoiseHg working on OSX (Snow Leopard), using pygtk and the hgtk script included with the TortoiseHg installation.
- Download TortoiseHg. The Windows exe or msi files won’t work, so you’ll need to follow the links to download from source, or go straight here and get the latest version. Extract it somewhere memorable (I went with /tortoisehg/) and take note of the path to the hgtk script (for me it was /tortoisehg/hgtk)
- Make sure X11 and XCode are installed. If you’ve got a developer setup they probably are already, otherwise you can install X11 from the Snow Leopard disk and download XCode from Apple. X11 and the tools included with XCode are used to display the TortoiseHg GUIs. If you have XCode and the X11.app in Applications you’re good to go.
- Download and install MacPorts. The Snow Leopard package is what I used. MacPorts will let us install pygtk, which is needed to run the TortoiseHg GUIs from Python. It also turns out to be really helpful for installing everything else.
- Install pygtk. You’ll need to open up a Terminal window and use MacPorts for this:
There’ll be a bunch of dependencies that will download and build, this took a few hours on my Mac Mini, and a whole day on my virtual mac.
sudo port install py26-gtk
- At this point, I had issues with Python. This may not be the case for you, but when I typed “python” at the command line it was launching the Apple version of python that couldn’t import pygtk, instead of the MacTools version. Try loading up Python and typing ‘import pygtk’ then pressing ENTER to see if it works. If there’s an error message you may need to change your Python version – I used python_select to do this, which I installed using MacPorts:
and then to see what versions you have. Pick the one that’s not Apple with e.g.
sudo port install python_select
(note the sudo: you may not have permissions if you try the command without it)
sudo python_select python26
- Install mercurial. I’m putting this as step 6 because if you do it before you’ve selected the Python version you can end up installing it to the wrong Python. Just grab the OSX 10.6 version and install it from the website, or I’ve found using MacPorts works just fine too
sudo port install mercurial
- Install iniparse. This is needed to get the settings working properly for tortoisehg. You can use the website link, or MacPorts again
sudo port install py26-iniparse
- /path/to/hgtk should work now, but it will only display a list of options and then quit out. Create a symlink of hgtk in one of your PATH directories (I went with /usr/bin/ but use “env $PATH” at the command line to find one that works for you)
sudo ln –s /path/to/hgtk /usr/bin/
- Find yourself a Mercurial repository, navigate to it in the Terminal and type hgtk commit. If you get some warnings about RANDR just ignore them, it’ll still work. TADA!!! There’s our favourite commit window!
Okay, now just make sure your username is properly set up in both the global and repository settings, and you’re good to go.
Now get back to work
As I walked out of my last job and headed for the bus stop – my last day ended and a whole new life in another country ready to begin – I pulled my HTC Desire out of my pocket to check the time and it leapt out of my hands into a painful-sounding faceplant on the concrete, cracking the glass in front of the touchscreen. Devastated – and with glass splinters in my thumb from trying to check when the next bus was – I headed home.
A search on the Googles revealed that others in my situation had been quoted between $200 and $300 AUD to repair the touchscreen. Still others had chosen to ship parts from overseas repairers ($100 – $200 AUD) and replace the screen themselves. By the time I did my damage the phone was popular enough, and had been on the market long enough for me to be able to ship replacement parts from Hong-Kong for little more than $40 AUD. It turned out that the LCD was still working fine, but the broken glass cover at the front of the screen is actually the digitizer: The part of the screen that detects and sends the touches to the phone. 3 weeks later my replacement digitizer arrived and I set to work repairing my HTC Desire, following the instructions I found on this helpful website.
- - New digitizer
- - Star screwdriver
- - Cross screwdriver
- - Separator
- - Knife
- - Double-sided tape
Step 1 is pretty easy – remove the cover, battery, SIM card and SDCard
Step 2 is where I discovered that the cross-head screwdriver included with the replacement digitizer kit didn’t actually fit my phone, and had to go out and buy a new one.
Note the VOID stickers that need to be removed to get at the screws: this procedure will end your warranty
Step 3 is where it starts to get hairy – try not to lose the Power button or Volume rocker as the circuit board comes out, and remember to unplug the antenna connection and to plug it back in when closing the phone up again.
Step 4 gets a little scary- the screen is held into the frame pretty firmly, and it requires peeling and slight bending to get it out (not too much bending, mind you). There’s some metal tape stuff that has to be peeled off as well, but it’s pretty easy to stick it back on once you put the screen back in.
Step 5 is similar to the last step, but worse. The digitizer is held in by a sticky black glue, and it’s necessary to pull it away far enough that you can cut it with the separator all around. I managed to do this without bending the frame, everyone else may not be so lucky.
Step 6 just involves cleaning the frame so that the new screen can go in.
Step 7: Put it all back together and…it doesn’t work. Crap.
Whenever I touch the screen it brings now the notification panel. I was lucky to get the phone unlocked for the picture.
Strangely, it seems to work fine when the screen is left just slightly out of the frame, so I went ahead with the next step. This eventually ended okay, as the tape made the screen work for some reason.
Step 8 is to glue the digitizer back into the frame using small (2mm) strips of double-sided tape placed along the edges.
Step 9 is to gloat! I replaced my screen for less than $50!
Overall it was a surprisingly easy procedure, despite the worry about the screen not working about halfway through. If you can’t afford to get the screen replaced by an official repair centre, or don’t have warranty anymore, and you’re comfortable pulling the pieces out of a Tandy Robby Robot toy then by all means go ahead and replace the digitizer yourself!
Just don’t sue me if you stuff it up.
Posted by Tatham
| Tagged: Desire