Saturday, November 27, 2010

Mercurial rebase/merge musings part 2

In a previous post I wrote about how nice it'd be if Mercurial automatically could choose rebase or merge depending on whether there are conflicts that need manual resolution.

So, "yesternight", after finishing the checkfiles extension I wrote about recently I couldn't go back to sleep (despite it being 2:30 AM). So, I got back up and hacked together the rebaseif extension that adds a command and an option to pull that does exactly that. It turns out it wasn't that hard, although the process could probably be optimized slightly as it currently attempts a rebase, aborts on conflicts and then does a merge. (The better way would be to detect which operation would succeed and perform that.)

Now, some support for that in TortoiseHg and we're all set. :)

No comments :