Fixed naming of accepted branches
authorEd Bartosh <eduard.bartosh@intel.com>
Tue, 25 Feb 2014 11:25:30 +0000 (13:25 +0200)
committerEd Bartosh <eduard.bartosh@intel.com>
Tue, 25 Feb 2014 11:37:05 +0000 (13:37 +0200)
Name of accepted branches were made by replacing ':' to '/' in OBS
project name. That caused conflict between branches for subprojects and
main project, e.g. Tizen:IVI and Tizen:IVI:Genivi. For this pair of
projects accepted branches were named as accepted/tizen/ivi and
accepted/tizen/ivi/genivi. This naming approach creates a conflict as
.git/refs/accepted/tizen/ivi can't be directory (for
accepted/tizen/ivi/genivi) and file (for accepted/tizen/ivi) branches at
the same time.

This issue caused failures on backend to update accepted branches.

Fixed by using '_' instead of '/' in branch names, so above 2 example
branches are named as accepted/tizen_ivi and accepted/tizen_ivi_genivi
now and do not conflict with each other.

Fixes: #1435

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

index 86f326a..88ec370 100755 (executable)
@@ -198,7 +198,7 @@ def request_accepted(data, gerrit, gitprj):
 
     # push accepted commit to specific hierarchy refs/heads/accepted/*
     # e.g. Tizen:Mobile should push branch refs/heads/accepted/tizen/mobile
-    dst = 'refs/heads/accepted/%s' % obs_target
+    dst = 'refs/heads/accepted/%s' % data['OBS_REQ_PRJ'].lower().replace(':', '_')
     try:
         gitprj.push(remote, data['commitid'], dst, force=True)
     except GitRepositoryError, gre: