Removed branch check
authorEd Bartosh <eduard.bartosh@intel.com>
Fri, 11 Apr 2014 09:31:01 +0000 (12:31 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Fri, 11 Apr 2014 09:33:59 +0000 (12:33 +0300)
This check confuses and restricts developers and prevents them to submit
changes from tizen branch to tizen_ivi, tizen_generic and similar submit
targets.

Fixes: #1813

Change-Id: I58747824f663f0f85485bb5385eb7680dca15e8c
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
job_submitobs.py

index c469616..2be0d11 100755 (executable)
@@ -29,11 +29,6 @@ from gbp.rpm import SpecFile
 from gbp.git.repository import GitRepositoryError
 from gbp.errors import GbpError
 
-WRONG_VERSION_MSG = '- The tag means you want to submit commit %s in %s branch'\
-                    ' to OBS, but this commit does NOT exist in %s branch. '\
-                    'Please use correct branch name as version in tag name '\
-                    'submit/{version}/{date.time}.'
-
 WRONG_DATE_MSG = '- The date %s in tag does NOT follow correct format. You can'\
                  ' use shell command "date --utc +%%Y%%m%%d.%%H%%M%%S" to '\
                  'generate it, like 20120801.083113.'
@@ -128,29 +123,18 @@ def check_tag_format(git, mygerrit, event, tag):
         if not pattern.match(date):
             message.append(WRONG_DATE_MSG % date)
 
-        # check branch format
-        branches = git.branch_contains(tag)
-        if branches:
-            # the tagged commit has been merged on gerrit
-            if branch not in branches:
-                # tag is on wrong branch
-                message.append(WRONG_VERSION_MSG % (psr, branch, branch))
+        # Check if change is still under review
+        cmd = '--current-patch-set status: open project: %s commit: %s' % \
+                  (event['project'], psr)
+        gerritinfo = mygerrit.query(cmd)
+        if len(gerritinfo) == 1 and 'number' in gerritinfo[0] \
+                and 'currentPatchSet' in gerritinfo[0]:
+            if gerritinfo[0]['branch'] == branch:
+                # the tagged commit still open, abort submit this time
+                message.append(UNDER_REVIEW_MSG % (tag, psr))
         else:
-            # The tagged commit doesn't exist in git tree
-            cmd = '--current-patch-set status: open project: %s commit: %s' % \
-                      (event['project'], psr)
-            gerritinfo = mygerrit.query(cmd)
-            if len(gerritinfo) == 1 and 'number' in gerritinfo[0] \
-                    and 'currentPatchSet' in gerritinfo[0]:
-                if gerritinfo[0]['branch'] == branch:
-                    # the tagged commit still open, abort submit this time
-                    message.append(UNDER_REVIEW_MSG % (tag, psr))
-                else:
-                    # tag is on wrong branch
-                    message.append(WRONG_VERSION_MSG % (psr, branch, branch))
-            else:
-                # cannot find tagged commit in git tree or gerrit open change
-                message.append(WRONG_COMMIT_MSG % psr)
+            # cannot find tagged commit in git tree or gerrit open change
+            message.append(WRONG_COMMIT_MSG % psr)
     else:
         # wrong tag format
         message.append(UNKNOWN_FORMAT_MSG)