darcs

Issue 2336 edit in interactive darcs record breaks patches

Title edit in interactive darcs record breaks patches
Priority Status resolved
Milestone Resolved in
Superseder Nosy List mf
Assigned To
Topics

Created on 2013-07-29.10:03:35 by mf, last changed 2020-06-21.06:56:13 by bfrk.

Messages
msg16962 (view) Author: mf Date: 2013-07-29.10:03:34
hi there,

i thinks this is a bug.  hope i haven't missed it when checking for it
in the bug tracker.  i think it's low priority (see work-around
below).

i would love to fix it myself, too, but i'm in a little bit of a rush.

soo...  enjoy!  :-)
cheers,
matthias



to reproduce:

$ mkdir test
$ cd test
$ darcs init
$ echo -ne "eins\nzwei\ndrei\n" > wef.txt
$ darcs record -am wef
$ echo -ne "eins'\n" > wef.txt

there are two conceivably independent changes now: eins changed to
eins'; and zwei, drei went away.

$ darcs whatsnew
hunk ./test 1
-eins
-zwei
-drei
+eins'

i just want to record the latter.

$ darcs record
(type e)
(save this:)

| Interactive hunk edit:
|  - Edit the section marked 'AFTER'
|  - Arbitrary editing is supported
|  - This will only affect the patch, not your working copy
|  - Hints:
|    - To split added text, delete the part you want to postpone
|    - To split removed text, copy back the part you want to retain
| 
| ========================== BEFORE (reference) ==========================
| zwei
| drei
| ============================= AFTER (edit) =============================
| ============================= (edit above) =============================

then the command line sais this:

| Shall I record this change? (1/1)  [ynW...], or ? for more options: e
| hunk ./test 1
| -eins

this is where i disagree with darcs.  (-:

however, if i save this:

| Interactive hunk edit:
|  - Edit the section marked 'AFTER'
|  - Arbitrary editing is supported
|  - This will only affect the patch, not your working copy
|  - Hints:
|    - To split added text, delete the part you want to postpone
|    - To split removed text, copy back the part you want to retain
| 
| ========================== BEFORE (reference) ==========================
| eins
| zwei
| drei
| ============================= AFTER (edit) =============================
| eins
| ============================= (edit above) =============================

the command line sais this:

Shall I record this change? (1/1)  [ynW...], or ? for more options: e
hunk ./test 2
-zwei
-drei

(then if i go to edit the patch again, it's the one that breaks after
edit.)

yeay, i found a bug!  (-:

workaround: instead of removing the lines that have changed from the
"before" and the "after", leave them in the "before", and replace the
"before" in the "after" (as shown above).
msg22078 (view) Author: bfrk Date: 2020-06-21.06:56:10
Cannot reproduce any more
History
Date User Action Args
2013-07-29 10:03:35mfcreate
2020-06-21 06:56:13bfrksetstatus: unknown -> resolved
messages: + msg22078