Mercurial 本地存储库的完整状态

Full status of Mercurial local repository

我经常想知道项目的本地副本与远程存储库相比的完整状态。完整状态是指以下内容:

我知道我可以使用一些图形工具,例如 HgView 或 TortoiseHg,甚至我的 IDE 来处理 Mercurial 存储库,但我发现在处理多个 projects/repos 同时.

我目前的做法是使用别名

alias hg_full='hg incoming; hg outgoing; hg status'

如果一切正常(即本地与远程同步),我会确保在

之前处于默认状态
hg update default

这种方法非常有效,但是当我使用一个缓慢的远程存储库时,在执行更新之前等待传入和传出命令到 return 是非常烦人的。

是否有某种方法(通过扩展或更高级的命令)来获取本地副本与远程存储库相比的完整状态摘要,而无需依次执行 hg inhg out

您可以通过执行 hg incoming --bundle <filename> 来节省一些网络流量,这会获取传入的变更集并将它们存储在捆绑文件中。然后,您可以 运行 hg outgoing(或 hg pull)针对捆绑文件,它根本不使用网络。

hg incoming --bundle incoming.bundle   # Creates the bundle
hg outgoing incoming.bundle

hg pull incoming.bundle
hg update default

我认为 hg summary --remote 可能正是您要找的:

$ hg summary --remote
parent: 1:c15d3f90697a tip
 commit message here
branch: default
commit: 1 modified
update: (current)
remote: 1 or more incoming, 1 outgoing