我已经使用TortoiseHG导出了一个将文件移动到另一个位置的补丁。这是补丁的内容:
# HG changeset patch
# User Arthur Attout <arthur.attout@outlook.com>
# Date 1551095974 -3600
# Mon Feb 25 12:59:34 2019 +0100
# Branch CBLS
# Node ID f73e7c88dbcf6de3091e1edc9360336d1c699038
# Parent 863386a2a66de9cdd6d8885912988cb4b862eef0
Unit tests + migrate unit tests int -> long
diff -r 863386a2a66d -r f73e7c88dbcf oscar-cbls/src/test/scala/oscar/cbls/test/invariants/InvariantTests.scala
--- a/oscar-cbls/src/test/scala/oscar/cbls/test/invariants/InvariantTests.scala Fri Feb 22 14:30:14 2019 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,948 +0,0 @@
-package oscar.cbls.test.invariants
-
- Thousands of lines ...
-
diff -r 863386a2a66d -r f73e7c88dbcf oscar-cbls/src/test/scala/oscar/cbls/test/unit/InvariantTests.scala
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/oscar-cbls/src/test/scala/oscar/cbls/test/unit/InvariantTests.scala Mon Feb 25 12:59:34 2019 +0100
@@ -0,0 +1,877 @@
+package oscar.cbls.test.unit
+ Same thousands of lines ...
+这是补丁唯一能做的事情。它将文件InvariantTests从invariants移动到unit。
当我在tortoiseHG中导入补丁时,它给出以下错误
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file oscar-cbls/src/test/scala/oscar/cbls/test/invariants/InvariantTests.scala.rej
patching file oscar-cbls/src/test/scala/oscar/cbls/test/unit/InvariantTests.scala
adding oscar-cbls/src/test/scala/oscar/cbls/test/unit/InvariantTests.scala
abandon : patch failed to apply
[command returned code 255 Mon Apr 15 19:55:02 2019]在那之后,这是我的工作目录的内容

文件不会被移动。
这个255错误是什么意思?为什么补丁不能简单地应用移动文件呢?
发布于 2019-04-16 19:55:25
Mercurial doc明确声明:
Mercurial用于显示文件两个版本之间更改的默认格式与GNU diff的统一格式兼容,GNU patch和许多其他标准工具都可以使用该格式。
虽然这种标准格式通常就足够了,但它没有对以下信息进行编码:
创建或删除空文件
为了在补丁中包含此数据,您必须使用-git (AFAICR)选项创建git兼容补丁,该选项也可在THG中使用
https://stackoverflow.com/questions/55694904
复制相似问题