submit: refuse to submit from development branch
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 24 Apr 2014 06:27:53 +0000 (09:27 +0300)
committerQiang Z Zhang <qiang.z.zhang@intel.com>
Mon, 5 May 2014 04:03:00 +0000 (07:03 +0300)
The submit command now detects if the submission is done from the
development branch of an orphan packaging branch and fails in this case.
Submissions must be done from the packaging branch if the package is
maintained using the orphan-packaging model.

Change-Id: I8fdfe9c64f1e71b1d8e1a5cdfa1ad63e93378b75
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gitbuildsys/cmd_submit.py

index aed1124..75940e1 100644 (file)
@@ -22,6 +22,7 @@ import os
 import re
 import time
 
+from gitbuildsys.conf import configmgr
 from gitbuildsys.utils import edit
 from gitbuildsys.errors import GbsError
 from gitbuildsys.log import LOGGER as log
@@ -74,6 +75,13 @@ def main(args):
 
     workdir = args.gitdir
 
+    orphan_packaging = configmgr.get('packaging_branch', 'orphan-devel')
+    if orphan_packaging and args.commit == 'HEAD':
+        log.error("You seem to be submitting a development branch of an "
+            "(orphan) packaging branch. Please export your changes to the "
+            "packaging branch with 'gbs devel export' and submit from there.")
+        raise GbsError("Refusing to submit from devel branch")
+
     message = args.msg
     if message is None:
         message = get_message()