假设一个 Mercurial 存储库foo
。此外,假设make
从那里运行的作业crontab
应该更新从修订版0
到tip
存储库中发生更改的所有内容的捆绑包。让我们假设GNUmakefile
它也是我们存储库工作目录的一部分foo
。
foo/.hg
我可以依赖哪个文件作为依赖项来决定是否运行hg bundle
?
我认为你可以做的比看更糟糕.hg/store/00changelog.i
。这包含存储库中变更集元数据的索引(对于非常小的存储库,它还包含相应的数据)。请注意,这并没有说明工作目录的内容!但是,如果您只想要一个完整的捆绑包,那应该没关系。
不过,这确实取决于.hg/requires
文件的内容。特别是,存储库至少需要该store
标志。
I suppose, direct working with files inside .hg
is not The Right Thing (tm)
If "...whenever something changes within the repository" you have new changeset(s), or old changeset-id may be changed (rewritten history?). In this case, output of native Mercurial commands will change and you can compare results of previous run and current and make choice
hg id -i
, for example, in commit-hook can write into (ignored) file in Working Directory of repository or in just some file, which you crontab-job check ater