If you issue the hg identify --id
, it will be the suffix of the identifier with the +
symbol when files are changed in the repository. (Note: this flag does not indicate unplayable files.)
If you select the result of this command for the +
symbol, you can use the exit status to determine if there are any changes or not:
$ hg init $ hg identify --id | grep --quiet + ; echo $? 1 $ touch a $ hg identify --id | grep --quiet + ; echo $? 1 $ hg add a $ hg identify --id | grep --quiet + ; echo $? 0
source share