This is a very basic integration, but should make your life MUCH easier if you are using Mercurial (Hg). This is a work in progress and I anticipate better things when TortoiseHG 0.4 or 0.5 come out.
Background
Mercurial is a great DVCS (Distributed Version Control System) that is mostly a command line tool, with windows integration using the excellent TortoiseHg tool. I've gotten VERY USED to using keyboard shortcuts within PHPEd to commit single file commits into CVS (I hit CTL-SHIFT-M to open up a CVS commit dialog within PHPEd) and wanted to do the same thing for Mercurial, which we're considering switching to.
This tutorial should save you some time since I figured out the commands necessary. Also, previously it was impossible to to integrate Mercurial with PHPEd due to a bug in Mercurial, which was very promptly fixed by the Mercurial devs when I reported it to their mailing list.
Keep in mind that using TortoiseHg already gives you tortoise functionality in PHPEd's file browser, but my problem is that I like keyboard shortcuts.
Requirements:
- Mercurial 1.0 or greater. Previous versions (eg Mercurial 0.9.5) DO NOT work due to a bug that was fixed for 1.0. The version here works: http://mercurial.berkwood.com/
- I'm using PHPEd 5.2. Your mileage may vary if you are using 4.x
What to do: Creating a Commit Shortcut
- Install Mercurial if you have not already. I've installed mine to c:\development\Mercurial\
- Go to PHPEd Settings > Tools > Integration
- Create a new menu called "Hg" (or Mercurial or whatever you want to call it)
- Create a new Sub Menu called "Hg Commit"
- Edit "Hg Commit" with the following settings:
- Execute with "Shell"
- Command line: c:\development\Mercurial\hg.exe commit @Name@ --cwd @Path@
- Check off "Show this command in File Bar popup" (optional)
- Shortcut: CTL-SHIFT-M (or anything you like)
- Check off Redirect Error stream to Log Window and Redirect Output to Window
Now if you are editing a file all you have to do is type your shortcut to commit it. It will open up Notepad, which you type your commit message into, and save/close, and it will commit. Commit results and errors are output into PHPEd's Log. Pretty handy!
To setup nifty Annotate and Log features you do exactly as above except the command lines are:
c:\development\Mercurial\hg.exe annotate -un @Name@ --cwd @Path@
|
and
c:\development\Mercurial\hg.exe log @Name@ --cwd @Path@
|
For the annotate I used some options so it would include the name of the author for each line (by default Hg doesn't show this, while CVS does).
After using the above Make the following changes:
- Make sure Redirect Output to log window is NOT CHECKED
- Save Output to file: c:\windows\temp\hg_log.txt
- Check off Open File and enter "c:\windows\temp\hg_log.txt" under "In editor"
The above steps opens up the log entry results in PHPEd. Very handy for me!
Hope this helps. When TortoiseHg 0.4 or 0.5 is working fine we can create integration with its handy "visual log" and, more importantly, QCT based visual commits which will let you open up a commit dialog to commit multiple files in one go.