(I may have already posted this, but cannot find it at this time.)
On a few occasions I have embarrassed myself by pushing to
the project master repository accidentally, when I meant to push to my rep where I
keep all of my history. (My project requires me to collapse fine grain commits to a much smaller number of coarse gran commits, losing history but keeping the log small. I keep meaning to try mq for this.)
Some folks on stackoverflow *almost* describe how to
do this.
Although the post has a bug, which
I have fixed. I would post the fix to stackoverflow, except it is down right
now, far enough that I am not sure that the below is the correct URL
Here is the my current BKM to
disable default-push:
I've embellished the idea of setting
paths.default-push in ~/.hgrc, making it a little bit more self documenting and
less error-prone - since, as I point out below, setting default-push = . does
not always disable pushing.
in ~/.hgrc
[paths]
# my main
project master repo
project-master
= ...
#DISABLING
IMPLICIT PUSH
# to prevent embarassment from accidentally pushing to
the project master repo
# instead of, in my case, a repo that has fine grain
commits
# that the rest of the team does not want to see in the
project master repo
#default-push =
.
# this works mostly, but NOT if you use hg on your home
directory
# since '.' in ~/.hgrc seems to be interpreted as -R ~
#default-push =
/NONEXISTENT_default-push_--_must_specify_push_target_explicity
# this works ok, but I can clean up the error message
using blanks
# keeping this around because blanks in pathnames
cionfuse many tools
default-push =
/'NONEXISTENT default-push -- must specify push target explicitly'
# this amounts to disabling implicit push targets.
No comments:
Post a Comment