创建和应用修补程序 (Subversion)
另请参见
通过使用修补程序文件,未共享共用资源库的软件开发者可以分发和集成对代码所做的更改。在 IDE 中,可以创建和应用更新源文件副本的修补程序,从而不必手动合并这些更改。
创建修补程序文件:
- Select a versioned file (e.g., in the Projects, Files, or Favorites window) for which you want to create a patch.
- Choose Team > (Subversion >) Export Diff Patch from the main menu. 将打开“导出比较修补程序”对话框。
- 选择以下任意一个选项:
- Save to File. When selected, enter a name for the patch file and specify the location where you want to save the patch.
- Attach to Issue. When selected, select the issue tracker and specify an issue ID and description. The patch file is added as an attachment to the specified issue.
- 单击“确定”。A patch file is created containing the differences between the source file versions.
- 请注意,“导出比较修补程序”命令仅适用包含尚未合并的本地或远程更改的文件和文件夹。
将修补程序应用于本地文件或文件夹中:
- Select a versioned file or folder (e.g., in the Projects, Files, or Favorites window) on which you want to apply the patch.
- Choose Team > (Subversion >) Apply Diff Patch from the main menu. 将显示“应用比较修补程序”对话框。
- 在该对话框中,键入要应用的修补程序文件的路径,或导航至该文件。
- 单击“修补程序”。将为选定的文件应用修补程序并打开一个对话框,确认已成功应用修补程序。单击“是”以在 IDE 的比较查看器中查看更改。
注意:
- 由于文件夹修补程序使用的是其所包含文件的相对路径,因此,必须在创建修补程序所在的文件夹节点上应用文件夹修补程序,这样才能确保正确应用修补程序。
- 如果不确定应该对哪个文件或目录应用修补程序,可以在修补程序文件本身中查找上下文信息。IDE 生成的修补程序文件包含最初在文件的前几行中创建修补程序时所在的上下文。
- 另请参见
- 在 Subversion 中比较文件修订
- 在 Subversion 中合并文件修订
- 解决 Subversion 中的合并冲突
法律声明