darcs

Issue 2104 attempt to write an invalid pending!" on "mark-conflicts

Title attempt to write an invalid pending!" on "mark-conflicts
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List dukedave
Assigned To
Topics ThePendingPatch

Created on 2011-11-15.17:42:07 by dukedave, last changed 2021-01-30.14:16:02 by bfrk.

Messages
msg14808 (view) Author: dukedave Date: 2011-11-15.17:42:06
The following sequence results in darcs 2.5.2 reporting that there is
a bug, confirmed by myself and wferi in #darcs:
1. Create repo foo;
2. Create a non-empty file in foo and record it;
3. Clone foo to bar;
4. Remove the file in foo and record it;
5. Add another line to the file in bar and record it;
6. Pull from foo into bar, obtain conflict notification;
7. Note that executing mark-conflicts causes a crash.

Full reproduction given here:

$ 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

bar$ darcs mark-conflicts
This will trash any unrecorded changes in the working directory.
Are you sure?  [yn]y
darcs: bug at src/Darcs/Repository/Internal.hs:319 compiled Jun 25 2011 09:28:23
There was an attempt to write an invalid pending! user error (No such
file AnchoredPath [Name "shopping"])
If possible, please send the contents of _darcs/patches/pending_buggy
along with a bug report.
See http://wiki.darcs.net/BugTracker/Reporting for help on bug reporting.
msg16642 (view) Author: kowey Date: 2013-02-16.15:02:33
Sounds bad, don't know how urgent/realistic but conservatively marking 
for 2.10 until we've had a chance to look properly.

Next step is for somebody to turn Dave's thing into a test case 
http://darcs.net/Development/RegressionTests which anybody can do
msg22632 (view) Author: bfrk Date: 2021-01-30.14:15:57
This was resolved by fixing the code that updates the pending patch 
after record/amend. It is also no longer reproducible in this way 
because we no longer generate (bogus) conflict markup when there are 
prims other than hunks involved.
History
Date User Action Args
2011-11-15 17:42:07dukedavecreate
2013-02-16 15:02:35koweysetpriority: bug
status: unknown -> needs-testcase
topic: + ThePendingPatch
messages: + msg16642
milestone: 2.10.0
2021-01-30 14:16:02bfrksetstatus: needs-testcase -> resolved
messages: + msg22632
milestone: 2.10.0 ->