Spread Firefox Affiliate Button

Pages

RelEng Blogging Blitz is coming soon!

Several members of the Release Engineering team are going to be blogging next week about various bits of the build, test, and release automation infrastructure for Firefox.

If there’s something about our infrastructure you’ve always wondered about, give us a shout and we’ll do our best to explain it!

Upcoming Identity Management with Weave

I was really excited to read a recent post about upcoming identity support with Weave on Mozilla Labs’ blog.

Why is this so cool?

Weave lets you securely synchronize parts of your browser profile between different machines. All your bookmarks, AwesomeBar history, saved passwords can be synchronized between your laptop, desktop and mobile phone. Your data is always encrypted with a private key that only you have access to.

Combine this with intelligent form-filling, automatic detection of OpenID-enabled sites, and you’ve got what is essentially single sign-on onto all your websites from all your browsers.

Now you’ll be able to sign into Firefox, and Firefox will know how to sign into all your websites.

Keep up the great work Labs!

Exporting MQ patches

I’ve been trying to use Mercurial Queues to manage my work on different tasks in several repositories. I try to name all my patches with the name of the bug it’s related to; so for my recent work on getting Talos not skipping builds, I would call my patch ‘bug468731′.

I noticed that I was running this series of steps a lot:
cd ~/mozilla/buildbot-configs
hg qdiff > ~/patches/bug468731-buildbot-configs.patch
cd ~/mozilla/buildbotcustom
hg qdiff > ~/patches/bug468731-buildbotcustom.patch

…and then uploading the resulting patch files as attachments to the bug. There’s a lot of repetition and extra mental work in those steps:

  • I have to type the bug number manually twice. This is annoying, and error-prone. I’ve made a typo on more than one occasion and then wasted a few minutes trying to track down where the file went.
  • I have to type the correct repository name for each patch. Again, I’ve managed to screw this up in the past. Often I have several terminals open, one for each repository, and I can get mixed up as to which repository I’ve currently got active.
  • mercurial already knows the bug number, since I’ve used it in the name of my patch.
  • mercurial already knows which repository I’m in.

I wrote the mercurial extension below to help with this. It will take the current patch name, and the basename of the current repository, and save a patch in ~/patches called [patch_name]-[repo_name].patch. It will also compare the current patch to any previous ones in the patches directory, and save a new file if the patches are different, or tell you that you’ve already saved this patch.

To enable this extension, save the code below somewhere like ~/.hgext/mkpatch.py, and then add “mkpatch = ~/.hgext/mkpatch.py” to your .hgrc’s extensions section. Then you can run ‘hg mkpatch’ to automatically create a patch for you in your ~/patches directory!

import os, hashlib
 
from mercurial import commands, util
from hgext import mq
 
def mkpatch(ui, repo, *pats, **opts):
    """Saves the current patch to a file called <patch_name>-<repo_name>.patch
    in your patch directory (defaults to ~/patches)
    """
    repo_name = os.path.basename(ui.config('paths', 'default'))
    if opts.get('patchdir'):
        patch_dir = opts.get('patchdir')
        del opts['patchdir']
    else:
        patch_dir = os.path.expanduser(ui.config('mkpatch', 'patchdir', "~/patches"))
 
    ui.pushbuffer()
    mq.top(ui, repo)
    patch_name = ui.popbuffer().strip()
 
    if not os.path.exists(patch_dir):
        os.makedirs(patch_dir)
    elif not os.path.isdir(patch_dir):
        raise util.Abort("%s is not a directory" % patch_dir)
 
    ui.pushbuffer()
    mq.diff(ui, repo, *pats, **opts)
    patch_data = ui.popbuffer()
    patch_hash = hashlib.new('sha1', patch_data).digest()
 
    full_name = os.path.join(patch_dir, "%s-%s.patch" % (patch_name, repo_name))
    i = 0
    while os.path.exists(full_name):
        file_hash = hashlib.new('sha1', open(full_name).read()).digest()
        if file_hash == patch_hash:
            ui.status("Patch is identical to ", full_name, "; not saving")
            return
        full_name = os.path.join(patch_dir, "%s-%s.patch.%i" % (patch_name, repo_name, i))
        i += 1
 
    open(full_name, "w").write(patch_data)
    ui.status("Patch saved to ", full_name)
 
mkpatch_options = [
        ("", "patchdir", '', "patch directory"),
        ]
cmdtable = {
    "mkpatch": (mkpatch, mkpatch_options + mq.cmdtable['^qdiff'][1], "hg mkpatch [OPTION]... [FILE]...")
}

Maybe he’s right?

The Pope has been taking quite a bit of heat over the past few weeks in the press. The latest media frenzy is over recent statements he made regarding the Church’s consistent teaching that condoms are not the answer to the AIDS crisis in Africa, or anywhere else in the world.

It seems like most people automatically assume that condoms are an important part of the solution to combating AIDS. It makes sense on some level I suppose; we’re reminded constantly of the importance of having “safe sex”, and how using a condom is the responsible thing to do. And I’m sure that condoms do reduce the risk of HIV transmission for any one given sexual encounter. But what are the effects over time? If condoms have a 99% success rate, that’s still 1 out of 100 failures. I’m not going to bet my life on a 1% chance of failure. Something with a 1% chance of occurring in a single event, has a 63% chance of occurring at least once over 100 events. Let’s say the prevention of transmission rate is 99.9%; there’s still a 9.5% chance of transmission over 100 sexual encounters in this scenario.

Now, big giant disclaimer here, I don’t know what the accepted statistics are on the effectiveness of condoms in preventing HIV transmission, either in ideal circumstances, or in actual usage.

I do know that the chances of failure for something definitely add up quickly over time, and they add up fast.

So it shouldn’t be a surprise to hear that, “We have found no consistent associations between condom use and lower HIV-infection rates, which, 25 years into the pandemic, we should be seeing if this intervention was working.” The full article can be read over at the National Review Online.

In two places I know of that have had success in combating AIDS, Uganda and the Philippines, the primary focus was on having faithful, monogamous sexual practices. And it makes sense why this works. If people have fewer sexual partners, then the risk of transmission in the general population is reduced.

So maybe the Pope is right when he said, “If the soul is lacking, if Africans do not help one another, the scourge cannot be resolved by distributing condoms; quite the contrary, we risk worsening the problem. The solution can only come through a twofold commitment: firstly, the humanization of sexuality, in other words a spiritual and human renewal bringing a new way of behaving towards one another; and secondly, true friendship, above all with those who are suffering, a readiness – even through personal sacrifice – to be present with those who suffer. And these are the factors that help and bring visible progress.” (my emphasis)

I think he is.

Thanks to Mulier Fortis for the link to the National Review article.

Upgraded to Wordpress 2.7

I just spent a few minutes upgrading my blog to wordpress 2.7. Looks like everything went smoothly! I did this upgrade with mercurial queues again. Wordpress 2.7 is supposed to have better upgrade support built in, so I may not need mercurial for future upgrades.

Please let me know if you notice anything strange or missing since the upgrade.

I’m on The Twitter

Well, it seems like all the cool kids are tweetering these days, so to keep up with the times, I’ve signed up on the twitter.

You can follow my twittering here: http://twitter.com/chrisatlee

poster 0.2 is out

I’ve fixed a few bugs with poster, and released the next version, 0.2. It’s available from the cheeseshop, or from my web page.

Documentation can also be found here.

Join the Revolution

Do yourself a favor and check out Johnath’s post on freedom. It will change your world.

Father’s Day Run 2008

Me at Father's Day Run last year

In what is becoming something of an annual tradition, I’m going to be participating in the 2008 Father’s Day Run in support of prostate cancer research.

Both my father and father-in-law have had prostate cancer, so this is a cause that’s very close to my heart.

Please consider supporting me in my run by clicking the image above, or this link.

BTW, that’s me and Thomas in the picture at last year’s Father’s Day Run – the first time I ran as a new father!

a confession

I don’t get lolcats. or lotcatz.

whatever.

People keep sending me links to them. People keeping making them. They show up in my RSS feeds with frightening frequency.

I have to admit, however, that these were pretty funny: http://blog.rominet.net/2008/05/debianopenssl-debacle.html. Mmmm…antropi….

Also, did you know that apparently there can be improper lolcat grammar!?