A unit of work is a simple storage with write lock/unlock.
The manager/package now share a unit of work instance.
The unit of work is used to prevent shared dependencies from being cloned/copied "at the same time" fixing issue #81.
The prune and version resolving algorithm was also not correct. It now resolves versions correctly, fixing issue #57.
- Fix I/O errors caused by copying/clone repos simultaneously to the same dest.
- Optimize the clone/copy step by avoiding it if the last resolved resource is the same.
- Fix failing test (at least on my windows machine)
- Add some more tests
- Fix CS.
According to https://github.com/joyent/node/issues/2703
fs.rename does not support renaming between disks, which
is causing a problem when the /tmp directory is not on the
same disk as the cwd.
This is an ugly fix involving error catching, but I would
love some input to see how to fix this problem permanently