Reputation: 236
In git, there is a common practice of removing push access to the upstream repository for teams which use a specific workflow. This can be accomplished with a simple command to change the configuration. This keeps developers from accidentally pushing up changes without the proper review process. It still allows users to pull the latest changes from that repository.
Is there a way to configure a local mercurial repository to stop it from being able to push to a remote [read-only] repository?
Upvotes: 1
Views: 61
Reputation: 97285
You have at least two ways: local and remote
On push-target add pretxnchangegroup
hook, which reject pushes (all or some), easiest form
#!/bin/sh
echo 'No pushes here'
exit 1
Add alias, which redefine push into "something" without real push, but note the note in docs
It is possible to create aliases with the same names as existing commands, which will then override the original definitions. This is almost always a bad idea!
Upvotes: 1