【问题标题】:How do I drop a Mercurial bookmark with all its changesets?如何删除 Mercurial 书签及其所有变更集?
【发布时间】:2014-11-07 12:48:14
【问题描述】:

我在工作中使用 Git,因为 Git 是团队的选择。但是,对于我的个人项目,我更喜欢 Mercurial。 Git 和 Mercurial 分支模型不同已经不是什么秘密了,Mercurial 中的书签就像 Git 中的分支。我真的很喜欢 Git 分支,很少使用 Mercurial 分支,只是在我真正需要的时候,更喜欢 Mercurial 书签。但是,我错过了 Mercurial 中的 git branch -d 之类的内容,因为删除 Mercurial 中的书签只会删除书签并保留不可变的历史记录。是否可以将 Mercurial 中的书签及其所有变更集放到与书签不同的变更集中?

【问题讨论】:

    标签: mercurial branch


    【解决方案1】:

    一般:

    hg strip revisions_to_drop
    

    针对您的问题:

    hg strip 'not ancestors(heads(all()) - bookmark(name_of_bookmark))'
    

    (即“剥离除书签头之外不是头的祖先的所有修订”)

    假设 hg 的版本足够新:

    hg strip -B name_of_bookmark
    

    【讨论】:

    • 这太容易了,我看不到。谢谢! :)
    猜你喜欢
    • 2011-10-13
    • 1970-01-01
    • 1970-01-01
    • 2016-07-29
    • 1970-01-01
    • 2020-11-01
    • 2014-04-20
    • 1970-01-01
    • 2010-10-28
    相关资源
    最近更新 更多