Merge lp://qastaging/~piastucki/bzr-xmloutput/xml-log-fix into lp://qastaging/bzr-xmloutput

Proposed by Piotr Piastucki
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 170
Merged at revision: 172
Proposed branch: lp://qastaging/~piastucki/bzr-xmloutput/xml-log-fix
Merge into: lp://qastaging/bzr-xmloutput
Diff against target: 252 lines (+48/-108)
2 files modified
logxml.py (+26/-92)
tests/test_log_xml.py (+22/-16)
To merge this branch: bzr merge lp://qastaging/~piastucki/bzr-xmloutput/xml-log-fix
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Review via email: mp+154886@code.qastaging.launchpad.net

Description of the change

The branch contains the following changes:
1) fixes for failing tests in test_log_xml.py module
2) refactoring of logxml.py module - since we already have a stack of open tags there does not seem to be any reason to keep additional flags/counters and logic to update them. I removed the counters completely and used the stack to properly close open tags.
3) added escaping for tag names

Changes in 2) should fix 517937 - tets case:
1) bzr branch lp:bzr-eclipse (rev 255)
2) cd bzr-eclispe
3) bzr xmllog --limit 230 org.vcs.bazaar.eclipse.ui/
-> malformed XML (http://piastucki.eu/log1.xml)
4) apply fix
5) bzr xmllog --limit 230 org.vcs.bazaar.eclipse.ui/
-> correct XML (http://piastucki.eu/log2.xml)

To post a comment you must log in.
167. By Piotr Piastucki

Fix failing tests in test_log_xml

168. By Piotr Piastucki

Refactor and simplify logxml.
Remove unneeded counters and flags as having a stack of open tags is enough.

169. By Piotr Piastucki

Make sure merge tag is inside log tag

170. By Piotr Piastucki

Avoid closing log in case of nested merges

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Thanks for fixing this.

It would be ideal to have a testcase to reproduce the bad xml, but I wasn't able to write one yet (can't reproduce the nested merges in the test to trigger this condition).

Please let me know if can do it, if not I'll try to ask one of the bzr gurus @ #bzr.

Cheers,

Revision history for this message
Piotr Piastucki (piastucki) wrote :
Download full text (5.0 KiB)

Actually I think this is a combination of nested merges, selected resources and --limit option. The issue is observed when some inner merges affecting the given resource are removed from the result due to --limit option.
I was not able to reproduce it with a simple test case but the following scenario is relatively simple:
1) bzr branch lp:bzr-eclipse -r 213
2) cd bzr-eclipse
3) bzr xmllog --include-merged --limit 5 org.vcs.bazaar.eclipse.ui/ -> invalid xml

It looks like a bug in bzr.
Try the following bzr log commands in the above mentioned scenario:
1) bzr log --include-merged --limit 7
2) bzr log --include-merged --limit 5 org.vcs.bazaar.eclipse.ui/
See the results attached below and note that revision 211.1.2 is missing in the second case.
I hope this results can be used by some bzr gurus to diagnose the problem.
However, the proposed patch simplifies the code in bzr-xmloutput and IMHO is still worth applying even if the actual issue is fixed somehow in bzr.

1) bzr log --include-merged --limit 7
------------------------------------------------------------
revno: 213 [merge]
committer: Guillermo Gonzalez <email address hidden>
branch nick: trunk
timestamp: Thu 2009-07-09 17:40:43 -0300
message:
  merge lp:~verterok/bzr-eclipse/add-ignore
    ------------------------------------------------------------
    revno: 212.1.4
    committer: Guillermo Gonzalez <email address hidden>
    branch nick: add-ignore
    timestamp: Thu 2009-07-09 17:29:33 -0300
    message:
      fix IgnoredCommand to be compatible with eclipse >= 3.3
      include commons-logging in core.tests classpath
    ------------------------------------------------------------
    revno: 212.1.3
    committer: Guillermo Gonzalez <email address hidden>
    branch nick: add-ignore
    timestamp: Thu 2009-07-09 15:33:49 -0300
    message:
      update bzr-java-lib deps
    ------------------------------------------------------------
    revno: 212.1.2
    committer: Guillermo Gonzalez <email address hidden>
    branch nick: add-ignore
    timestamp: Thu 2009-07-09 02:51:20 -0300
    message:
      Use IResource and IBzrResource while handling Ignore/d actions, all resources handling is now in the core
      IgnoredCommand.getIgnored() now returns a Map<IResource, String>
      Fix ignored and ignore (commands and actions) to handle projects that aren't the branch root
    ------------------------------------------------------------
    revno: 212.1.1 [merge]
    committer: Guillermo Gonzalez <email address hidden>
    branch nick: add-ignore
    timestamp: Wed 2009-07-01 00:52:46 -0300
    message:
      merge lp:~javierder/bzr-eclipse/add-ignore
        ------------------------------------------------------------
        revno: 211.1.2 [merge]
        committer: Javier Derderian <email address hidden>
        branch nick: bzr-eclipse-tomerge
        timestamp: Mon 2009-06-01 12:52:23 -0300
        message:
          Merged with lp:~javierder/bzr-eclipse/add-ignore
            ------------------------------------------------------------
            revno: 210.4.6 [merge]
            committer: Javier Derderian <email address hidden>
            branch nick: bzr-eclipse-...

Read more...

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Thanks for working on this.

I'll talk with the bzr devs to see if this is a bzr core issue.

Cheers

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: