Mercurial 2.1:在没有更改的情况下,如何使用拉/传入而不获取返回码 1?
在 Mercurial 2.1 中,当没有更改时,拉取和传入命令现在返回代码 1。那么现在是否有一个替代命令可以在命令行上执行类似下一个的操作?
hg pull && echo "No changes, carry on."
举个例子:checkoutmanager 现在抱怨更新 Mercurial Checkout 时出了问题,而实际上根本没有任何变化: https://bitbucket.org/reinout/checkoutmanager/issue/17
请参阅 Mercurial 2.1 发行说明,其中提到了拉取(但没有用于传入)。 https://www.mercurial-scm.org/wiki/ UpgradeNotes#A2.1:_phases.2C_various_minor_changes
In mercurial 2.1, the pull and incoming commands now have return code 1 when there are no changes. So is there now an alternative command with which I can on the command line do something like the next?
hg pull && echo "No changes, carry on."
Case in point: checkoutmanager now complains that something went wrong when updating a mercurial checkout, when in reality there were simply no changes: https://bitbucket.org/reinout/checkoutmanager/issue/17
See the mercurial 2.1 release notes, that mention this for pull (but not for incoming).
https://www.mercurial-scm.org/wiki/UpgradeNotes#A2.1:_phases.2C_various_minor_changes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
返回代码更改将在下一个次要版本中恢复。
请参阅:https://www.mercurial-scm。 org/pipermail/mercurial-devel/2012-February/037986.html
That return code change will be reverted for the next minor release.
See: https://www.mercurial-scm.org/pipermail/mercurial-devel/2012-February/037986.html
您可以执行
hg传入
,如果返回码为1,您就知道没有任何变化。pull
的问题在于,当它返回 1 作为返回码时,这意味着“没有更改”或“未解析的文件”,而incoming
则不是这种情况,当您如果返回码为 1,您可以放心地说没有任何变化。在伪代码中,它会给出类似这样的内容:
You can do a
hg incoming
and if the return code is 1 you know there's no change.The problem with
pull
is that when it returns 1 as returncode, it means either "no changes" or "unresolved files", this is not the case withincoming
, when you have a returncode of 1 you can safely say that there's no change.In pseudo code, it will give something like this :