【问题标题】:Mercurial show number of commits ahead of "origin"Mercurial 显示“原点”之前的提交数
【发布时间】:2011-06-28 08:12:31
【问题描述】:

我在这里用 git 术语思考......是否有可能看到你在原点之前做了多少本地提交?和 git 一样,如果你输入 git status 它会告诉你

Your branch is ahead of blah by blah blah

Mercurial 中有类似的东西吗?我知道有 hg 传出,但我不希望有一个命令到达服务器,因为我想将输出放在我的提示符中(如常用的 bashrc 函数num_git_commits_ahead)

【问题讨论】:

    标签: bash mercurial


    【解决方案1】:

    我认为hg summary --remote 会给你你想要的,但它也会给你一些额外的东西。

    【讨论】:

    • 谢谢,我没有意识到 hg summary 做了它所做的事情。应该有rtfmd。我通过这样做实现了计数:
    • 无法在上面编辑:谢谢,我没有意识到 hg summary 做了它所做的事情。应该有rtfmd。我通过这样做实现了计数: num=$(hg summary | grep "update:" | wc -l | sed -e 's/^ *//') 。 sed就是去掉wc出来的前导空格。
    • 其实 hg summary --remote 确实更接近我想要的,而且由于没有联系服务器就无法找到我要查找的内容,所以这确实不可能在 bash 提示符中使用当前版本的 mercurial。
    猜你喜欢
    • 1970-01-01
    • 2013-09-29
    • 1970-01-01
    • 2012-05-09
    • 2011-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-02
    相关资源
    最近更新 更多