add new command rbt list-repos to list repositories configured on a server
Review Request #6526 — Created Oct. 29, 2014 and discarded
When reviewboard server contains several repositories (currently we get 400)
it is hard to know which already exists and which are accessible for a user.
To prevent granting all users to staff, we propose this new rbtools command.
We expect people could be interested in such command and maybe someone extend
it (filtering options, improve formatting ...)
can list repositories from any working directory (inside or outside a local scm repository) Repositories on https://reviews.reviewboard.org: tool | name | path -----+---------------------+--------------------------------------------------- Git | Djblets | git://github.com/djblets/djblets.git [...] Git | Reviewboard Persona | git://github.com/smacleod/reviewboard-persona.git [...]
Description | From | Last Updated |
---|---|---|
For the rbtools master branch, any new files should have from __future__ import unicode_literals as the first line (followed by … |
david | |
I don't see a ton of reason to have this be a separate method instead of just putting this code … |
david | |
You should add from __future__ import print_statement at the top and then use print(...), for Python 3.x compatibility. It would … |
david | |
Can you add from six.moves import input and change raw_input to input? |
david | |
Can you have this be the first thing that the main() method does? It's odd to prompt the user for … |
david | |
'json' imported but unused |
reviewbot | |
Col: 52 E231 missing whitespace after ',' |
reviewbot | |
Col: 65 E231 missing whitespace after ':' |
reviewbot | |
Col: 19 E211 whitespace before '(' |
reviewbot | |
'json' imported but unused |
reviewbot | |
These should be in alphabetical order. |
brennie | |
'json' imported but unused |
reviewbot | |
This could be: pattern = ' | '.join([ '%%-%ds' % len for len in col_len ]) |
david | |
With new rbtools code, this can be: for repo in repositories.all_items: ... |
david | |
'json' imported but unused |
reviewbot | |
Col: 13 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 13 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
For pep-8 formatting, the six import should come first, followed by a blank line, then the rbtools import. |
david | |
This isn't quite as efficient as it could be (we convert types and compute length multiple times). How about: column_widths … |
david | |
Let's just put this inline into the print() call instead of assigning it first to a variable. |
david | |
It would be nice to capitalize the words in the header. |
david | |
Can we use repo.get(x, '')? It's a little bit more explicit and error-safe. |
david |
-
-
For the rbtools master branch, any new files should have
from __future__ import unicode_literals
as the first line (followed by a blank line, then any additional imports) -
I don't see a ton of reason to have this be a separate method instead of just putting this code at the end of
main()
-
You should add
from __future__ import print_statement
at the top and then useprint(...)
, for Python 3.x compatibility.It would also be very nice to have this check the length of each of the entries and print out a nicely-formatted table, rather than just using a single tab.
-
-
Can you have this be the first thing that the
main()
method does? It's odd to prompt the user for the server URL and then error out on args.
- Change Summary:
-
Add support for python3 using six and __future__ import as recommended in code review Add pretty_print_table function to improve output formatting
- Commit:
-
86c43ea69b18fce70d315ab7a16e35cd6440d0b868c2156b16230d7481dafe1c77a2b29317570bc2
- Change Summary:
-
fix reviewbot issues
- Testing Done:
-
can list repositories from any working directory (inside or outside a local scm repository)
~ Repositories:
~ Name Path SCM ~ gitolite:repo1 git@gitolite.company.com:repo1 Git ~ /vobs/myvob /view/reviewboard_view/vobs/myvob ClearCase ~ Repositories on https://reviews.reviewboard.org:
~ tool | name | path ~ -----+---------------------+--------------------------------------------------- ~ Git | Djblets | git://github.com/djblets/djblets.git + [...] + Git | Reviewboard Persona | git://github.com/smacleod/reviewboard-persona.git [...]
- Change Summary:
-
fix import order
- Commit:
-
68c2156b16230d7481dafe1c77a2b29317570bc26ebf6f53c3a221ca2693c959476cf429e3079efb
-
Tool: Pyflakes Processed Files: rbtools/commands/list_repos.py setup.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/list_repos.py setup.py
-
-
For pep-8 formatting, the six import should come first, followed by a blank line, then the rbtools import.
-
This isn't quite as efficient as it could be (we convert types and compute length multiple times). How about:
column_widths = [ max([len(six.text_type(row[i])) for row in rows]) for i in range(len(rows[0])) ]
-
-
-