Comment #3 on issue 2533 by [email protected]: post-review prefers
/home/login/.git over /home/login/svn/.svn
http://code.google.com/p/reviewboard/issues/detail?id=2533
Yep, that's the one. Though, I realized it's more complicated than that.
Right now, RepositoryInfo doesn't have any information on where the base of
the repository is, locally. That would have to be added to every supported
SCMClient, and that may differ depending on what output the tool provides.
So while that's how I'd prefer this to be done, a simpler (though still
touching each class) modification that would also work is to provide a new
option/.reviewboardrc variable for specifying the type of repository.
I'd call this REPOSITORY_TYPE and have it take a string. One
of "cvs", "clearcase", "git", "mercurial", "perforce", "plastic", or "svn".
What you'd then need to do is modify the SCMClient class (same file) to
have a 'scm_type = None' in the class body (before __init__), and then take
each SCMClient subclass in clients/ and override that variable to be one of
the above strings.
Then in postreview.py, in parse_options, add a "--repository-type" option
that takes one of these, defaulting
to 'get_config_value(configs, 'REPOSITORY_TYPE').
Then in scan_usable_client, in the "for tool in SCMCLIENTS' loop, before
getting the repository info, just do a check like:
if not options.repository_type or options.repository_type ==
tool.scm_type:
# Do the rest of the body for repository_info here.
Touches many files, but it's a bit simpler to do and will actually be
faster in many cases for users who use it (since it won't have to call into
every tool on the system that it finds). It's mostly some copy and paste
for the strings and add_option.
I'll be happy to answer any questions on this.
--
You received this message because you are subscribed to the Google Groups
"reviewboard-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/reviewboard-issues?hl=en.