hg status vs. commit

Steve Losh steve at stevelosh.com
Mon Aug 16 15:29:13 UTC 2010


On Aug 16, 2010, at 11:21 AM, Alpar Juttner wrote:

> Hi,
> 
> I would like to believe if 'hg status' says nothing, then 'hg commit'
> will do nothing, as well. Unfortunately, it is not always the case.
> 
>        $ hg status     #Says nothing
>        $ hg ci -m 'X'  #Doesn't commit anything
>        nothing changed
>        $ hg branch t
>        marked working directory as branch t
>        $ hg status     #Says nothing
>        $ hg ci -m 'X'  #Does create a chgset
>        $ hg status
>        $ hg ci -m 'X'
>        nothing changed
> 
> Is this considered a bug?

No, 'hg status' is used to "show changed files in the working directory", according to its help.  You haven't changed a file in the working directory, so 'hg status' shows nothing.

You might be interested in the 'hg summary' command.  Specifically the "commit:" line in summary's output, which will show you what would happen if you committed.  In your example you would see "commit: (new branch)" after you make the new branch and "commit: (clean)" if committing would truly do nothing.

> 
> Regards,
> Alpar
> 
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial




More information about the Mercurial mailing list