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
Hugo Ricateau
erp5
Commits
16a9f0c0
Commit
16a9f0c0
authored
Nov 22, 2017
by
Ayush Tiwari
Committed by
Ayush Tiwari
Apr 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CommitTool: Business Commit Tool to track commits of BT sub-objects
parent
81071a70
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
153 additions
and
0 deletions
+153
-0
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+153
-0
No files found.
product/ERP5/Tool/CommitTool.py
0 → 100644
View file @
16a9f0c0
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
webdav.client
import
Resource
from
App.config
import
getConfiguration
import
os
import
shutil
import
sys
import
hashlib
import
pprint
import
transaction
from
Acquisition
import
Implicit
,
Explicit
from
AccessControl
import
ClassSecurityInfo
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
from
Products.CMFActivity.ActiveResult
import
ActiveResult
from
Products.PythonScripts.PythonScript
import
PythonScript
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
,
PersistentMapping
from
Products.ERP5Type.DiffUtils
import
DiffFile
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type
import
Permissions
,
interfaces
from
Products.ERP5.Document.BusinessTemplate
import
BusinessTemplateMissingDependency
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5.genbt5list
import
generateInformation
from
Acquisition
import
aq_base
from
tempfile
import
mkstemp
,
mkdtemp
from
Products.ERP5
import
_dtmldir
from
cStringIO
import
StringIO
from
urllib
import
pathname2url
,
urlopen
,
splittype
,
urlretrieve
import
urllib2
import
re
from
xml.dom.minidom
import
parse
from
xml.parsers.expat
import
ExpatError
import
struct
import
cPickle
from
base64
import
b64encode
,
b64decode
from
Products.ERP5Type.Message
import
translateString
from
zLOG
import
LOG
,
INFO
,
WARNING
from
base64
import
decodestring
from
difflib
import
unified_diff
from
operator
import
attrgetter
import
subprocess
import
time
class
CommitTool
(
BaseTool
):
"""
CommitTool manages commits of Business Templates.
CommitTool provides some methods to deal with Business Templates:
- download commits
- install commits
- push commits
- XXX
ERP5 Business Commit contains:
- ERP5 Business Template Item
- ERP5 Business Template Property Item
- ERP5 Business Template Patch Item
in relation to one or more ERP5 Business Template (follow_up relation from BTI to BTS)
ERP5 Business Commit has relation to:
- predecessor: previous Business Commit
ERP5 Business Snapshot has relation to:
- similar: equivalent ERP5 Business Commit
they only serve as a way to optmize installation time by having all objects in one
folder rather than downloading 10 years of commit to get things installed
ERP5 Business Temaplate Specification defines:
- title
- description
- dependency
- list of paths (of different kinds) to help generate initial ERP5 Business Commit
It is only a spec file with no object inside
ERP5 Business Snapshot contains:
- all BTI BTPI and BTPI for a single BT at specifc build point
Bootstrap:
- import zexp file to portal_commits/
- portal_commits/business_template_index is installed (ERP5 Buiness Snapshot of the erp5_root_index business template) [BOOSTRAP]
- this makes portal_templates/* full of all possibles Business Template that can be installed
- portal_commits/business_template_index --> similar/portal_commits/387897938794876-276376
Portal Templates:
- portal_templates/erp5_base (only one)
- portal_templates/erp5_trade (only one)
they containing nothing inside, just their title and description and spec (like a spec file in rpm)
Installation:
- download all commits that
- are predecessor of 387897938794876-276376
- that are required to install (erp5_base, erp5_trade, etc.)
RESULT:
- portal_commits/387897938794876-1 (Commit)
- portal_commits/387897938794876-2 (Commit)
- portal_commits/387897938794876-3 (Commit)
- portal_commits/387897938794876-4 (Commit)
- portal_commits/387897938794876-5 (Commit)
- portal_commits/387897938794876-6 (Commit)
- portal_commits/387897938794876-7 (Commit)
- portal_commits/387897938794876-8 (Commit)
- portal_commits/387897938794876-9 (Snapshort of erp5_trade)
- portal_commits/387897938794876-10 (Snapshot of erp5_base)
"""
id
=
'portal_commits'
title
=
'Commit Tool'
meta_type
=
'ERP5 Commit Tool'
portal_type
=
'Commit Tool'
allowed_types
=
(
'ERP5 Business Commit'
,
'ERP5 Business Snapshot'
,
)
# This stores information on repositories.
repository_dict
=
{}
# Declarative Security
security
=
ClassSecurityInfo
()
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'manage_overview'
)
manage_overview
=
DTMLFile
(
'explainCommitTool'
,
_dtmldir
)
InitializeClass
(
CommitTool
)
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