gpt4 book ai didi

mercurial - 在 Mercurial 中 merge 两个补丁

转载 作者:行者123 更新时间:2023-12-04 17:21:18 24 4
gpt4 key购买 nike

我有两个补丁想在 Mercurial 中 merge 。可悲的是,我删除了导出这些补丁的分支。你们能建议一种 merge 这两个补丁的方法吗?

我在 ubuntu 12.04 机器上使用 Mercurial 2.0.2。

最佳答案

如果您启用了 MQ,并假设您从一个空的补丁队列开始:

> hg qimport patch1        # Import & apply the first patch into a patch queue
> hg qimport patch2 # Import & apply the second patch into a patch queue
> hg qpop; # Pop the second patch (unapply)
> hg qfold patch2 # Fold the second patch into the first (result is called 'patch1')
> hg qexport > new_merged_patch

然后您可以:

> hg qfinish -a            # Convert the currently applied patches (e.g. patch1) to changesets)

或:

> hg qpop                  # Pop the merged patch
> hg qdel patch1 # Delete it from the queue

老实说,为此使用 MQ 有点矫枉过正,但它是一个有用的扩展。

关于mercurial - 在 Mercurial 中 merge 两个补丁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13634291/

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