How can I make “commit” abort if there are uncommitted subrepo changes in Mercurial?

StackOverflow https://stackoverflow.com/questions/10020047

  •  29-05-2021
  •  | 
  •  

Pregunta

This seems to happen all the time to me: I work on the parent repo. I find and fix a bug in a subrepo. I carry on with parent repo work. I commit the parent repo with a message like "Added feature X". I push.

At this point I notice that the subrepo bugfix got committed and pushed too, with a commit message that has absolutely nothing to do with the subrepo.

What’s the easiest way to make myself a "commit" replacement which would refuse to do anything in this situation, pointing out that a subrepo has uncommitted changes? Alternatively, perhaps there’s a setting I can put in my .hgrc?

¿Fue útil?

Solución

You have two options:

  1. Upgrade your Mercurial instalation to 2.0 or later
  2. Edit your ~/.hgrc file and add the following option to the [ui] section:

    commitsubrepos = false
    
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top