[darcs-users] Need for a new option on "mv"
droundy at abridgegame.org
Thu May 27 11:29:57 UTC 2004
On Thu, May 27, 2004 at 12:56:54AM +0200, Lele Gaifax wrote:
> Planning my svn->darcs sync tool, I discovered the need for a rather
> simple new option to "mv", or slightly different behaviour: "mv" should
> either grows a new "--already-done" option or behave just like "remove"
> that silently accept that the file is already gone. Instead, it fails
> with "file or dir XXX does not exist".
> What do you think?
I've implemented the behavior-change suggestion. mv now should happily
deal with the case where you already renamed the file. It will still fail
if you have since created a new file with the original name, so that still
could cause trouble with your conversion script (since I imagine svn allows
cyclical renames), but in practice it most likely will be fine. And I'd
rather have failure in that case, since we aren't sure what the user
If you're concerned about the cyclical rename situation, I could add an
--already-done flag, but I'd prefer to keep the number of flags to a
minimum wherever possible. In case I wasn't clear, the cyclical rename
situation is something like:
darcs mv a tmp
darcs mv b a
darcs mv tmp b
Because of the way darcs works (no file IDs, and changes are a sort of
"action") there is no way to do this without using a temporary filename. I
suspect in svn it may be possible to do it without a temporary filename
(certainly that is the case with arch), in which case you'd either need
some tricky logic to create a temporary filename, or you'd have to do it by
hand, or you'd have to give up and not perform the rename. That would mess
up the history, but what kind of silly person performs cyclical renames of
their source code files?
More information about the darcs-users