Browse files

Allow using --diff-filename=- with a valid cookie.

When using --diff-filename=-, there was a check to make sure that users wouldn't
have to type in their username and password (since stdin was used up by the
pipe), but this check didn't take into account that there might be a cookie with
the authentication information. This made it okay for automation but kind of
lame for people who actually wanted to use pipes themselves.

Fixes bug 2052.
  • Loading branch information...
1 parent 1356362 commit 91ca2eb5f037df0756debf0a442ed14fba9e6d1e @davidt davidt committed Feb 13, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 rbtools/
@@ -320,8 +320,8 @@ def login(self, force=False):
information if needed.
if (options.diff_filename == '-' and
- not options.username and not options.submit_as and
- not options.password):
+ not self.has_valid_cookie() or
+ (options.username and options.password)):
die('Authentication information needs to be provided on '
'the command line when using --diff-filename=-')

1 comment on commit 91ca2eb

This chance should actually be:

not self.has_valid_cookie() and
not (options.username and options.password)):

Otherwise --diff-filename=- fails when you supply the username and password as command line arguments

Please sign in to comment.