- Change Summary:
-
Tinkered with client/__init__.py and client/git.py to help get rid of the unneeded dependency on certain options for certain commands. The changes should have no harmful effect on other components that use SCM related functions.
RB Global Changes
Review Request #3612 — Created Dec. 2, 2012 and submitted
Addresses some "pull up refactoring" of rb command based code and illegal/invalid attribute access (rectified with getattr(options, "field", default_value) method). Please apply this patch before applying any of the newer RB commands (patch [r/3440], attach[r/3599], close[r/3595], publish, diff[r/3429]).
Individual testing of each command that branched off of this feature was tested for functionality. Heavily tested in both SVN, Git, and some Hg.
Description | From | Last Updated |
---|---|---|
print the error seems harmless, but should I log it instead? This is the equivalent to user not providing any … |
JS jsintal | |
Alphabetical. |
SL slchen | |
While this works, the flag is a bool, so the fallback should be False. |
chipx86 | |
Alphabetical. |
chipx86 | |
Trim the spaces. |
chipx86 | |
I don't know how I feel about this happening inside get_server_url. It's a side effect which isn't obvious. How about … |
SM smacleod | |
This needs to be a little more complex. Take a look at how "rb open" is instantiating the client. It … |
SM smacleod | |
Alignment here is a tad off, because of the nested parens. It should be: if ((getattr(options, 'p4_client', None) or getattr(options, … |
david |
-
It looks like you're adding all the AttributeError checks for when the options structure doesn't contain certain items, but I would much rather try to eliminate the calls to these methods that use them entirely when they're not needed.
- Description:
-
~ For John's set of commands (rb patch/close/attach/diff), this introduces some global/generic changes, mostly addressing refactoring of base command code.
~ For John's set of commands (rb patch/close/attach/diff), this introduces some global/generic changes, mostly addressing illegal/invalid access of certain options.
- - TODO:
- Remove the root cause of the extra/uneeded options
-
This is looking pretty good. A few very tiny things and then I'm happy. We'll want to down the road split up some of those diff functions, I think, so that we're not trying to generate the guessed fields while doing the diff, but that's not important for any of your changes.
-
-
-
-
In the future we'll definitely want to put some solid effort into dealing with the option dependencies, but for now I'm happy with the calls to getattr.
-
I don't know how I feel about this happening inside get_server_url. It's a side effect which isn't obvious. How about we make this method take the tool and respository_info as arguemnts.
-
This needs to be a little more complex. Take a look at how "rb open" is instantiating the client. It provides an auth callback which is used to ask for a username and password if something needs authorization. There should at least be a way to pass it into get_root. We should also probably refactor the auth callback I used for "rb open" into a common place, and use it as a default here.
-
Looks good to me. I'm going to let smacleod push your changes because it looks like the rb-commands isn't in the upstream repo yet.
- Description:
-
~ For John's set of commands (rb patch/close/attach/diff), this introduces some global/generic changes, mostly addressing illegal/invalid access of certain options.
~ Addresses some "pull up refactoring" of rb command based code and illegal/invalid attribute access (rectified with getattr(options, "field", default_value) method).
+ + Please apply this patch before applying any of the newer RB commands (patch [r/3440], attach[r/3599], close[r/3595], publish, diff[r/3429]).
- Testing Done:
-
~ Individual testing of each command that branched off of this feature was tested for functionality.
~ Individual testing of each command that branched off of this feature was tested for functionality.
+ Heavily tested in both SVN, Git, and some Hg.