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
3bdde386
Commit
3bdde386
authored
Jul 12, 2018
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_core]: DiffTool, do not break projects not having yet deepdiff and unidiff installed
parent
3b5c38b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.DiffTool.py
...tTemplateItem/portal_components/document.erp5.DiffTool.py
+14
-4
No files found.
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.DiffTool.py
View file @
3bdde386
...
@@ -27,10 +27,20 @@
...
@@ -27,10 +27,20 @@
#
#
##############################################################################
##############################################################################
import
deepdiff
import
difflib
import
difflib
from
deepdiff
import
DeepDiff
import
warnings
from
unidiff
import
PatchSet
try
:
import
deepdiff
except
ImportError
:
deepdiff
=
None
warnings
.
warn
(
"Please install deepdiff, it is needed by Diff Tool"
,
DeprecationWarning
)
try
:
from
unidiff
import
PatchSet
except
ImportError
:
PatchSet
=
None
warnings
.
warn
(
"Please install unidiff, it is needed by Diff Tool"
,
DeprecationWarning
)
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Globals
import
InitializeClass
...
@@ -124,7 +134,7 @@ class PortalPatch:
...
@@ -124,7 +134,7 @@ class PortalPatch:
new_value_dict
=
self
.
removePropertyList
(
self
.
new_value
,
export
=
True
)
new_value_dict
=
self
.
removePropertyList
(
self
.
new_value
,
export
=
True
)
# Get the DeepDiff in tree format.
# Get the DeepDiff in tree format.
tree_diff
=
DeepDiff
(
old_value_dict
,
tree_diff
=
deepdiff
.
DeepDiff
(
old_value_dict
,
new_value_dict
,
new_value_dict
,
view
=
'tree'
)
view
=
'tree'
)
diff_tree_list
=
[]
diff_tree_list
=
[]
...
...
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