开发者

How to apply .diff patch with Eclipse to HtmlUnit

I'm trying to patch HtmlUnit with the patches at the bottom of this page. I can see how to apply patches from Eclipse, but I can't figure out how to apply these particular patches. I had the JARs initially, but then I realised I'd need to source, so I obtained those, but still no luck.

In the patch I see:

--- a/htmlunit/src/main/java/com/gargoyles开发者_开发百科oftware/htmlunit/WebClient.java

and etc. but what is up with the 'a/htmlunit'? I have the packages and "src/main/java/com/gargoylesoftware/htmlunit/WebClient.java" (for example) is easily locatable, but not a/htmlunit. I can't really figure out how to apply this.

Can anyone help?


Usually, patches come with prefixes, kind of like putting the previous version in directory a, and the new version in directory b and just diffing them to produce the patch, only with version control systems, you don't really need to do that anymore. Most still do I suppose (at least git does by default).

Anyway, patch-tools have an option to skip a number of directory levels as prefix, in your case you'd have to skip two (a and htmlunit). Unfortunately, I don't know how this is done in eclipse, with vanilla unix patch you would need to add a -p2 parameter. Poke around the UI, it ought to be there somewhere.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜