当基于补丁的工作流程失败导致您的存储库中出现 .rej 块时,是否有任何补丁工具可以与 Mercurial 配合良好

发布于 2024-12-12 19:26:28 字数 1312 浏览 2 评论 0原文

我正在寻找一个比 Mercurial 内置的补丁工具更好的补丁工具,或者一个可视化工具来帮助我编辑补丁,以便它们被 Mercurial 或 Gnu 补丁接受。

Mercurial wiki 有一个主题 HandlingRejects,它显示了修补失败是多么简单。我希望为功能分支版本控制实现一个基于 Mercurial 的工作流程,该工作流程基于功能分支,并依赖于在集成之前导出和审查补丁。在我对这个想法的初步测试中,我的“补丁”和“审查、接受和修改”补丁中最薄弱的环节是补丁拒绝使我关闭的方式。

以下是一些 Mercurial 补丁导入失败的常见情况:

对上游 repoA 和功能分支 repoB 进行细微更改,其中在两个分支上的某处添加了一行。由于两个分支都有历史记录,因此合并工具应该可以看到“有人在 repoA 中添加了一行,而其他人在 repoB 中添加了一行”。但是,在补丁导入的情况下,这会导致补丁导入被拒绝,并且您的存储库中会出现一个 .rej 文件,您必须手动修复该文件(通过编辑 .rej 文件直到可以应用它)。

上面的 wiki 页面提到了 mpatch 工具,可以在此处找到。我正在寻找其他更好的合并工具,它们(a)与 Mercurial 一起使用,并且(b)可以处理上面处理拒绝 wiki 页面中提到的小情况。请注意,mpatch 不适用于我的目的,似乎我需要的东西更像是一个变基工具而不是修补工具,就我而言,我可能必须使修补工具具有语法意识(因此特定于单一编程语言)。

我正在寻找可在 Windows 上工作的工具,无论是本机的还是通过 cygwin 之类的工具。尽管我对 Linux/Unix 风格的工具很满意,但我没有使用 Unix/Linux 环境。

我目前没有使用 mq 扩展,只是使用 hg export 导出更改范围,并使用 hg import 进行导入,其余的工作是我自己的发明,但是我已经标记了这个 mq,因为 mq 用户会熟悉这个 .rej 处理问题。

相关问题此处显示了解决此类问题的方法使用 TortoiseHg 时出现的问题。

I am looking for a better patch tool than the ones built into Mercurial, or a visual tool to help me edit patches so that they will get accepted into Mercurial or Gnu patch.

The mercurial wiki has a topic HandlingRejects which shows how simple it is to have Patching fail. I am looking to implement a mercurial based workflow for feature branch version control that is based on feature branches, and relies on exporting and reviewing patches before they are integrated. In my initial testing of this idea, the weakest link in my "patch out", and "review and accept and modify" patches is the way that patch rejection shuts me down.

Here are some common cases where mercurial patch imports fail on me:

Trivial changes to both upstream repoA and feature branch repoB, where a single line is added somewhere, on both branches. Since both branches have a history, it should be possible for a merge tool to see that "someone added one line in repoA, and someone else added one line in repoB". In the case of patch imports, though, this results in a patch import reject and a .rej file turd in your repository which you ahve to manually repair (by editing the .rej file until it can be applied).

The wiki page above mentions the mpatch tool that is found here. I am looking for other Better Merge Tools that (a) work with mercurial, and (b) can handle the trivial case noted in the Handling Rejects wiki page above. Note that mpatch does not work for my purposes, it seems I need something that is more of a rebase tool than a patch tool, and in my case, I may have to make the patch tool be syntax-aware (and thus specific to a single programming language).

I am looking for tools available for working on Windows, either natively, or even via something like cygwin. I am not using a Unix/Linux environment, although I am comfortable with Linux/Unix style tools.

I am not currently using the mq extensions, just exporting ranges of changes using hg export, and importing using hg import, and the rest of the work is my own inventions, however I have tagged this mq, as mq users will be familiar with this .rej handling problem.

Related question here shows ways of resolving such problems while using TortoiseHg.

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

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

发布评论

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

评论(1

绻影浮沉 2024-12-19 19:26:28

Emacs 非常有能力处理 .rej 文件。

但是,如果可行的话,我会尽可能使用 hg pull --rebase 。我经常发现自己想要将某些补丁谱系重新设置到我已经拉取的另一个变更集上。在这些情况下,我只需剥离更改集并再次从 .hg/strip-backup 中提取它,从而允许我使用 --rebase

Emacs is quite capable of handling .rej files.

However, if at all practical, I try to use hg pull --rebase whenever possible. Often I find myself wanting to rebase some lineage of patches onto another changeset that I've already pulled. In these cases I just strip the changeset and pull it in again from .hg/strip-backup, allowing me to use --rebase.

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