The first patch fixes what I consider a bug in the way the auth keys were split. The second makes it possible for TortoiseHg to re-use the auth parsing code for a given URL.