Comment 4 for bug 551351

Revision history for this message
Piotr Piastucki (piastucki) wrote :

testAnnotate and testStatus can be fixed in bzr-java-lib by changing the respective asserts. Symlinks are expanded by bzr when branch root path is calculated hence they will not appear in the resulting paths and we need to compare canonical paths instead of absolute paths.

testIgnored fails because of the bug in xmloutput plugin. The following piece of code in lsxml.py is broken as it:
1) appends relative path to prefix, which will contain a symlink rather than the actual path
2) tries to find the relative path using branch root, which contains the actual path rather than a symlink.
3) As a result the correct relative path is not found and pattern lookup fails

            if prefix:
                fp = osutils.pathjoin(prefix, fp)
            if fid is None:
                fid = ''
            else:
                fid = '<id>%s</id>' % _escape_cdata(fid)
            fkind = '<kind>%s</kind>' % fkind
            status_kind = '<status_kind>%s</status_kind>' % long_status_kind[fc]
            fpath = '<path>%s</path>' % _escape_cdata(fp)
            if fc == 'I' and ignored:
                # get the pattern
                if tree.basedir in fp:
                    pat = tree.is_ignored(tree.relpath(fp))
                else:
                    pat = tree.is_ignored(fp)
                pattern = '<pattern>%s</pattern>' % _escape_cdata(pat)

This should be changed to:

            if fc == 'I' and ignored:
                # get the pattern
                pat = tree.is_ignored(fp)
                pattern = '<pattern>%s</pattern>' % _escape_cdata(pat)
            else:
                pattern = ''
            if prefix:
                fp = osutils.pathjoin(prefix, fp)
            if fid is None:
                fid = ''
            else:
                fid = '<id>%s</id>' % _escape_cdata(fid)
            fkind = '<kind>%s</kind>' % fkind
            status_kind = '<status_kind>%s</status_kind>' % long_status_kind[fc]
            fpath = '<path>%s</path>' % _escape_cdata(fp)