Changeset 89209 in webkit


Ignore:
Timestamp:
Jun 18, 2011 6:55:24 PM (13 years ago)
Author:
dbates@webkit.org
Message:

2011-06-18 Daniel Bates <dbates@webkit.org>

Reviewed by Eric Seidel.

Git.push_local_commits_to_server should use password username and
password when we don't have cached credentials
https://bugs.webkit.org/show_bug.cgi?id=62941

Fixes a issue where Git.push_local_commits_to_server() would always look
for cached credentials regardless of whether a username and password
were passed as arguments. Instead, if given both a username and password
then we shouldn't look for cached credentials (since we were explicitly given
credentials).

  • Scripts/webkitpy/common/checkout/scm/git.py:
  • Scripts/webkitpy/common/checkout/scm/scm_unittest.py: Added unit tests.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r89208 r89209  
     12011-06-18  Daniel Bates  <dbates@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Git.push_local_commits_to_server should use password username and
     6        password when we don't have cached credentials
     7        https://bugs.webkit.org/show_bug.cgi?id=62941
     8
     9        Fixes a issue where Git.push_local_commits_to_server() would always look
     10        for cached credentials regardless of whether a username and password
     11        were passed as arguments. Instead, if given both a username and password
     12        then we shouldn't look for cached credentials (since we were explicitly given
     13        credentials).
     14
     15        * Scripts/webkitpy/common/checkout/scm/git.py:
     16        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py: Added unit tests.
     17
    1182011-06-18  Daniel Bates  <dbates@rim.com>
    219
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py

    r85988 r89209  
    401401        if self.dryrun:
    402402            dcommit_command.append('--dry-run')
    403         if not self.has_authorization_for_realm(SVN.svn_server_realm):
     403        if (not username or not password) and not self.has_authorization_for_realm(SVN.svn_server_realm):
    404404            raise AuthenticationError(SVN.svn_server_host, prompt_for_password=True)
    405405        if username:
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

    r85452 r89209  
    14591459        OutputCapture().assert_outputs(self, self.scm.create_patch, kwargs={'changed_files': None}, expected_stderr=expected_stderr)
    14601460
     1461    def test_push_local_commits_to_server_with_username_and_password(self):
     1462        self.assertEquals(self.scm.push_local_commits_to_server(username='dbates@webkit.org', password='blah'), "MOCK output of child process")
     1463
     1464    def test_push_local_commits_to_server_without_username_and_password(self):
     1465        self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server)
     1466
     1467    def test_push_local_commits_to_server_with_username_and_without_password(self):
     1468        self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server, {'username': 'dbates@webkit.org'})
     1469
     1470    def test_push_local_commits_to_server_without_username_and_with_password(self):
     1471        self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server, {'password': 'blah'})
    14611472
    14621473if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.