darcs

Issue 2052 switch to unified diff by default

Title switch to unified diff by default
Priority feature Status resolved
Milestone Resolved in 2.8.0
Superseder Nosy List jaredj, owst
Assigned To owst
Topics ProbablyEasy

Created on 2011-03-24.17:19:40 by owst, last changed 2011-05-26.13:01:32 by noreply.

Messages
msg13829 (view) Author: owst Date: 2011-03-24.17:19:38
By default, darcs creates a "normal" formatted diff. This format cannot
handle multiple files per patch. 
The following test case outlines the problem:

darcs init
touch a && touch b
darcs add a b
darcs record -a -m 'add a and b'

echo "test a" > a
echo "test b" > b
darcs diff > addlines.patch

darcs revert -a
patch -s a < addlines.patch
cat a

Say we weren't careful, and didn't notice that b had been changed; when
we apply the patch, we might clobber the intended contents of a (in this
case, a receives the changes from a and b).

Using a unified format diff, (and removing the filename from the `patch`
invocation) works as expected.
msg13901 (view) Author: kowey Date: 2011-04-06.10:07:43
How about taking this one on, Owen?
msg14464 (view) Author: noreply Date: 2011-05-26.13:01:32
The following patch sent by Owen Stephens <darcs@owenstephens.co.uk> updated issue issue2052 with
status=resolved;resolvedin=2.8.0 HEAD

* resolve issue2052: Implicitly use unified diff, unless told not to. 
Ignore-this: 311b3f81f0d3478c5099e05986ac15c2
History
Date User Action Args
2011-03-24 17:19:40owstcreate
2011-04-06 10:07:44koweysetstatus: unknown -> needs-implementation
priority: feature
title: Darcs diff with multiple changed files creates broken normal diff -> switch to unified diff by default
nosy: + jaredj
messages: + msg13901
topic: + ProbablyEasy
assignedto: owst
2011-05-26 13:01:32noreplysetstatus: needs-implementation -> resolved
messages: + msg14464
resolvedin: 2.8.0