Title: [commits] (vajda) [11290] - added --backup command line option to backup repository before start
Revision
11290
Author
vajda
Date
2006-07-31 16:29:07 -0700 (Mon, 31 Jul 2006)

Log Message

- added --backup command line option to backup repository before start

Modified Paths

Diff

Modified: trunk/chandler/application/Utility.py (11289 => 11290)

--- trunk/chandler/application/Utility.py	2006-07-31 22:52:49 UTC (rev 11289)
+++ trunk/chandler/application/Utility.py	2006-07-31 23:29:07 UTC (rev 11290)
@@ -224,6 +224,7 @@
         'indexer':    ('-i', '--indexer',    's', 'background', None, 'Run Lucene indexing in the background or foreground'),
         'uuids':      ('-U', '--uuids',      's', None, None, 'use a file containing a bunch of pre-generated UUIDs'),
         'undo':       ('',   '--undo',       's', None, None, 'undo <n> versions'),
+        'backup':     ('',   '--backup',     'b', False, None, 'backup repository before start'),
     }
 
 
@@ -430,10 +431,14 @@
             del kwds
             break
 
+    if options.backup:
+        dbHome = repository.backup()
+        repository.logger.info("Repository was backed up into %s", dbHome)
+
     if options.undo:
         if options.undo == 'check':
             view = repository.view
-            while view.itsVersion > 0:
+            while view.itsVersion > 0L:
                 schema.reset(view)
                 if view.check():
                     break
@@ -446,7 +451,7 @@
             version = repository.store.getVersion()
             nVersions = long(options.undo)
             toVersion = version - nVersions
-            if toVersion >= 0:
+            if toVersion >= 0L:
                 repository.undo(toVersion)
 
     view = repository.view




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to