autobuild: added --fix-whitespace option
authorAndrew Tridgell <tridge@samba.org>
Sat, 25 Sep 2010 23:18:00 +0000 (16:18 -0700)
committerAndrew Tridgell <tridge@samba.org>
Sun, 26 Sep 2010 01:21:49 +0000 (01:21 +0000)
script/autobuild.py

index a1b45906a956d7961f3ee1329a2922e956b0fc3d..ec9998950f879bc46bbee58fe1db3a39d84a0f89 100755 (executable)
@@ -116,6 +116,7 @@ class builder:
 class buildlist:
     '''handle build of multiple directories'''
     def __init__(self, tasklist, tasknames):
+        global tasks
         self.tlist = []
         self.tail_proc = None
         if tasknames == ['pass']:
@@ -214,7 +215,10 @@ def rebase_tree(url):
     print("Rebasing on %s" % url)
     run_cmd("git remote add -t master master %s" % url, show=True, dir=test_master)
     run_cmd("git fetch master", show=True, dir=test_master)
-    run_cmd("git rebase master/master", show=True, dir=test_master)
+    if options.fix_whitespace:
+        run_cmd("git rebase --whitespace=fix master/master", show=True, dir=test_master)
+    else:
+        run_cmd("git rebase master/master", show=True, dir=test_master)
 
 def push_to(url):
     print("Pushing to %s" % url)
@@ -244,6 +248,8 @@ parser.add_option("", "--push-master", help="push to %s on success" % samba_mast
                   default=False, action='store_true')
 parser.add_option("", "--mark", help="add a Tested-By signoff before pushing",
                   default=False, action="store_true")
+parser.add_option("", "--fix-whitespace", help="fix whitespace on rebase",
+                  default=False, action="store_true")
 
 
 (options, args) = parser.parse_args()