0

假设一个 Mercurial 存储库foo。此外,假设make从那里运行的作业crontab应该更新从修订版0tip存储库中发生更改的所有内容的捆绑包。让我们假设GNUmakefile它也是我们存储库工作目录的一部分foo

foo/.hg我可以依赖哪个文件作为依赖项来决定是否运行hg bundle

4

2 回答 2

3

我认为你可以做的比看更糟糕.hg/store/00changelog.i。这包含存储库中变更集元数据的索引(对于非常小的存储库,它还包含相应的数据)。请注意,这并没有说明工作目录的内容!但是,如果您只想要一个完整的捆绑包,那应该没关系。

不过,这确实取决于.hg/requires文件的内容。特别是,存储库至少需要该store标志。

于 2013-03-19T13:22:38.473 回答
1

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

于 2013-03-19T13:57:26.543 回答