Picture-by-Picture: Setting up Mercurial with WikidPad
I’m personally using Git to version-control my WikidPad files. However, Mercurial (and especially TortoiseHg) is equally well suited for this function. In many respects, Mercurial is simpler to use than Git. The only shortcoming I had with Mercurial is that there’s no managed branches; to branch, you create an independent copy of the whole repository (clone it).
Nonetheless, for most people, Mercurial will not only suffice but give quicker rewards than Git.
I don’t use Subversion for this purpose, because subversion has a centralized approach which requires a repository, separate from a working copy. Importing, merging, branching, etc., with subversion is a bit of a hassle. This “hassle”, of course, is purely personal taste; others will (strongly) disagree. In fact, for many other purposes, I strongly prefer Subversion to Mercurial/Git/etc.
Goal
By the time you’re done with the following steps, you should be able to:
- Place a WikidPad Wiki under version control
- Commit changes as files change
- Revert to prior versions
Set Up and First Steps
- Download Mercurial with TortoiseHG (I chose TortoiseHg 0.5 w/ Mercurial 1.02).
- Install TortoiseHg/Mercurial:
- Restart computer (if installing TortoiseHg)
- Optional: Create a new “Original SQLite” format wiki using WikidPad:
- Create a new folder for it (for example on your Desktop):
Note that the hierarchy will be:
- Select Original SQLite format:
- In Windows Explorer, Right-Click on the new Wiki Directory, select TortoiseHG->“Create Repository Here”:
- TortoiseHG->Add Files:
- Select all files & click “Add” button:
- Now, click “HG Commit”:
- Type in some text (“Initial check-in of blank wiki”) & hit Commit:
Since wikidpad is open, there’s a .lock file. Normally, we don’t want to check that in (it’ll cause conflicts when we try to edit our working copy later), but we’ll do so right now. I’ll show you how to get rid of it (WikidPad will automatically delete it for us) and ignore it in the future.
- Make some edits:
- Close WikidPad
- Go back up to the parent directory (two levels up), right-click it, and select TortoiseHG->“View File Status”:
- Note the changes (lock file missing) & .wiki files modified:
Cancel. - Go to TortoiseHG Commit:
- Select all changes & type in a commit message:
Hit “commit” button. - Open the wiki again:
- This time, right-click on the .lock file (or anywhere else), and select “HG Commit”:
- Right click on the .lock file and select “Add ignore” … :
- You’ll notice that the “.lock” file disappears, but .hgignore is now modified (“M” code):
- Add a similar ignore attribute for the .sli-journal file:
- Type in a commit message and hit “Commit”:
That’s it: as you continue to edit, you can continue to commit as you wish.
Reverting
You can revert back to a previous version by selecting “Tortoise HG”->”Update to Revision”:
You can then browse revisions (designated by an index number and a hash):