Commit afadf027 authored by Georgios Dagkakis's avatar Georgios Dagkakis

TemplateTool: In upgradeSite return also the Git revision that the BT will

be update to.

For example, in the past we had:
'Update erp5_core business template in state different'

And now it would be:
'Update erp5_core business template to revision: 2228e56df402a74645db28c4d121d84b51954dfc. In state different'

To help developer confirm that the upgrade will be done to the correct revision
parent b8f28f92
......@@ -63,6 +63,8 @@ from base64 import decodestring
import subprocess
import time
from Products.ERP5VCS.WorkingCopy import getVcsTool
WIN = os.name == 'nt'
CATALOG_UPDATABLE = object()
......@@ -1430,12 +1432,17 @@ class TemplateTool (BaseTool):
template_list=dependency_list)
update_bt5_list.sort(key=lambda x: dependency_list.index(x.title))
for bt5 in update_bt5_list:
vcs_tool = getVcsTool(
vcs=None, path=bt5.repository, restricted=False
).__of__(bt5)
reinstall = bt5.title in deprecated_reinstall_set or bt5.force_install
if (not(reinstall) and bt5.version_state == 'present') or \
bt5.title in keep_bt5_id_set:
continue
append("Update %s business template in state %s%s" % \
(bt5.title, bt5.version_state, (reinstall and ' (reinstall)') or ''))
append(
"Update %s business template to revision: %s. In state %s%s" % \
(bt5.title, vcs_tool.getRevision(), bt5.version_state, (reinstall and ' (reinstall)') or '')
)
if not(dry_run):
bt5_url = "%s/%s" % (bt5.repository, bt5.title)
self.updateBusinessTemplateFromUrl(bt5_url, reinstall=reinstall,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment