Monthly Archives: February 2011

Redo After hgpullsvn Aborted By External Causes

This is yet another case where a power outage giving you trouble. Just in case you haven’t struck by any of it in the last ~ 3 months consider yourself lucky. I know I’m not.

I just noticed —via Mercurial’s web interface— that my fpc, lazarus, and fpcdoc repository is several days old. While I haven’t put any mechanism to update my local repositories automatically on every start-up, but I kept my self to update it everyday whenever I get to use my computer; I put it as one of “after I log in”-rituals.

I’m fully aware that the fpc and lazarus SVN repository are updated daily since both are being actively developed. So I expect that when I update them the last time, exactly yesterday, so it must have pulled some changes (a.k.a “commits”). But seeing that it was last modified “5 days ago” then I strongly suspect something went (quietly) wrong.

Define “wrong”

Something not right.

Okay smart-ass, I’m going to close this tab right here in 3 … 2 …

Anyway, my fpc and lazarus local repository should be no more than 24 hours late. Because I remember doing update yesterday, and the day before that, but I’m getting report that it was updated 5 days ago. I also recall that roughly five days ago we had a power outage (note: I also recall one more outage since that day) for more than an hour or so.

Uh oh..

Exactly. This may have to do with when it was interrupted; and consequently, on how Subversion and Mercurial deal with this sort of accident.

First, I want to confirm into this power outage theory. So I login to my server computer and do a hgpullsvn manually on my local fpc repository:

$ hgpullsvn

it gave me this:

Interrupted, please wait for cleanup!

External program failed (return code 255): hg '--encoding' 'utf-8' 'up' '-C' 'default'
abort: unknown revision 'default'!

Wait, what?

I have to say that after a bit while (10 seconds or so) I left my computer because I ran out of drink. So unless someone (or something) accidentally trip over the keyboard which is very unlikely because a) I don’t have any pet, and b) the computer is in my room; nobody mess with the computers in MY room. So I ran the same thing again, this time patiently waiting in front of the screen and with more output just to make sure:

$ hgpullsvn --verbose --debug

which gave me this:

* hg '--encoding' 'utf-8' 'root'
* hg '--encoding' 'utf-8' 'qapplied'
* svn 'info' '--xml' '.'
Retrieving remote SVN info...
* svn 'info' '--xml' 'http://svn.freepascal.org/svn/fpc/trunk'
* hg '--encoding' 'utf-8' 'branch'
* hg '--encoding' 'utf-8' 'branches'
* hg '--encoding' 'utf-8' 'st' '-mard'
* hg '--encoding' 'utf-8' 'up' '-C' 'trunk'
* hg '--encoding' 'utf-8' 'branch' 'trunk'
* hg '--encoding' 'utf-8' 'parents' '--template' '{tags}'
Fetching SVN log for revisions 16959-16969...
* svn 'log' '--xml' '-v' '-r' '16959:16969' '--limit' '10' '.'
* svn '--version' '-q'
* svn 'up' '--ignore-externals' '--accept' 'postpone' '-r' '16959' '.'

Interrupted, please wait for cleanup!

* svn 'cleanup'
* hg '--encoding' 'utf-8' 'parents' '--template' '{tags}'
* svn 'up' '--ignore-externals' '-r' '16958' '.'
* hg '--encoding' 'utf-8' 'up' '-C' 'default'
External program failed (return code 255): hg '--encoding' 'utf-8' 'up' '-C' 'default'
abort: unknown revision 'default'!

So this thing stopped when downloading for commit #16959, well I just have to re-download it manually then.

Fixing It

Now I have to say there are two ways to deal with this, one is to re-download ONLY the offending commit and the other one is to download all commits since the last one until the latest. What I’m going to do here is to re-download only the offending commit, and then leave the rest for hgpullsvn.

Here’s how to download the last commit:

$ svn update -r 16958 --ignore-externals --accept postpone --force

The --force parameter is to ignore the existing, already downloaded files, and to re-download them all; or something like that. 😛

And… I need the commit-message and the name of the person doing the commit so I can put it as Mercurial commit-message and committer name:

$ svn log -r head

All relevant information duly noted.

After the Subversion part is done, I want it to register on Mercurial as well, so we take any changes and commit it as Mercurial commit. This command will add new files and delete removed files since last Mercurial commit:

$ hg addremove

Let’s commit using message and committer name from subversion.

$ hg ci -m "Do not use TProcess to run the compiler when it is not available" -u joost

Don’t forget to tag it with “svn.${SVN-REVISION-NUMBER}” because hgpullsvn needs it:

$ hg tag -r tip -l svn.16959

After manually brought the offending commit, I can continue using hgpullsvn, as usual, to pull the rest of the commits:

$ hgpullsvn --verbose --debug

Conclusion

It seems like hgpullsvn —and by proxy: Subversion and Mercurial— can not cope with sudden, non-waiting, undetectable abortion such as power outage. To be fair, there is so little any programmer can do either.

So, in the case of hgpullsvn the only thing you can do is to clean up the mess up and do what it do manually.

Leave a comment

Filed under Ilmu, Orang bego punya kegiatan

Wait, Iz Dat Arch Linux?

Got my first Arch Linux installed yesterday, a somewhat different experience for a guy used to Debian, but basically it’s all the same.

I’m bored, please entertain me with your Arch Linux endeavor

In general I spent most of the time preparing for the installation, while the installation itself took less than an hour.

Preparation before the install took 3 hours or so. The mirroring partitions off to a remote computer over 1Gb ethernet connection went about 90 minutes, coupled with partition table preparations (moving partitions, resizing, and formatting a dedicated /boot partition) took the other half of it.

Downloading the very basic stuffs compromising a modern Linux desktop is much tolerable when using a mirror nearby —that is, using local connection.

After that, all I have is a working system and ready to reboot, right? Well unfortunately, no.

So, that bastard gave you a hard time then?

In a way, yes. I swear this feels like the installer itself set up a challenge for me to solve before I can join with the *supposedly* elites being Arch Linux user.

The problem was GRUB throwing me this Error 15: File not found thing. Like any rookie, I hit the internet immediately. After browsing many support forums and mailing list, I developed a sense of what was wrong, and set to fix the damn problem.

First, I think it would be better to upgrade it to GRUB2 anyway. So I did just that by chrooting to my new system and made GRUB obsolete in one command:

pacman -S grub2-bios

after that I make sure it work this time by asking it to re-probe and rewrite the old bootloader:

grub-install --recheck /dev/sda

Of course the /dev/sda if for my SATA harddrive. If you are reading this to know how to fix your own problem, make sure to change that to whatever disk you are installing GRUB to.

But after that it’s all roses and ponies, right?

Sort of … well, kindda yes. Everything works, yes that’s a good thing. At that point I just have to install what I wants, and embracing how things work in the Arch Linux.

I mean the first thing that strikes me is this rc.conf file. I kindda like it, in Debian there are many files to edit, but in Arch Linux you just have to edit only one file for modules blacklisting, hostname, locale, daemon startups, network-configuration definition.

Of course being a KDE user myself, the next thing I do is to install KDE:

pacman -S kdebase-workspace


along with many interesting programs, including the non-vetted AUR builds.

So you are not a Debian guy anymore huh?

I am a Debian user, just not on my desktop computer. My server computer still running Debian, in fact I just did a stable-upgrade after Debian 6.0 came out. The stability side of Debian is still the best among Linux distributions in my book.

On the other side, for my day-to-day computer where I can tinker with it I chose to live on-the-edge and go with Arch Linux. 😀

1 Comment

Filed under Ilmu, Orang bego punya kegiatan, Pendapat gak penting

O Debian 6.0, How I Long for Thee

And this is yet another blog to write about this:

Debian 6.0 is out!
Release Notes
Download Debian Network Install
Installation Manual

As always, I’m here waiting for an Indonesian mirror synced to the main repository. 😦

Leave a comment

Filed under Orang bego punya kegiatan