Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
0ed05e8e
Commit
0ed05e8e
authored
Nov 24, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portal_commits: Add classes and basic functions
parent
b5be28aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+36
-1
product/ERP5/__init__.py
product/ERP5/__init__.py
+3
-2
No files found.
product/ERP5/Tool/CommitTool.py
View file @
0ed05e8e
...
...
@@ -31,6 +31,7 @@ from webdav.client import Resource
from
App.config
import
getConfiguration
import
os
import
time
import
shutil
import
sys
import
hashlib
...
...
@@ -131,6 +132,26 @@ class CommitTool (BaseTool):
- portal_commits/387897938794876-9 (Snapshort of erp5_trade)
- portal_commits/387897938794876-10 (Snapshot of erp5_base)
Draft -> Commited -> Pushed (to repo) |Commit]
Draft -> Installed <-> Uninstalled |Snapshot]
Developer mode: make commits and push them (nothing else)
Developer mode: make snapshots and push them (nothing else)
Installation:
- create an empty snapshot that that's similar to a Commit
- fill it with hard links to commits and snapshots
- install it
Only Draft can be modified
3 types
- Commit - partial state (pushed)
- Save Point - complete state with copies of a single bt (only for
optimisation) (really needed ?) (pushed)
- Snapshort - complete state with hard link for all bt (installed)
We should try first with Commit and Snapshot
"""
id
=
'portal_commits'
title
=
'Commit Tool'
...
...
@@ -148,6 +169,20 @@ class CommitTool (BaseTool):
security
=
ClassSecurityInfo
()
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'manage_overview'
)
manage_overview
=
DTMLFile
(
'explainCommitTool'
,
_dtmldir
)
#manage_overview = DTMLFile('explainCommitTool', _dtmldir)
def
getCommitList
(
self
):
return
self
.
objectValues
(
portal_type
=
'Business Commit'
)
security
.
declarePublic
(
'newContent'
)
def
newContent
(
self
,
id
=
None
,
**
kw
):
"""
Override newContent so as to use 'id' generated like hash
"""
if
id
is
None
:
id
=
self
.
generateNewId
()
id
=
str
(
str
(
id
)
+
'_'
+
str
(
time
.
time
())).
replace
(
'.'
,
''
)
return
super
(
CommitTool
,
self
).
newContent
(
id
,
**
kw
)
InitializeClass
(
CommitTool
)
product/ERP5/__init__.py
View file @
0ed05e8e
...
...
@@ -52,7 +52,7 @@ from Tool import CategoryTool, SimulationTool, RuleTool, IdTool, TemplateTool,\
AcknowledgementTool
,
SolverTool
,
SolverProcessTool
,
\
ConversionTool
,
RoundingTool
,
UrlRegistryTool
,
InterfaceTool
,
\
CertificateAuthorityTool
,
InotifyTool
,
TaskDistributionTool
,
\
DiffTool
DiffTool
,
CommitTool
import
ERP5Site
from
Document
import
PythonScript
,
BusinessManager
object_classes
=
(
ERP5Site
.
ERP5Site
,
...
...
@@ -88,7 +88,8 @@ portal_tools = ( CategoryTool.CategoryTool,
InotifyTool
.
InotifyTool
,
TaskDistributionTool
.
TaskDistributionTool
,
InterfaceTool
.
InterfaceTool
,
DiffTool
.
DiffTool
DiffTool
.
DiffTool
,
CommitTool
.
CommitTool
,
)
content_classes
=
()
content_constructors
=
()
...
...
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