在分支中应用补丁 [英] Apply patches in branch

查看:70
本文介绍了在分支中应用补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了来自贡献者的补丁.显然,他在树干上产生了补丁.但是,我想将他的更改提交到新分支.我可以知道如何通过Tortoise-Hg做到这一点吗?

I receive a patches from a contributor. Apparently, he produces the patches in trunk. However, I would like to commit his changes to a new branch. May I know how I can do so through Tortoise-Hg?

推荐答案

以下说明假定您希望将补丁隔离在named branch上.

The directions found below assume you want the patches isolated on a named branch.

使用命令行,可以很容易地将补丁应用到新的命名分支.但是,如果只想使用TortoiseHg进行此操作,则必须在应用补丁之前使用空提交创建命名分支.

Using the command-line, it is easy to apply patches to a new named branch. However if you want to do this using TortoiseHg only, you must create the named branch with an empty commit prior to applying the patches.

hg branch <branch name>
hg qimport --push <patch-file-1>
hg qimport --push <patch-file-2>
hg qfinish --applied

使用TortoiseHg v1.1.x:

  1. 将补丁文件导入到补丁队列(不应用补丁文件).
  2. 使用空提交创建一个新的命名分支:
    • 打开提交对话框
    • 点击标有"branch: default"的按钮
    • 选择"Open a new named branch"
    • 在提供的文本框中输入您的分支机构名称
    • 单击OK按钮.
    • 输入提交消息(例如,从中为补丁创建分支"),然后单击"Commit".
  1. Import the patch files to your patch queue (without applying them).
  2. Create a new named branch using an empty commit:
    • Open a commit dialog
    • Click the button labeled "branch: default"
    • Select "Open a new named branch"
    • Enter your branch name in the provided text box
    • Click the OK button.
    • Enter a commit message (e.g. "Created branch for patches from ") and click "Commit".

使用TortoiseHg v2.0.x:

与TortoiseHg v1.1.x相同的过程将起作用.用空提交创建命名分支的过程稍有不同,但是总体概念是相同的.

Using TortoiseHg v2.0.x:

The same process used for TortoiseHg v1.1.x will work. The process to create the named branch with an empty commit is slightly different, but the overall concept is the same.

这篇关于在分支中应用补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆