Wednesday, 29 August 2012

Renaming files in TortoiseHg

I've only been using Mercurial for a short while, and only using
TortoiseHg, so things are still a bit unclear for me. I know, I know,
I should be reading all the way through to get a
good grounding in Mercurial, but it seems to be okay so far.

I'm testing out Mercurial on a little project I have to restructure a
project to use Maven instead of Ant, so there's inevitably some moving
of directories required.

But how do you move a file in Mercurial?

This is the annoying thing, they never use that word "move". They call
it "rename". I get it, Mercurial only cares about files, but for the
sake of real-world users who still use the word "move", there could be
a bit more guidance on this, IMHO.

Anyway, how to move a directory in TortoiseHg? You go to the parent
directory using Explorer, then you right-click and select "Rename".
Then you will get a dialog box where you select the location you will
place it in. By default, it will show the existing name (ie,
"src/com") in both the Source and Destination text fields. Now for the
Destination field, click on the corresponding "Browse" button and
select the new location where you will place the directory.

IMPORTANT: Make sure the name of the directory is also in the
destination field, as the contents will be moved to whatever location
is specified in Destination.

There is a checkbox with "Copy source -> destination" - what is this for?

It turns out this is just a way for the Mercurial "copy" command being
included in the Rename dialog. It's a bit of a confusing hack, in my

It's annoying that this is not discussed in the docos I've seen for TortoiseHg.

Found out from here:

If you tick the checkbox, it means Mercurial will copy the files, and
not move them. You'll end up with two copies, which might not be what
you want to do.


This is not the best way to move files or directories around. The best
way is to just move them, and then go to the top of the directory,
then right-click TortoiseHg to "Guess Renames"

Wednesday, 1 August 2012

Bloody hell. Simple WSRP demo works on Liferay Enterprise, but not on Liferay Community Edition

Spent a few days trying to get a simple "Hello World" portlet working
via WSRP, using 2 instances of Liferay running on my machine. Tried
6.0 CE. Didn't work. Saw a bug related to "Adding a WSRP Consumer",
JIRA said it was fixed in Liferay 6.1. Tried it on Liferay 6.1 CE as
consumer pointing to Liferay 6.0CE as producer: didn't work.

After a few days trying things like getting specific version of the
WSRP plugin to match the version of Liferay, multiple restarts, I've
now downloaded the Enterprise version of Liferay 6.0, matching it to
what we currently use in production.

I then set up a simple portlet as WSRP producer and then WSRP consumer
on the other Liferay instance: works perfectly.

Is this what they mean by "value-add"?