- Change Summary:
-
Added some defensive programming to prevent the Nonetype error and updated testing done to reflect the new results. Now at least the error message is indicative of the underlying problem, instead of completely unrelated.
- Summary:
-
[WIP] Removing broken git-svn codepath.[WIP] Give better error messages when bug 3273 is hit.
- Description:
-
+ 2 patch stack:
+ + + + Removing broken git-svn codepath.
+ The attribute self.merge_base has not been valid since
029787313887e85444b1372a35ec1a727ee859d1 went in. ~ We're playing a bit of traceback hockey here, to track down the underlying issues, hence WIP.
~ + + Short circuit when the diff is None.
+ + Previously, some diff routines would return none, instead of an
+ empty string (see bug 3273) for discussion. Now at we'll get the + expected "There don't seem to be any diffs!" error instead of + "object of type 'NoneType' has no len()". - Testing Done:
-
Before:
$ rbt post --debug -g --tracking-branch master --parent HEAD^
// snip details....
Traceback (most recent call last):
File "/usr/local/bin//rbt", line 9, in <module>
load_entry_point('RBTools==0.6alpha0.dev', 'console_scripts', 'rbt')()
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/main.py", line 127, in main
command.run_from_argv([RB_MAIN] + args)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/__init__.py", line 361, in run_from_argv
exit_code = self.main(*args) or 0
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/post.py", line 680, in main
extra_args=extra_args)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/git.py", line 421, in diff
diff_lines = self.make_diff(revisions['base'], revisions['tip'], files)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/git.py", line 472, in make_diff
return self.make_svn_diff(base, diff_lines)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/git.py", line 486, in make_svn_diff
if not rev and self.merge_base:
AttributeError: 'GitClient' object has no attribute 'merge_base'
After:
$ rbt post --debug -g --tracking-branch master --parent HEAD^
// snip details....
Traceback (most recent call last):
File "/usr/local/bin//rbt", line 9, in <module>
load_entry_point('RBTools==0.6alpha0.dev', 'console_scripts', 'rbt')()
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/main.py", line 127, in main
command.run_from_argv([RB_MAIN] + args)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/__init__.py", line 361, in run_from_argv
~ exit_code = self.main(*args) or 0
~ File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/post.py", line 687, in main
~ if len(diff) == 0:
~ TypeError: object of type 'NoneType' has no len()
~ exit_code = self.main(*args) or 0
~ File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/post.py", line 688, in main
~ raise CommandError("There don't seem to be any diffs!")
~ rbtools.commands.CommandError: There don't seem to be any diffs!
- Commit:
-
dc9eff9799208ea0d879f04fddee29e6aa84d099949bada16b27952775dd8a1a30506a0cd8c1981b
[WIP] Give better error messages when bug 3273 is hit.
Review Request #5624 — Created March 14, 2014 and discarded
2 patch stack:
Removing broken git-svn codepath.
The attribute self.merge_base has not been valid since
029787313887e85444b1372a35ec1a727ee859d1 went in.
Short circuit when the diff is None.
Previously, some diff routines would return None instead of an
empty string (see bug 3273 for discussion). Now at we'll get the
expected "There don't seem to be any diffs!" error instead of
"object of type 'NoneType' has no len()".
Before:
$ rbt post --debug -g --tracking-branch master --parent HEAD^ // snip details.... Traceback (most recent call last): File "/usr/local/bin//rbt", line 9, in <module> load_entry_point('RBTools==0.6alpha0.dev', 'console_scripts', 'rbt')() File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/main.py", line 127, in main command.run_from_argv([RB_MAIN] + args) File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/__init__.py", line 361, in run_from_argv exit_code = self.main(*args) or 0 File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/post.py", line 680, in main extra_args=extra_args) File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/git.py", line 421, in diff diff_lines = self.make_diff(revisions['base'], revisions['tip'], files) File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/git.py", line 472, in make_diff return self.make_svn_diff(base, diff_lines) File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/clients/git.py", line 486, in make_svn_diff if not rev and self.merge_base: AttributeError: 'GitClient' object has no attribute 'merge_base'
After:
$ rbt post --debug -g --tracking-branch master --parent HEAD^ // snip details.... Traceback (most recent call last): File "/usr/local/bin//rbt", line 9, in <module> load_entry_point('RBTools==0.6alpha0.dev', 'console_scripts', 'rbt')() File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/main.py", line 127, in main command.run_from_argv([RB_MAIN] + args) File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/__init__.py", line 361, in run_from_argv exit_code = self.main(*args) or 0 File "/usr/local/lib/python2.7/dist-packages/RBTools-0.6alpha0.dev-py2.7.egg/rbtools/commands/post.py", line 688, in main raise CommandError("There don't seem to be any diffs!") rbtools.commands.CommandError: There don't seem to be any diffs!
- Change Summary:
-
Fixed some typos in the description.
- Description:
-
2 patch stack:
Removing broken git-svn codepath.
The attribute self.merge_base has not been valid since
029787313887e85444b1372a35ec1a727ee859d1 went in. Short circuit when the diff is None.
~ Previously, some diff routines would return none, instead of an
~ empty string (see bug 3273) for discussion. Now at we'll get the ~ Previously, some diff routines would return None instead of an
~ empty string (see bug 3273 for discussion). Now at we'll get the expected "There don't seem to be any diffs!" error instead of "object of type 'NoneType' has no len()".