Commits

Anonymous committed d8d40f9

1.1.2dev: Merged [12084] from 1.0-stable.

Comments (0)

Files changed (1)

contrib/bugzilla2trac.py

         self.loginNameCache = {}
         self.fieldNameCache = {}
         from trac.db.api import DatabaseManager
-	self.using_postgres = \
-                DatabaseManager(self.env).connection_uri.startswith("postgres:")
+        self.using_postgres = \
+            DatabaseManager(self.env).connection_uri.startswith("postgres:")
 
     def hasTickets(self):
         return int(self.env.db_query("SELECT count(*) FROM ticket")[0][0] > 0)
     global BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN
     global SEVERITIES, PRIORITIES, PRIORITIES_MAP
     if len (sys.argv) > 1:
-    	if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4:
-    	    usage()
-    	iter = 1
-    	while iter < len(sys.argv):
-    	    if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv):
-    	        BZ_DB = sys.argv[iter+1]
-    	        iter = iter + 1
-    	    elif sys.argv[iter] in ['-h', '--host'] and iter+1 < len(sys.argv):
-    	        BZ_HOST = sys.argv[iter+1]
-    	        iter = iter + 1
-    	    elif sys.argv[iter] in ['-u', '--user'] and iter+1 < len(sys.argv):
-    	        BZ_USER = sys.argv[iter+1]
-    	        iter = iter + 1
-    	    elif sys.argv[iter] in ['-p', '--passwd'] and iter+1 < len(sys.argv):
-    	        BZ_PASSWORD = sys.argv[iter+1]
-    	        iter = iter + 1
-    	    elif sys.argv[iter] in ['--tracenv'] and iter+1 < len(sys.argv):
-    	        TRAC_ENV = sys.argv[iter+1]
-    	        iter = iter + 1
-    	    elif sys.argv[iter] in ['-c', '--clean']:
-    	        TRAC_CLEAN = 1
+        if sys.argv[1] in ['--help','help'] or len(sys.argv) < 4:
+            usage()
+        iter = 1
+        while iter < len(sys.argv):
+            if sys.argv[iter] in ['--db'] and iter+1 < len(sys.argv):
+                BZ_DB = sys.argv[iter+1]
+                iter = iter + 1
+            elif sys.argv[iter] in ['-h', '--host'] and iter+1 < len(sys.argv):
+                BZ_HOST = sys.argv[iter+1]
+                iter = iter + 1
+            elif sys.argv[iter] in ['-u', '--user'] and iter+1 < len(sys.argv):
+                BZ_USER = sys.argv[iter+1]
+                iter = iter + 1
+            elif sys.argv[iter] in ['-p', '--passwd'] and iter+1 < len(sys.argv):
+                BZ_PASSWORD = sys.argv[iter+1]
+                iter = iter + 1
+            elif sys.argv[iter] in ['--tracenv'] and iter+1 < len(sys.argv):
+                TRAC_ENV = sys.argv[iter+1]
+                iter = iter + 1
+            elif sys.argv[iter] in ['-c', '--clean']:
+                TRAC_CLEAN = 1
             elif sys.argv[iter] in ['-n', '--noseverities']:
                 # treat Bugzilla severites as Trac priorities
                 PRIORITIES = SEVERITIES
                 SEVERITIES = []
                 PRIORITIES_MAP = {}
-    	    else:
-    	        print "Error: unknown parameter: " + sys.argv[iter]
-    	        sys.exit(0)
-    	    iter = iter + 1
+            else:
+                print "Error: unknown parameter: " + sys.argv[iter]
+                sys.exit(0)
+            iter = iter + 1
 
     convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)