我和一个问这个问题的人有同样的问题:How to git commit nothing without an error? 基本上,我需要运行hgcommit,只有在我的存储库中有任何更改的情况下。我使用fabric运行提交,因此如果没有任何更改,它将输出一个严重的错误。在
local() encountered an error (return code 1) while executing 'hg commit...'
这是上述帖子的答案:
^{pr2}$它适用于git,但是我使用Merucrial。我不知道在Mercurial怎么做。在
从泰勒·艾夫斯(Tyler Eaves)在你的问题链接页面上的回答(不知道面料),你能做以下事情:
如果没有文件,就不会提交报告。它也不会报告是否有已提交的文件,这可能不是您想要的:)
因此,正如koopajah和Kent在评论中建议的那样,我可以使用}的输出来查看是否有任何更改。
Fabric允许我读取带有
hg status
或{capture=True
标志的输出。在很直接。在
相关问题 更多 >
编程相关推荐