26 # 1) If SVN URL and revision are specified, exports SVN project |
26 # 1) If SVN URL and revision are specified, exports SVN project |
27 # to <svn_path> directory. |
27 # to <svn_path> directory. |
28 # 2) Creates S60 distribution policies to <svn_path> directory |
28 # 2) Creates S60 distribution policies to <svn_path> directory |
29 # using setpolicyfiles.py script. |
29 # using setpolicyfiles.py script. |
30 # 3) Makes CCM sync and reconf for the CCM project. |
30 # 3) Makes CCM sync and reconf for the CCM project. |
31 # 4) Creates CCM default task. |
31 # 4) Synchronizes the <svn_path> and <ccm_path> directories. |
32 # 5) Synchronizes the <svn_path> and <ccm_path> directories. |
32 # 5) If there were any changes, creates CCM default task, |
33 # 6) If there were any changes, reconciles CCM project to database |
33 # reconciles CCM project to database and commits CCM |
34 # and commits CCM default task. If there were no changes, leaves |
34 # default task. |
35 # the CCM default task open. |
|
36 # |
35 # |
37 # The script execution aborts immediately if any error occurs. |
36 # The script execution aborts immediately if any error occurs. |
38 # In this case the user must manually delete the ccm task and |
37 # In this case the user must manually delete the ccm task and |
39 # reconcile the ccm work area so that it is again |
38 # reconcile the ccm work area so that it is again |
40 # in the same level as it was before script execution. |
39 # in the same level as it was before script execution. |
236 if not opts.no_reconf: |
236 if not opts.no_reconf: |
237 # Reconfigure CCM project. |
237 # Reconfigure CCM project. |
238 print "SVN2CCM: Reconfiguring CCM project", datetime.datetime.now() |
238 print "SVN2CCM: Reconfiguring CCM project", datetime.datetime.now() |
239 execute(["ccm", "reconf", "-r", "-p", quote_str(ccm_project_id)]) |
239 execute(["ccm", "reconf", "-r", "-p", quote_str(ccm_project_id)]) |
240 |
240 |
241 # Create CCM task. |
|
242 print "SVN2CCM: Creating CCM task", datetime.datetime.now() |
|
243 if opts.ccm_description_file: |
|
244 execute(["ccm", "task", "-create", "-default", "-release", quote_str(ccm_project_release), "-descriptionfile", quote_str(opts.ccm_description_file), "-synopsis", get_comment_string()]) |
|
245 else: |
|
246 execute(["ccm", "task", "-create", "-default", "-release", quote_str(ccm_project_release), "-description", get_comment_string(), "-synopsis", get_comment_string()]) |
|
247 |
|
248 # Synchronize the SVN and CCM directories. |
241 # Synchronize the SVN and CCM directories. |
249 print "SVN2CCM: Synchronizing from %s to %s %s" % \ |
242 print "SVN2CCM: Synchronizing from %s to %s %s" % \ |
250 (svn_path, ccm_path, str(datetime.datetime.now())) |
243 (svn_path, ccm_path, str(datetime.datetime.now())) |
251 if len(opts.ignore) > 0: |
244 if len(opts.ignore) > 0: |
252 print "SVN2CCM: Ignoring from root directory: " + ", ".join(opts.ignore) |
245 print "SVN2CCM: Ignoring from root directory: " + ", ".join(opts.ignore) |
253 if len(opts.ignore_all) > 0: |
246 if len(opts.ignore_all) > 0: |
254 print "SVN2CCM: Ignoring from all directories: " + ", ".join(opts.ignore_all) |
247 print "SVN2CCM: Ignoring from all directories: " + ", ".join(opts.ignore_all) |
255 sync_dirs(svn_path, ccm_path, opts.ignore, opts.ignore_all + [".svn"]) |
248 sync_dirs(svn_path, ccm_path, opts.ignore, opts.ignore_all + [".svn"]) |
256 |
249 |
257 if ccm_counter.changes_made(): |
250 if ccm_counter.changes_made(): |
|
251 # Create CCM task. |
|
252 print "SVN2CCM: Creating CCM task", datetime.datetime.now() |
|
253 if opts.ccm_description_file: |
|
254 execute(["ccm", "task", "-create", "-default", "-release", quote_str(ccm_project_release), "-descriptionfile", quote_str(opts.ccm_description_file), "-synopsis", get_comment_string()]) |
|
255 else: |
|
256 execute(["ccm", "task", "-create", "-default", "-release", quote_str(ccm_project_release), "-description", get_comment_string(), "-synopsis", get_comment_string()]) |
258 # Reconcile CCM project. |
257 # Reconcile CCM project. |
259 print "SVN2CCM: Reconciling CCM project", datetime.datetime.now() |
258 print "SVN2CCM: Reconciling CCM project", datetime.datetime.now() |
260 execute(["ccm", "reconcile", "-r", "-cu", "-mwaf", "-update_db", "-p", quote_str(ccm_project_id)]) |
259 execute(["ccm", "reconcile", "-r", "-cu", "-mwaf", "-update_db", "-p", quote_str(ccm_project_id)]) |
261 if opts.no_commit: |
260 if opts.no_commit: |
262 print "SVN2CCM: WARNING: No commit, leaving CCM task open" |
261 print "SVN2CCM: WARNING: No commit, leaving CCM task open" |
264 # Commit the default CCM task. |
263 # Commit the default CCM task. |
265 print "SVN2CCM: Committing CCM task", datetime.datetime.now() |
264 print "SVN2CCM: Committing CCM task", datetime.datetime.now() |
266 execute(["ccm", "task", "-ci", "default"]) |
265 execute(["ccm", "task", "-ci", "default"]) |
267 else: |
266 else: |
268 # No changes, do not reconcile or commit. |
267 # No changes, do not reconcile or commit. |
269 print "SVN2CCM: WARNING: No changes, leaving CCM task open" |
268 print "SVN2CCM: WARNING: No changes found" |
270 |
269 |
271 # Finished. |
270 # Finished. |
272 ccm_counter.stop_time = datetime.datetime.now() |
271 ccm_counter.stop_time = datetime.datetime.now() |
273 print "SVN2CCM: Finished " + str(ccm_counter.stop_time) |
272 print "SVN2CCM: Finished " + str(ccm_counter.stop_time) |
274 print str(ccm_counter) |
273 print str(ccm_counter) |