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
3eaef7e6
Commit
3eaef7e6
authored
Dec 06, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Set last created commit as predecessor everytime we create a new commit
parent
fb589044
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+9
-1
No files found.
product/ERP5/Tool/CommitTool.py
View file @
3eaef7e6
...
...
@@ -186,6 +186,14 @@ class CommitTool (BaseTool):
id
=
self
.
generateNewId
()
id
=
str
(
str
(
id
)
+
'_'
+
str
(
time
.
time
())).
replace
(
'.'
,
''
)
return
super
(
CommitTool
,
self
).
newContent
(
id
,
**
kw
)
new_obj
=
super
(
CommitTool
,
self
).
newContent
(
id
,
**
kw
)
# Add the last commit as its predecessor
commit_list
=
[
l
for
l
in
self
.
objectValues
()
if
l
!=
new_obj
]
latest_commit
=
max
(
commit_list
,
key
=
(
lambda
x
:
x
.
getCreationDate
()))
# TODO: Add check for no latest_commit
new_obj
.
setPredecessorValue
(
latest_commit
)
return
new_obj
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