首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么这个mercurial补丁不能移动文件?

为什么这个mercurial补丁不能移动文件?
EN

Stack Overflow用户
提问于 2019-04-16 02:01:50
回答 1查看 105关注 0票数 2

我已经使用TortoiseHG导出了一个将文件移动到另一个位置的补丁。这是补丁的内容:

代码语言:javascript
复制
# 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 ... 
+

这是补丁唯一能做的事情。它将文件InvariantTestsinvariants移动到unit

当我在tortoiseHG中导入补丁时,它给出以下错误

代码语言:javascript
复制
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错误是什么意思?为什么补丁不能简单地应用移动文件呢?

EN

回答 1

Stack Overflow用户

发布于 2019-04-16 19:55:25

Mercurial doc明确声明:

Mercurial用于显示文件两个版本之间更改的默认格式与GNU diff的统一格式兼容,GNU patch和许多其他标准工具都可以使用该格式。

虽然这种标准格式通常就足够了,但它没有对以下信息进行编码:

  • 可执行文件的状态和其他权限位
  • 复制或重命名二进制文件中的

创建或删除空文件

为了在补丁中包含此数据,您必须使用-git (AFAICR)选项创建git兼容补丁,该选项也可在THG中使用

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55694904

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档