Merge lp://qastaging/~garyvdm/bzr/bug492116-ls-file into lp://qastaging/bzr
Status: | Superseded |
---|---|
Proposed branch: | lp://qastaging/~garyvdm/bzr/bug492116-ls-file |
Merge into: | lp://qastaging/bzr |
Diff against target: |
615 lines (+235/-141) (has conflicts) 8 files modified
bzrlib/builtins.py (+21/-16) bzrlib/revisiontree.py (+30/-13) bzrlib/tests/blackbox/test_ls.py (+4/-0) bzrlib/tests/per_tree/test_list_files.py (+56/-82) bzrlib/transform.py (+44/-7) bzrlib/workingtree.py (+34/-10) bzrlib/workingtree_4.py (+31/-13) doc/en/release-notes/bzr-2.3.txt (+15/-0) Text conflict in bzrlib/transform.py Text conflict in doc/en/release-notes/bzr-2.3.txt |
To merge this branch: | bzr merge lp://qastaging/~garyvdm/bzr/bug492116-ls-file |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
bzr-core | Pending | ||
Review via email: mp+45679@code.qastaging.launchpad.net |
Description of the change
This makes ``bzr ls FILE`` list the file passed, similar to how GNU coreutils ``ls`` behaves.
To achieve this, I changed the behavior of the ``Tree.list_files`` methods so that if passed a file, they will yield just the file.
I originally hoped that this would not be necessary, and that I could just make the necessary changes in ``builtins.
A possible alternative to this is:
The inventory entry is only used in builtins.cmd_ls to get a entry.kind_
Unmerged revisions
- 5590. By Vincent Ladeuil
-
Fix typo.
- 5589. By Vincent Ladeuil
-
Yes, root is always a dir, use osutils instead of os.path, fix typo, remove commented out debugger call.
- 5588. By Vincent Ladeuil
-
Remove debugger call.
- 5587. By Vincent Ladeuil
-
Remove duplicated code in tests.
- 5586. By Vincent Ladeuil
-
Replace try/finally by addCleanup.
- 5585. By Gary van der Merwe
-
Make ``bzr ls FILE`` list the file passed, simillar to how GNU coreutils ``ls`` behaves.
- 5584. By Gary van der Merwe
-
Test ``Tree.
list_files( from_dir= ...) does deprecated warning. - 5583. By Gary van der Merwe
-
Change all ``Tree.list_files`` methods so that if passed a file, rather than a directory, they will yield just the file.
In order to represent this, the ``from_dir`` argument has been renamed to ``from_path``, and the ``from_dir`` argument is deprecated.
This looks good !
I've fixed a couple of minor issues while I was reviewing it (lp:~vila/bzr/bug492116-ls-file), you may want to integrate them:
- yes, root is always a dir,
- don't use os.path when we have an osutils function for it,
- a couple of typos ;)
- some test code duplication.
On the overall, I'm a bit worried of the code duplication there, but you're not responsible for it for the most part so it's probably out of scope to fix them here. BUT, your proposed alternative may avoid to add more of it so may be it would be better to try to add the tree.kind_character method.