Merge lp:~piastucki/bzr-xmloutput/fix-551351-ignored-in-symlink-root into lp:bzr-xmloutput
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 174 | ||||
Proposed branch: | lp:~piastucki/bzr-xmloutput/fix-551351-ignored-in-symlink-root | ||||
Merge into: | lp:bzr-xmloutput | ||||
Diff against target: |
57 lines (+23/-9) 2 files modified
lsxml.py (+6/-9) tests/test_ls_xml.py (+17/-0) |
||||
To merge this branch: | bzr merge lp:~piastucki/bzr-xmloutput/fix-551351-ignored-in-symlink-root | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guillermo Gonzalez | Approve | ||
Review via email: mp+173101@code.launchpad.net |
Description of the change
This patch fixes the way ignored files are handled in case the branch is access via symlink rather than a real path.
Invoking xmlls in the following way
bzr xmlls --ignored symlink
Results in an error (see traceback below) because the code first concatenates the symlink with the relative path of the ignored file and then tries to get the relative path by calling tree.relpath(fp). tree.relpath(fp) cannot find the relative path as bzr seems to expand symlinks so that the branch root (tree.basedir) contains the actual path.
The fix changes the order of pattern lookup and path concatenation and completely removes the need to call tree.relpath(fp).
Traceback:
0.102 Traceback (most recent call last):
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
lsxml.
File "/usr/lib/
pattern = '<pattern>
File "/usr/lib/
text = text.replace("&", "&")
AttributeError: 'NoneType' object has no attribute 'replace'
Thanks for working on this, can I ask you to add a test case for it?
Thanks.