我的困惑源于从此处获取的以下声明:
当拉取相互冲突的补丁(例如,更改文件的相同部分)时,Darcs 会检测到冲突并将其标记在存储库内容中。然后它让用户解决问题。
这似乎与我所看到的不一致,因此我使用 darcs 2.5.2 创建了以下工作流程:
- 创建回购 foo;
- 在 foo 中创建一个非空文件并记录下来;
- 将 foo 克隆到 bar;
- 删除foo中的文件并记录;
- 在bar中的文件中添加另一行并记录它;
- 从 foo 拉入 bar,获取冲突通知;
采取这些步骤后,我darcs whatsnew
在 bar 中运行,并显示了两个“补丁原语”:
- 删除所有“foo 中的非空文件”的大块头,但没有提及在 bar 中添加和记录的行;
- 删除文件的 rmfile。
我的问题是:为什么没有提及添加并记录在栏中的行?
如果我darcs revert
在 bar 中运行,那么一切都是有道理的:我看到“非空文件”受到两个冲突补丁的影响,根据从这里获取的语句:
命令 darcs revert 将删除冲突标记并恢复到冲突补丁之前的状态。
但是,如果我运行darcs mark-conflicts
,我会回到与拉动后相同的状态,使用上面提到的两个“补丁原语”,并且没有提及添加并记录在 bar.xml 中的行。
供参考/复制这里是我从命令行的完整工作流程:
$ mkdir foo
$ cd foo/
foo$ darcs initialize
foo$ touch shopping
foo$ vi shopping <-- add a couple of lines
foo$ darcs add shopping
foo$ darcs record
addfile ./shopping
Shall I record this change? (1/2) [ynW...], or ? for more options: y
hunk ./shopping 1
+cake
+pie
Shall I record this change? (2/2) [ynW...], or ? for more options: y
What is the patch name? Added shopping
Do you want to add a long comment? [yn]n
Finished recording patch 'Added shopping'
foo$ cd ..
$ darcs get foo/ bar
$ cd bar/
bar$ vi shopping <-- add another line
bar$ darcs record
hunk ./shopping 2
+beer
Shall I record this change? (1/1) [ynW...], or ? for more options: y
What is the patch name? Added beer
Do you want to add a long comment? [yn]n
Finished recording patch 'Added beer'
bar$ cd ../foo
foo$ rm shopping
foo$ darcs record
hunk ./shopping 1
-cake
-pie
Shall I record this change? (1/2) [ynW...], or ? for more options: y
rmfile ./shopping
Shall I record this change? (2/2) [ynW...], or ? for more options: y
What is the patch name? Removed shopping
Do you want to add a long comment? [yn]n
Finished recording patch 'Removed shopping'
foo$ cd ../bar
bar$ darcs pull
Pulling from "../foo"...
Mon Nov 14 19:26:44 GMT 2011 dukedave@gmail.com
* Removed shopping
Shall I pull this patch? (1/1) [ynW...], or ? for more options: y
Backing up ./shopping(-darcs-backup0)
We have conflicts in the following files:
./shopping
Finished pulling and applying.
bar$ darcs whatsnew
hunk ./shopping 1
-cake
-pie
rmfile ./shopping