darcs

Issue 1765 darcs recursive remove fails on root directory

Title darcs recursive remove fails on root directory
Priority bug Status resolved
Milestone 2.4.x Resolved in 2.4.x
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, tux_rocker, volothamp
Assigned To volothamp
Topics

Created on 2010-03-12.16:17:31 by volothamp, last changed 2010-06-16.14:40:25 by kowey.

Messages
msg10174 (view) Author: volothamp Date: 2010-03-12.16:17:27
Hello list.

darcs remove * -r fails if it's used in the root of the darcs 
repository.

c:\test>darcs remove * -r
Can't remove _darcs/format (it is not tracked by darcs)
Can't remove _darcs/hashed_inventory (it is not tracked by darcs)
Can't remove _darcs/index (it is not tracked by darcs)
Can't remove _darcs/index.old (it is not tracked by darcs)
Can't remove _darcs/lock (it is not tracked by darcs)
Can't remove _darcs/tentative_hashed_inventory (it is not tracked by 
darcs)
Can't remove _darcs/tentative_pristine (it is not tracked by darcs)
Can't remove _darcs/patches/pending (it is not tracked by darcs)
Can't remove _darcs/patches/pending.tentative (it is not tracked by 
darcs)
Can't remove _darcs/patches/pending_buggy (it is not tracked by darcs)
Can't remove _darcs/prefs/binaries (it is not tracked by darcs)
Can't remove _darcs/prefs/boring (it is not tracked by darcs)
Can't remove _darcs/prefs/motd (it is not tracked by darcs)
Can't remove 
_darcs/pristine.hashed/da39a3ee5e6b4b0d3255bfef95601890afd80709 (it is 
not tracked by darcs)
darcs: bug at src\Darcs\Repository\Internal.hs:339 compiled Mar  2 2010 
17:44:36
There was an attempt to write an invalid pending!
If possible, please send the contents of _darcs/patches/pending_buggy
along with a bug report.
See http://wiki.darcs.net/index.html/BugTrackerHowto for help on bug 
reporting.

It seems that it tries to remove all the files, even if they are not in 
the repository. I know it's the right behaviour, but apparently it fails 
with _darcs dir.

I'm using 

2.4 (release) under Windows Vista.

Bye,

L.M.
msg10184 (view) Author: kowey Date: 2010-03-14.18:16:45
Yuck! Could we have a test case for that, please, Luca?
http://wiki.darcs.net/Development/RegressionTests

Thanks!
msg10521 (view) Author: tux_rocker Date: 2010-03-25.20:03:34
This is now in progress and we already have a test case for it.
msg10581 (view) Author: tux_rocker Date: 2010-03-30.22:46:38
The following patch updated the status of issue1765 to be resolved:

* resolve issue1765: refuse to remove non-tracked directories recursively 
Ignore-this: ee68c106b9320035e66563387c82d1de

The modifyTree function from hashed-storage makes any directories on the path
to modify exist. When removing a non-tracked file, this made darcs assume that
its parent directory was tracked, even when it wasn't.

This patch makes darcs do the modifyTree only when the remove of a file
actually succeeded, so that when a remove of a non-tracked file fails, darcs
won't have a data structure that reflects a world where this removal succeeded.
msg11437 (view) Author: tux_rocker Date: 2010-06-15.22:25:54
The following patch updated issue issue1765 with resolvedin=2.5.0 (current)

* resolve issue1765: refuse to remove non-tracked directories recursively 
Ignore-this: ee68c106b9320035e66563387c82d1de

The modifyTree function from hashed-storage makes any directories on the path
to modify exist. When removing a non-tracked file, this made darcs assume that
its parent directory was tracked, even when it wasn't.

This patch makes darcs do the modifyTree only when the remove of a file
actually succeeded, so that when a remove of a non-tracked file fails, darcs
won't have a data structure that reflects a world where this removal succeeded.
History
Date User Action Args
2010-03-12 16:17:31volothampcreate
2010-03-14 18:16:48koweysetstatus: unknown -> needs-reproduction
nosy: + kowey
messages: + msg10184
assignedto: volothamp
2010-03-25 20:03:34tux_rockersetstatus: needs-reproduction -> has-patch
nosy: + tux_rocker
messages: + msg10521
2010-03-30 22:46:40tux_rockersetstatus: has-patch -> resolved
messages: + msg10581
2010-06-15 21:31:20adminsetmilestone: 2.4.x
2010-06-15 21:31:20adminsettopic: - Target-2.4
2010-06-15 22:25:54tux_rockersetstatus: resolved -> unknown
messages: + msg11437
resolvedin: 2.5.0
2010-06-15 22:27:33koweysetstatus: unknown -> resolved
2010-06-16 14:40:25koweysetresolvedin: 2.5.0 -> 2.4.x