Question

In my company some users are pushing stuff into the repo without specifying the branch, thus causing a few issues. Is there a way to force the -b option on mercurial so the user always needs to specify a branch when pushing? I mean, we could force a specific comment in the commit message. Can we do the same with the -b option?

Was it helpful?

Solution

If pushing all pushable commits "causing a few issues" it's a problem of your workflow and (used additional) tools - because pushing all branches is default style for Mercurial and you must design processes, having this in mind and don't emulate ugly Git-style.

Yes, way to force -b in push exist (redefine push in [alias]), but it's wrong way

OTHER TIPS

You could have them use a new enough version of mercurial, make them have their default phase of commits be 'secret' via

[phases]
new-commit = secret

in their .hgrc. As only changesets from the draft and public phase are shared, they would need to change the phase of those commits they plan to share prior to push. Accidential push of changesets added just for personal testing in other branches are thus easily avoided.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top