shaunvxc / envy

:memo: safely make edits and sync local changes to files living in the site-packages of your virtualenvs
MIT License
39 stars 3 forks source link

add `envy clean --all` feature #9

Closed shaunvxc closed 8 years ago

shaunvxc commented 8 years ago

This allows users to restore all of the packages they have made changes to in their currently active virtualenv back to their original states with one command.

The following example illustrates this new functionality:

(foo) $ envy edit package1/bar.py (foo) $ envy edit package2/blah.py

After these two commands, the contents of ~/.envies/foo/ will contain a backup for both package1 and package2.

Currently, in order to restore both package1 and package2 to their original states, one would have to run two envy clean commands:

(foo)$ envy clean package1 (foo)$ envy clean package2

This PR introduces a shortcut to accomplish this. To restore all changed packages back to their unadulterated states, simply run:

(foo) $ envy clean --all

I feel that this is a useful feature, and am satisfied that it is production ready. However, I've had some issues adding test support for this feature-- mostly because of the heavy patching used in the tests.