Some way of preventing "hg update" without arguments?

Andrew Halberstadt halbersa at gmail.com
Thu Apr 7 20:18:16 UTC 2016


You could make an arbitrarily complex hook that provides
instructions on what to do:

> [hooks]
> pre-update = bash -c "if [[ '$HG_PATS' == '[]' ]]; then echo 'Must specify argument to hg update'; exit 1; fi"

On 01/04/16 11:42 AM, Andrew Fischer wrote:
> We have a project with a workflow that uses bookmarks and multiple heads
> on the default branch for small feature development. I've had to bring
> several people up to speed who are not familiar with mercurial, and one
> problem keeps eating up my time:
>
> They pull new code and simply call "hg update". Which of course updates
> to tip and advances whatever bookmark they currently have active to that
> tip. Just as expected. But then I get a message because their bookmark
> is no longer on the local head they were working on and instead at tip.
> And what to do, etc. etc. I always have to explain "don't just 'hg
> update' after a pull. Look at what is new and update to the bookmark you
> want to use".
>
> I was wondering, is there some way I can use the .hgrc to simply not
> allow a bare "hg update" command with no arguments? It feels like it
> would be a quick short-term way to get people used to not simply
> updating to tip right away when they pull, forcing them to "hg update
> tip" if that really is desired or instead "hg update
> bookmarkYouReallyWant". I suppose this means I would have to stop "hg
> pull -u" as well.
>
> Thanks for any feedback!
> -Andrew
>
>
> --
> Andrew Fischer, PhD
> Apastron, Co
> 903 1st ST N Hopkins, MN
> 952-373-1024
>
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>





More information about the Mercurial mailing list