[mirrorbrain-commits] r7771 - /trunk/mirrordoctor/mirrordoctor.py

From: <poeml_at_mirrorbrain.org>
Date: Fri, 21 Aug 2009 21:07:49 -0000
Author: poeml
Date: Fri Aug 21 23:07:49 2009
New Revision: 7771

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7771&view=rev
Log:
mb export:
- add a sanity check: when exporting into a subversion working directory, make
  sure that a directory named '.svn' exists, preventing accidental deletion of
  files.

Modified:
    trunk/mirrordoctor/mirrordoctor.py

Modified: trunk/mirrordoctor/mirrordoctor.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mirrordoctor.py?rev=7771&r1=7770&r2=7771&view=diff
==============================================================================
--- trunk/mirrordoctor/mirrordoctor.py (original)
+++ trunk/mirrordoctor/mirrordoctor.py Fri Aug 21 23:07:49 2009
@@ -1073,6 +1073,8 @@
             if not os.path.exists(opts.target_dir):
                 os.makedirs(opts.target_dir, 0750)
             os.chdir(opts.target_dir)
+            if not os.path.isdir('.svn'):
+                sys.exit('%r doesn\'t seem to be a Subversion working copy')
             for i in os.listdir('.'):
                 if i.startswith('.'): continue
                 os.unlink(i)




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Fri Aug 21 2009 - 21:07:50 GMT

This archive was generated by hypermail 2.2.0 : Fri Aug 21 2009 - 21:45:06 GMT