如何使用 Eclipse 将 .diff 补丁应用到 HtmlUnit

发布于 2024-09-10 23:07:44 字数 534 浏览 5 评论 0原文

我正在尝试使用 页面。我可以看到如何从 Eclipse 应用补丁,但我不知道如何应用这些特定补丁。我最初有 JAR,但后来我意识到我需要采购,所以我获得了这些,但仍然没有运气。

在补丁中我看到:

--- a/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java

等等,但是“a/htmlunit”怎么了?我有这些包,并且“src/main/java/com/gargoylesoftware/htmlunit/WebClient.java”(例如)很容易找到,但不是 a/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/gargoylesoftware/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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水染的天色ゝ 2024-09-17 23:07:44

通常,补丁带有前缀,有点像将以前的版本放在目录 a 中,将新版本放在目录 b 中,然后对它们进行比较以生成补丁,只需使用版本控制系统,你真的不需要再这样做了。我想大多数仍然是这样(至少 git 默认情况下是这样)。

无论如何,补丁工具可以选择跳过多个目录级别作为前缀,在您的情况下,您必须跳过两个目录级别(a 和 htmlunit)。不幸的是,我不知道这是如何在 Eclipse 中完成的,使用 vanilla unix patch 你需要添加一个 -p2 参数。浏览一下 UI,它应该在某个地方。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文