2

我正在开发一个处于颠覆状态的项目,但在我设法提交最新更改之前,它被迁移到了 git。我使用 TortoiseSVN 创建了一个补丁文件,但现在我不知道如何应用它。我尝试使用git apply但没有用:

C:\Users\ga1009\Documents\quantlib>git apply ..\dev\Oasis\CatBond_QuantLib_wXL.p
atch
..\dev\Oasis\CatBond_QuantLib_wXL.patch:6: trailing whitespace.
/* This file is automatically generated; do not edit.     */
..\dev\Oasis\CatBond_QuantLib_wXL.patch:7: trailing whitespace.
/* Add the files to be included into Makefile.am instead. */
..\dev\Oasis\CatBond_QuantLib_wXL.patch:8: trailing whitespace.

..\dev\Oasis\CatBond_QuantLib_wXL.patch:9: trailing whitespace.
#include <ql/experimental/catbonds/catbond.hpp>
..\dev\Oasis\CatBond_QuantLib_wXL.patch:10: trailing whitespace.
#include <ql/experimental/catbonds/catrisk.hpp>
error: QuantLib_vc10.vcxproj: No such file or directory
error: QuantLib_vc10.vcxproj.filters: No such file or directory
error: test-suite/quantlibtestsuite.cpp: No such file or directory
error: test-suite/testsuite_vc10.vcxproj: No such file or directory
error: test-suite/testsuite_vc10.vcxproj.filters: No such file or directory
error: gensrc/config/categories.xml: No such file or directory
error: gensrc/metadata/types/types.xml: No such file or directory
error: QuantLibObjects_vc10.vcxproj: No such file or directory
error: QuantLibObjects_vc10.vcxproj.filters: No such file or directory
error: qlxl/QuantLibXLStatic_vc10.vcxproj: No such file or directory
error: qlxl/QuantLibXLStatic_vc10.vcxproj.filters: No such file or directory

这些错误有点奇怪,因为所有这些文件都应该以另一个目录为前缀,例如来自补丁文件:

--- QuantLib/QuantLib_vc10.vcxproj  (revision 18468)
+++ QuantLib/QuantLib_vc10.vcxproj  (working copy)

我也尝试按照https://stackoverflow.com/a/5415912/5363中的建议使用 TortoiseMerge ,但是这个工具抱怨目标文件夹不是存储库(它显然不是 svn 存储库)

编辑:patch.exe来自 gnuwin32 项目抱怨相同的文件。补丁文件在某种程度上是错误的吗?第一个有错误的文件的条目是:

Index: QuantLib/QuantLib_vc10.vcxproj
===================================================================
--- QuantLib/QuantLib_vc10.vcxproj  (revision 18468)
+++ QuantLib/QuantLib_vc10.vcxproj  (working copy)
@@ -250,6 +250,11 @@
   <ItemGroup>
     <ClInclude Include="ql\cashflows\cpicoupon.hpp" />
     <ClInclude Include="ql\cashflows\cpicouponpricer.hpp" />
+    <ClInclude Include="ql\experimental\catbonds\all.hpp" />
+    <ClInclude Include="ql\experimental\catbonds\catbond.hpp" />
+    <ClInclude Include="ql\experimental\catbonds\catrisk.hpp" />
+    <ClInclude Include="ql\experimental\catbonds\montecarlocatbondengine.hpp" />
+    <ClInclude Include="ql\experimental\catbonds\riskynotional.hpp" />
     <ClInclude Include="ql\experimental\finitedifferences\dynprogvppintrinsicvalueengine.hpp" />
     <ClInclude Include="ql\experimental\finitedifferences\fdextoujumpvanillaengine.hpp" />
     <ClInclude Include="ql\experimental\finitedifferences\fdklugeextouspreadengine.hpp" />
@@ -1375,6 +1380,10 @@
   <ItemGroup>
     <ClCompile Include="ql\cashflows\cpicoupon.cpp" />
     <ClCompile Include="ql\cashflows\cpicouponpricer.cpp" />
+    <ClCompile Include="ql\experimental\catbonds\catbond.cpp" />
+    <ClCompile Include="ql\experimental\catbonds\catrisk.cpp" />
+    <ClCompile Include="ql\experimental\catbonds\montecarlocatbondengine.cpp" />
+    <ClCompile Include="ql\experimental\catbonds\riskynotional.cpp" />
     <ClCompile Include="ql\experimental\finitedifferences\dynprogvppintrinsicvalueengine.cpp" />
     <ClCompile Include="ql\experimental\finitedifferences\fdextoujumpvanillaengine.cpp" />
     <ClCompile Include="ql\experimental\finitedifferences\fdklugeextouspreadengine.cpp" />
4

1 回答 1

1

您可以尝试使用 git-svn 将您的 svn 存储库重新转换为 git。一旦它在 git 中,您可以将远程添加到现有存储库,然后从“忘记提交”分支中挑选有问题的提交到常规分支。然后只是推。

或者,采用真正的低技术,只需使用差异/合并工具将文件更改从一个文件夹复制到另一个文件夹。

于 2013-06-08T05:31:11.450 回答