4

1

I work with several code-bases and each has two branch repos, stable and my personal dev branch. When I clone from Kiln, the .hg/hgrc file in the repo points to the branch I cloned from. When I push, I sometimes push there accidentally when I want to push to the other one.

The Kiln extensions' path-guessing feature makes it easy to specify the other branch, but how can I prevent any accidental pushes?

flag

1 Answer

4

The answer, I found, is to require a target path on every push. By default, the clone comes with this in the .hg/hgrc file:

[paths]
default = https://example.kilnhg.com/Code/SuperProject/Widget/stable

and running hg push will push to the default path every time. I changed it to this so that I have to specify which repo every time I push. No more mistakes!

[paths]
stable = https://example.kilnhg.com/Code/SuperProject/Widget/stable
adam = https://example.kilnhg.com/Code/SuperProject/Widget/adam

If I forget:

$ hg push
pushing to default-push
abort: repository default-push not found!

Better:

$ hg push adam
pushing to https://example.kilnhg.com/Code/SuperProject/Widget/adam
searching for changes
remote: kiln: successfully pushed one changeset
link|flag
Very cool -- thanks Adam. – Ken Morse Apr 22 2012 at 1:13

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.