changeset 224:582c84365f6a

svn sucks - supporting git instead
author catherine@dellzilla
date Tue, 03 Feb 2009 17:24:28 -0500
parents 6d7eee8ad690
children 4ea2d2599dd4
files sqlpython/sqlpyPlus.py
diffstat 1 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/sqlpyPlus.py	Tue Feb 03 16:43:29 2009 -0500
+++ b/sqlpython/sqlpyPlus.py	Tue Feb 03 17:24:28 2009 -0500
@@ -619,13 +619,11 @@
     do_pull.__doc__ += '\n\nSupported DDL types: ' + supported_ddl_types
     supported_ddl_types = supported_ddl_types.split(', ')    
 
-    def _vc(self, arg, opts, program, initializer):
-        subprocess.call(initializer)
-        os.chdir(initializer[2])
+    def _vc(self, arg, opts, program):
+        subprocess.call([program, 'init'])
         opts.dump = True
         self._pull(arg, opts, vc=[program, 'add'])
         subprocess.call([program, 'commit', '-m', '"%s"' % opts.message or 'committed from sqlpython'])        
-        os.chdir('..')
     
     @options([
               make_option('-f', '--full', action='store_true', help='get dependent objects as well'),
@@ -635,7 +633,7 @@
     def do_hg(self, arg, opts):
         '''hg (opts) (objects):
         Stores DDL on disk and puts files under Mercurial version control.'''
-        self._vc(arg, opts, 'hg', ['hg', 'init', self.sid])        
+        self._vc(arg, opts, 'hg')        
 
     @options([
               make_option('-f', '--full', action='store_true', help='get dependent objects as well'),
@@ -645,19 +643,17 @@
     def do_bzr(self, arg, opts):
         '''bzr (opts) (objects):
         Stores DDL on disk and puts files under Bazaar version control.'''
-        self._vc(arg, opts, 'bzr', ['bzr', 'init', self.sid])        
+        self._vc(arg, opts, 'bzr')        
 
     @options([
               make_option('-f', '--full', action='store_true', help='get dependent objects as well'),
               make_option('-a', '--all', action='store_true', help="all schemas' objects"),
               make_option('-x', '--exact', action='store_true', help="match object name exactly"),
               make_option('-m', '--message', action='store', type='string', dest='message', help="message to save to hg log during commit")])
-    def do_svn(self, arg, opts):
-        '''svn (opts) (objects):
-        Stores DDL to disk and commits a change to SVN.'''
-        self._vc(arg, opts, 'svn', ['svnadmin', 'init', self.sid])        
-        
-        subprocess.call(['svn', 'commit', '-m', '"%s"' % opts.message or 'committed from sqlpython'])        
+    def do_git(self, arg, opts):
+        '''git (opts) (objects):
+        Stores DDL on disk and puts files under git version control.'''
+        self._vc(arg, opts, 'git')        
         
     all_users_option = make_option('-a', action='store_const', dest="scope",
                                          default={'col':'', 'view':'user', 'schemas':'user', 'firstcol': ''},