gpt4 book ai didi

mercurial - 列出 Mercurial 中的远程分支

转载 作者:行者123 更新时间:2023-12-02 21:58:35 25 4
gpt4 key购买 nike

有没有办法像 Git 一样在 Mercurial 中列出远程分支?

git branch -r

我想列出远程计算机(例如 Bitbucket)上的分支,因此使用:

hg branches -R `hg showconfig paths.default` --color false

失败并中止:存储库不是本地的

最佳答案

mercurial API 允许这样做:

from mercurial import ui, hg, node

peer = hg.peer(ui.ui(), {}, 'http://hg.python.org/cpython')
for name, rev in peer.branchmap().items():
print(name, node.short(rev[0]))

上面的代码片段产生:

default aaa68dce117e
legacy-trunk b77918288f7d
3.2 4787b9b2f860
3.0 4cd9f5e89061
3.1 5a6fa1b8767f
2.3 364638d6434d
2.2 61b0263d6881
2.1 e849d484029f
2.0 5fd74354d73b
2.7 260f3ad7af4b
2.6 f130ce67387d
2.5 b48e1b48e670
2.4 ceec209b26d4

关于mercurial - 列出 Mercurial 中的远程分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4296636/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com