Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you prevent default-push, but allow pull?

I want to know if there's a way to turn off the default push, but keep the default pull when using Mercurial. I don't want to accidentally pollute the master repository by inadvertently pushing from an experimental repository.

like image 232
moswald Avatar asked Jul 21 '10 17:07

moswald


2 Answers

I was able to solve this by putting the following in my .hg/hgrc file, but I was wondering if there's a better/official way.

[paths]
default = http://server/hg/repo
default-push = .
like image 112
moswald Avatar answered Nov 15 '22 10:11

moswald


Your solution probably is the quickest and is certainly effective. If there's any official way it would be using a preoutgoing hook:

[hooks]
preoutgoing = bash -c 'read -p "Really push to $HG_URL? " -n 1 RESP ; [ "$RESP" == "y" ]'

which will ask you if you want to push and provide the URL to which it would go as a reminder.

like image 22
Ry4an Brase Avatar answered Nov 15 '22 12:11

Ry4an Brase