Issue 2479 BUG: Error descending in modifyTree

Title BUG: Error descending in modifyTree
Priority Status resolved
Milestone Resolved in 2.12.0
Superseder Nosy List pierre-etienne.meunier
Assigned To

Created on 2015-11-20.06:46:54 by pierre-etienne.meunier, last changed 2016-03-09.13:55:01 by noreply.

msg18852 (view) Author: pierre-etienne.meunier Date: 2015-11-20.06:46:51
I'm having trouble restructuring my repository. Here is a minimal example with darcs 2.10.1 on debian (the problem happens both in a ramfs and on an EXT4 fs).

My intention was to create a new directory called "a" and move all recorded files to that directory, so that after the following set of commands, I was expecting to get exactly one recorded file a/b.

$ mkdir d
$ cd d
$ darcs init
Repository initialized.
$ echo "test" > b
$ darcs add b
Adding 'b'
$ darcs record -a
Finished recording patch '+b'
$ mkdir a
$ darcs mv $(darcs list files) a
darcs: BUG: Error descending in modifyTree, path = AnchoredPath []
msg18853 (view) Author: ganesh Date: 2015-11-20.07:10:09
From a bit of experimenting, the problem comes from the inclusion of the '.' folder in the 
list of things to move. If you try `darcs mv . a` you get a proper error:

    darcs-ghc710:[ganesh@paxton:~/temp/d]$ darcs mv . ./b

    darcs failed:  Cannot move the root of the repository

I'm not sure that `$(darcs list files)` is the right thing to do here anyway. You only need 
to move the top-level items to `a`. Everything else would be moved implicitly anyway.

Unfortunately `darcs mv * a` doesn't work either because it tries to move `a`, so I can't 
think of a clean way to do what you want.

In any case the actual error you're getting is clearly a bug we should fix to produce the 
error message about not being able to move the root.

I guess darcs could also filter out the invalid things being requested and just move the 
valid things. That might be a bit harder to implement.
msg19066 (view) Author: noreply Date: 2016-03-09.13:55:00
The following patch sent by Ben Franksen <benjamin.franksen@helmholtz-berlin.de> updated issue issue2479 with
status=resolved;resolvedin=2.12.0 HEAD

* resolve issue2479: root dir most not be among the sources of a move 
Ignore-this: efafaf60a83ec07463e25fc8a0f04cde

This check was only present in the 2-argument case.
Date User Action Args
2015-11-20 06:46:54pierre-etienne.meuniercreate
2015-11-20 07:10:11ganeshsetstatus: unknown -> needs-diagnosis/design
messages: + msg18853
2016-03-06 20:28:16bfrksetstatus: needs-diagnosis/design -> needs-implementation
2016-03-09 13:55:01noreplysetstatus: needs-implementation -> resolved
messages: + msg19066
resolvedin: 2.12.0