Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5diff
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
erp5diff
Commits
68726ed4
Commit
68726ed4
authored
May 21, 2010
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra spaces only
parent
6aa55931
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
44 deletions
+44
-44
README
README
+44
-44
No files found.
README
View file @
68726ed4
...
...
@@ -20,33 +20,33 @@ ERP5Diff Usage and its output example
1. update the texts of the three elements
>>> from ERP5Diff import ERP5Diff
>>> from ERP5Diff import ERP5Diff
>>> erp5diff = ERP5Diff()
>>> old_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <erp5>
... <object portal_type="Person" id="313730">
... <description type="text">description1 --- $sdfrç_sdfsçdf_oisfsopf</description>
... <first_name type="string">Kamada</first_name>
... <last_name type="string">Kamada</last_name>
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:24.700 GMT+9</time>
... </workflow_action>
... </object>
... </erp5>
... """
>>> new_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <description type="text">description3 çsdf__sdfççç_df___&amp;&amp;é]]]°°°°°°</description>
... <first_name type="string">Tatuya</first_name>
... <last_name type="string">Kamada</last_name>
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:24.703 GMT+9</time>
... </workflow_action>
... </object>
... </erp5>
... """
... <first_name type="string">Kamada</first_name>
... <last_name type="string">Kamada</last_name>
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:24.700 GMT+9</time>
... </workflow_action>
... </object>
... </erp5>
... """
>>> new_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <description type="text">description3 çsdf__sdfççç_df___&amp;&amp;é]]]°°°°°°</description>
... <first_name type="string">Tatuya</first_name>
... <last_name type="string">Kamada</last_name>
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:24.703 GMT+9</time>
... </workflow_action>
... </object>
... </erp5>
... """
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
...
...
@@ -81,7 +81,7 @@ ERP5Diff Usage and its output example
3. same
>>> old_xml = """
... <erp5>
... <erp5>
... <object portal_type="Person" id="313730">
... <title type="string">Tatuya Kamada</title>
... <subject_list type="lines"><?xml version="1.0"?><marshal><list id="i2"></list></marshal></subject_list>
...
...
@@ -114,8 +114,8 @@ ERP5Diff Usage and its output example
4. update the texts of the elements and remove an element
>>> old_xml = """
... <erp5>
>>> old_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <description type="text">description2éà@ $*&lt; &lt;&lt;&lt; -----</description>
... <language type="string">en</language>
...
...
@@ -148,7 +148,7 @@ ERP5Diff Usage and its output example
<xupdate:remove select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
</xupdate:modifications>
5. update two elements includes some symbols
5. update two elements includes some symbols
>>> old_xml = """
... <erp5>
...
...
@@ -175,11 +175,11 @@ ERP5Diff Usage and its output example
6. update two date element which have same id
>>> old_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:40.550 GMT+9</time>
>>> old_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:40.550 GMT+9</time>
... </workflow_action>
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:40.903 GMT+9</time>
...
...
@@ -241,7 +241,7 @@ ERP5Diff Usage and its output example
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:remove select="/erp5/object[@id='313731']/local_role[@id='tk']"/>
<xupdate:append select="/erp5/object[@id='313731']" child="first()">
<xupdate:element name="local_role"><xupdate:attribute name="type">tokens</xupdate:attribute><xupdate:attribute name="id">tatuya</xupdate:attribute><?xml version="1.0"?><marshal><tuple><string>Owner</string></tuple></marshal></xupdate:element>
<xupdate:element name="local_role"><xupdate:attribute name="type">tokens</xupdate:attribute><xupdate:attribute name="id">tatuya</xupdate:attribute><?xml version="1.0"?><marshal><tuple><string>Owner</string></tuple></marshal></xupdate:element>
<xupdate:element name="JohnDoe">Go to the beach</xupdate:element>
</xupdate:append>
<xupdate:insert-before select="/erp5/object[@id='313731']/local_permission[@id='View']">
...
...
@@ -303,7 +303,7 @@ ERP5Diff Usage and its output example
10. rename root element
>>> old_xml = """
... <erp5>
... <erp5>
... <object portal_type="Person" id="313730">
... <id type="string">313730</id>
... <title type="string">Tatuya Kamada</title>
...
...
@@ -347,7 +347,7 @@ ERP5Diff Usage and its output example
<xupdate:update select="/erp5/object[@id='313730']/local_role[@id='fab']/attribute::type">ccc</xupdate:update>
</xupdate:modifications>
12. Update two attribute
12. Update two attribute
>>> old_xml = """
... <erp5>
...
...
@@ -543,11 +543,11 @@ ERP5Diff Usage and its output example
20. Remove some elements that have same id
This is an unexpected case for current ERP5Diff alogrithm. So current ERP5Diff
This is an unexpected case for current ERP5Diff alogrithm. So current ERP5Diff
does not work as bellow example. This is a known bug.
>>> old_xml = """
... <erp5>
>>> old_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:34.424 GMT+9</time>
...
...
@@ -603,8 +603,8 @@ does not work as bellow example. This is a known bug.
As well as No.20. This a known bug, too.
>>> old_xml = """
... <erp5>
>>> old_xml = """
... <erp5>
... <object portal_type="Person" id="313730">
... <workflow_action id="edit_workflow">
... <time type="date">2009/08/28 19:12:34.424 GMT+9</time>
...
...
@@ -643,14 +643,14 @@ does not work as bellow example. This is a known bug.
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/29 19:12:34.432 GMT+9</xupdate:update>
<xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/30 19:12:34.434 GMT+9</xupdate:update>
<xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][4]/time">2009/08/31 19:12:34.436 GMT+9</xupdate:update>
<xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/30 19:12:34.434 GMT+9</xupdate:update>
<xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][4]/time">2009/08/31 19:12:34.436 GMT+9</xupdate:update>
</xupdate:modifications>
22. Modify attributes of sequencial objects
ERP5Diff creates target index from 0 as a XPath string, but according to the
definition of the XPath specification <http://www.w3.org/TR/xpath>, it is wrong.
ERP5Diff creates target index from 0 as a XPath string, but according to the
definition of the XPath specification <http://www.w3.org/TR/xpath>, it is wrong.
It should be start from 1. This is a known problem.
>>> old_xml = """
...
...
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