“hg outgoing”的本地版本?
该命令
hg outgoing
将本地存储库与默认推送位置进行比较;它访问推送位置来执行此操作。
我想问一个问题“自上次 hg 推送
以来,我是否已检查本地存储库中的更改?”无需访问远程仓库。
本地存储库中似乎有足够的信息来解决这个问题;如果是这样,是否有命令可以确定?
The command
hg outgoing
compares the local repo to the default push location; it accesses the push location to do it.
I'd like to ask the question "have I checked in changes in my local repo since my last hg push
?" without having to access the remote repo.
It seems like there might be enough info in the local repo to figure that out; if so, is there a command to determine that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有内置的方法可以做到这一点。跟踪已推送的内容会有点棘手,因为您可以推送到多个位置。您可以从多个地方拉取。因此,我可以推送到 X,然后推送到 Y,然后从 Z 拉出,而我的“hg 传出 X”输出很难仅在本地进行预测。
也就是说,您可以使用如下命令:
创建一个指向当前提示的仅本地标记。如果您总是在推送后运行它,您将始终知道上次推送的内容。
您可以在 .hgrc 中创建一个 post-push 挂钩来执行此操作:
There isn't a built-in way to do it. Tracking what has been pushed would be slightly tricky because you can push to multiple places. And you can pull from multiple places. So I could push to X then push to Y then pull from Z and my 'hg outgoing X' output is difficult to predict local-only.
That said you could use a command like this:
That creates a local-only tag pointing to the current tip. If you always run that after pushing you'll always know what was last pushed.
You could create a post-push hook to do that in your .hgrc: