Title: [89209] trunk/Tools
Revision
89209
Author
[email protected]
Date
2011-06-18 18:55:24 -0700 (Sat, 18 Jun 2011)

Log Message

2011-06-18  Daniel Bates  <[email protected]>

        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.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (89208 => 89209)


--- trunk/Tools/ChangeLog	2011-06-19 00:41:21 UTC (rev 89208)
+++ trunk/Tools/ChangeLog	2011-06-19 01:55:24 UTC (rev 89209)
@@ -1,3 +1,20 @@
+2011-06-18  Daniel Bates  <[email protected]>
+
+        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.
+
 2011-06-18  Daniel Bates  <[email protected]>
 
         Rubber-stamped by Eric Seidel.

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py (89208 => 89209)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py	2011-06-19 00:41:21 UTC (rev 89208)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py	2011-06-19 01:55:24 UTC (rev 89209)
@@ -400,7 +400,7 @@
         dcommit_command = ['git', 'svn', 'dcommit']
         if self.dryrun:
             dcommit_command.append('--dry-run')
-        if not self.has_authorization_for_realm(SVN.svn_server_realm):
+        if (not username or not password) and not self.has_authorization_for_realm(SVN.svn_server_realm):
             raise AuthenticationError(SVN.svn_server_host, prompt_for_password=True)
         if username:
             dcommit_command.extend(["--username", username])

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py (89208 => 89209)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2011-06-19 00:41:21 UTC (rev 89208)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2011-06-19 01:55:24 UTC (rev 89209)
@@ -1458,6 +1458,17 @@
         expected_stderr = "MOCK run_command: ['git', 'merge-base', u'refs/remotes/origin/master', 'HEAD']\nMOCK run_command: ['git', 'diff', '--binary', '--no-ext-diff', '--full-index', '-M', 'MOCK output of child process', '--']\nMOCK run_command: ['git', 'log', '-25']\n"
         OutputCapture().assert_outputs(self, self.scm.create_patch, kwargs={'changed_files': None}, expected_stderr=expected_stderr)
 
+    def test_push_local_commits_to_server_with_username_and_password(self):
+        self.assertEquals(self.scm.push_local_commits_to_server(username='[email protected]', password='blah'), "MOCK output of child process")
 
+    def test_push_local_commits_to_server_without_username_and_password(self):
+        self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server)
+
+    def test_push_local_commits_to_server_with_username_and_without_password(self):
+        self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server, {'username': '[email protected]'})
+
+    def test_push_local_commits_to_server_without_username_and_with_password(self):
+        self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server, {'password': 'blah'})
+
 if __name__ == '__main__':
     unittest.main()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to