Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
7b423a55
Commit
7b423a55
authored
May 21, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_result: update jump to viewvc to support git
parent
f649b239
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1144 additions
and
3 deletions
+1144
-3
bt5/erp5_test_result/ActionTemplateItem/portal_types/Test%20Result/jump_viewvc_revision.xml
...eItem/portal_types/Test%20Result/jump_viewvc_revision.xml
+5
-3
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_getJumpVCSResultList.xml
...kins/erp5_test_result/TestResult_getJumpVCSResultList.xml
+132
-0
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_viewJumpVCSDialog.xml
...l_skins/erp5_test_result/TestResult_viewJumpVCSDialog.xml
+133
-0
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_viewJumpVCSDialog/listbox.xml
...erp5_test_result/TestResult_viewJumpVCSDialog/listbox.xml
+614
-0
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_viewJumpVCSDialog/my_title.xml
...rp5_test_result/TestResult_viewJumpVCSDialog/my_title.xml
+260
-0
No files found.
bt5/erp5_test_result/ActionTemplateItem/portal_types/Test%20Result/jump_viewvc_revision.xml
View file @
7b423a55
...
...
@@ -30,7 +30,9 @@
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
...
...
@@ -54,7 +56,7 @@
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
V
iewVC Revision
</string>
</value>
<value>
<string>
V
CS Web Interface
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
...
...
@@ -71,7 +73,7 @@
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/TestResult_
jumpViewVCRevision
</string>
</value>
<value>
<string>
string:${object_url}/TestResult_
viewJumpVCSDialog
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_
jumpViewVCRevision
.xml
→
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_
getJumpVCSResultList
.xml
View file @
7b423a55
...
...
@@ -52,21 +52,79 @@
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
viewvc_url = context.getProperty(\'viewvc_url\', \'http://svn.erp5.org/\')\n
revision = context.getIntIndex()\n
return container.REQUEST.RESPONSE.redirect(\n
\'%s?view=rev&rev=%s\' % (viewvc_url, revision))\n
"Jump to gitlab or gitweb web interface to view commit"\n
\n
portal = context.getPortalObject()\n
test_suite_list = portal.portal_catalog(\n
portal_type=\'Test Suite\',\n
validation_state=(\'validated\', \'invalidated\'),\n
title={\'query\': context.getTitle(), \'key\': \'ExactMatch\'})\n
\n
if not test_suite_list:\n
return []\n
\n
test_suite = sorted(\n
[test_suite.getObject() for test_suite in test_suite_list],\n
key=lambda test_suite: test_suite.getValidationState() == \'validated\')[0]\n
\n
# TODO: make this jump test suite\n
\n
# decode the reference ( ${buildout_section_id}=${number of commits}-${hash},${buildout_section_id}=${number of commits}-${hash}, ... ) \n
repository_dict = {}\n
for repository_string in context.getReference().split(\',\'):\n
repository_code, revision = repository_string.split(\'-\')\n
repository_dict[repository_code.split(\'=\')[0]] = revision\n
\n
\n
result_list = []\n
from Products.PythonScripts.standard import Object\n
\n
def makeVCSLink(repository_url, revision):\n
# https://user:pass@lab.nexedi.cn/user/repo.git ->
https://user:pass@lab.nexedi.cn/user/repo/commit/hash\n
if \'lab.nexedi.cn\' in repository_url and repository_url.endswith(\'.git\'):\n
repository_url = repository_url[:-len(\'.git\')]\n
if \'@\' in repository_url: # remove credentials\n
scheme = repository_url.split(\':\')[0] \n
url = \'%s://%s/commit/%s\' % (scheme, repository_url.split(\'@\')[1], revision )\n
else:\n
url = \'%s/commit/%s\' % (repository_url, revision )\n
# gitweb for git.erp5.org\n
if \'/repos/\' in url:\n
url = url.replace(\'/repos/\', \'/gitweb/\')\n
url = url.replace(\'/commit/\', \'/commitdiff/\')\n
\n
def getListItemUrl(*args, **kw):\n
return url\n
\n
return Object(\n
uid=\'new_\',\n
getUid=lambda: \'new_\',\n
getListItemUrl=getListItemUrl,\n
repository=repository_url,\n
revision=revision)\n
\n
for repository in test_suite.contentValues(portal_type=\'Test Suite Repository\'):\n
result_list.append(\n
makeVCSLink(\n
repository.getProperty(\'git_url\'),\n
repository_dict[repository.getProperty(\'buildout_section_id\')]))\n
\n
if len(result_list) == 1:\n
from zExceptions import Redirect\n
raise Redirect(result_list[0].getListItemUrl())\n
\n
return result_list\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
<value>
<string>
*
args, *
*kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TestResult_
jumpViewVCRevision
</string>
</value>
<value>
<string>
TestResult_
getJumpVCSResultList
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_viewJumpVCSDialog.xml
0 → 100644
View file @
7b423a55
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
TestResult_view
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
enctype
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<list>
<string>
left
</string>
<string>
right
</string>
<string>
center
</string>
<string>
bottom
</string>
<string>
hidden
</string>
</list>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
bottom
</string>
</key>
<value>
<list>
<string>
listbox
</string>
</list>
</value>
</item>
<item>
<key>
<string>
center
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
left
</string>
</key>
<value>
<list>
<string>
my_title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TestResult_viewJumpVCSDialog
</string>
</value>
</item>
<item>
<key>
<string>
method
</string>
</key>
<value>
<string>
POST
</string>
</value>
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
TestResult_viewJumpVCSDialog
</string>
</value>
</item>
<item>
<key>
<string>
pt
</string>
</key>
<value>
<string>
form_dialog
</string>
</value>
</item>
<item>
<key>
<string>
row_length
</string>
</key>
<value>
<int>
4
</int>
</value>
</item>
<item>
<key>
<string>
stored_encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
VCS Web Interface
</string>
</value>
</item>
<item>
<key>
<string>
unicode_mode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
update_action
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_viewJumpVCSDialog/listbox.xml
0 → 100644
View file @
7b423a55
This diff is collapsed.
Click to expand it.
bt5/erp5_test_result/SkinTemplateItem/portal_skins/erp5_test_result/TestResult_viewJumpVCSDialog/my_title.xml
0 → 100644
View file @
7b423a55
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment