Path guessing tries to remove the constant pain of either adding a bunch of paths to your hgrc file or copying URLs back and forth all day long. The incoming, outgoing, pull, and push Mercurial commands are supported for this extension.

After you install the Kiln Client, which includes the kiln extension, you should see the following section added to your Mercurial.ini file:

[kiln_scheme]
kiln
=http://<yourdomain>.kilnhg.com/Repo

Path guessing uses these entries to determine the location your Kiln account. If you use multiple Kiln installs, path guessing will support guessing to different installs so long as they are all specified here.

After cloning a repository, I see that the only path available to me (the default path) is the repository I cloned off of, in this case my personal andrew branch of a project.

PS C:\demo> hg paths
default = https://songexe.kilnhg.com/Repo/Website/2-0/andrew

Now lets say I’ve made some changes and want to push them out to my branch. Luckily, that’s my default branch, so I can just type hg out:

PS C:\demo> hg out
comparing
with https://songexe.kilnhg.com/Repo/Website/2-0/andrew
searching
for changes
changeset
:   29:6951f1d98d7b
tag
:         tip
user
:        Andrew Song <andrew@fogcreek.com>
date
:        Thu Aug 19 14:00:59 2010 -0400
summary
:     Added newfile.txt to the repository

If I just type hg push now, it’ll get pushed out to my default branch:

PS C:\demo> hg push
pushing to https
://songexe.kilnhg.com/Repo/Website/2-0/andrew
searching
for changes
remote
: kiln: successfully pushed one changeset

Now I’d like to push this change to the parent repository. Previously, I’d have to go into Kiln and manually grab the URL for my parent. Thankfully, we now have path guessing! By using the command hg kiln --targets or hg kiln -t for short, we can see a list of all non-empty repositories related to this in Kiln:

PS C:\demo> hg kiln -t
The following Kiln targets are available for this repository:

    http
://songexe.kilnhg.com/Repo/Website/1-0/OldWebsite
    http
://songexe.kilnhg.com/Repo/Website/2-0/Parent
    http
://songexe.kilnhg.com/Repo/Website/2-0/andrew
    http
://songexe.kilnhg.com/Repo/Website/2-0/david
    http
://songexe.kilnhg.com/Repo/Website/2-0/kareem

Now, all I need to do is completely and uniquely specify any URL part.

PS C:\demo> hg push Parent
pushing to https
://songexe.kilnhg.com/Repo/Website/2-0/Parent
searching
for changes
remote
: kiln: successfully pushed one changeset

Since Parent was a unique part of the URL slug, path guessing knew exactly which repository I meant and pushed to it without forcing me to fumble around with URLs.

What if I had typed hg push 2-0 instead? Since this doesn’t uniquely match any part of the URL, path guessing will just display a list of all matching targets:

PS C:\demo> hg push 2-0
abort
: 2-0 matches more than one Kiln repository:

    http
://songexe.kilnhg.com/Repo/Website/2-0/Parent
    http
://songexe.kilnhg.com/Repo/Website/2-0/andrew
    http
://songexe.kilnhg.com/Repo/Website/2-0/david
    http
://songexe.kilnhg.com/Repo/Website/2-0/kareem

Hopefully, path guessing will improve your interaction with Kiln by removing some inconveniences and streamlining your workflow. It sure has made my life easier!