[darcs-users] adddir and patch dependencies

Nils Decker gmame.news.nde at xoxy.net
Thu Nov 4 20:49:26 UTC 2004


Hello,

yesterday i converted a large repo from svn to darcs. Then i tried to
unpull a patch that adds a single, never again touched binary file.
This wasnt possible, because many patches depend on the adddir /doc.

Adding the first file in a directory also adds the adddir to the patch.
All patches for later files in this directory depend on this patch.
This could be avoided by seperately recording adddirs, but that would be
tiresome.

It seems to be no state to a directory other than its presence. Is a
seperate hunk needed for this simple information? Obviously, if there is
a addfile into a directory, the directory has to exist.
Without the adddir everything would work like now except that there were
no way to record empty directories.

Maybe the meaning of adddir and rmdir could be changed like this:

if a file is added, all directories in its path are created as needed.
When removing a file, all empty directories in its path are removed as
well.
The meaning of adddir is changed to "create this directory even if it is
empty". Rmdir reverts the directory to the normal delete empty
behaviour.

The effect of these changes would be that adddirs and rmdirs could
easily commute with patches that touch members of those directories.
This could loosen patch dependencies especially for comman base
directories.

I think this change could be implemented without breaking darcs and old
patches, but i am no expert on darcs...


Regards
  Nils Decker

PS: when pulling a patch that rmdirs a directory with non-darcs files in
it, the directory is silently ignored. Darcs should print a message,
"could not delete directory foo because it is not empty". The user can
cleanup himself.

-- 
Nils Decker <ndecker at gmx.de>





More information about the darcs-users mailing list