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
a8b08028
Commit
a8b08028
authored
Dec 21, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CommitTool: No need to set Predecessor if its the premier commit
parent
3521f91f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+12
-10
No files found.
product/ERP5/Tool/CommitTool.py
View file @
a8b08028
...
...
@@ -192,16 +192,18 @@ class CommitTool (BaseTool):
commit_list
=
[
l
for
l
in
self
.
objectValues
(
portal_type
=
'Business Commit'
)
if
l
!=
new_obj
]
latest_commit
=
max
(
commit_list
,
key
=
(
lambda
x
:
x
.
getCreationDate
()))
if
new_obj
.
getPortalType
()
==
'Business Commit'
:
# TODO: Add check for no latest_commit. Usable especially for 1st BM
new_obj
.
setPredecessorValue
(
latest_commit
)
else
:
# If the new_obj is Business Snapshot, create a similar value for the
# latest commit
new_obj
.
setSimilarValue
(
latest_commit
)
latest_commit
.
setSimilarValue
(
new_obj
)
if
commit_list
:
latest_commit
=
max
(
commit_list
,
key
=
(
lambda
x
:
x
.
getCreationDate
()))
if
new_obj
.
getPortalType
()
==
'Business Commit'
:
# TODO: Add check for no latest_commit. Usable especially for 1st BC
new_obj
.
setPredecessorValue
(
latest_commit
)
else
:
# If the new_obj is Business Snapshot, create a similar value for the
# latest commit
new_obj
.
setSimilarValue
(
latest_commit
)
latest_commit
.
setSimilarValue
(
new_obj
)
return
new_obj
...
...
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