Added --(de)activate-update options
These options have been added to the 'git cl config' subcommand.
--deactivate-update tells git cl not to update the values inside
.git/config from the codereview.settings file. --activate-update does
the opposite.
This is designed for testing/development purposes only, for example, to
be able to change the rietveld URL.
BUG=327901
Review URL: https://codereview.chromium.org/104043008
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@242943 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index 0cd6fea..98ae586 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -146,6 +146,7 @@
'-M'+similarity, 'fake_ancestor_sha', 'HEAD'],), '+dat')
return [
+ ((['git', 'config', 'rietveld.autoupdate'],), ''),
((['git', 'config', 'rietveld.server'],),
'codereview.example.com'),
((['git', 'symbolic-ref', 'HEAD'],), 'master'),
@@ -250,6 +251,8 @@
'svn-remote.svn.fetch trunk/src:refs/remotes/origin/master'),
None),
0)),
+ ((['git', 'config', 'rietveld.autoupdate'],),
+ ''),
((['git',
'config', 'rietveld.server'],), 'codereview.example.com'),
((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'),
@@ -382,6 +385,7 @@
private = '--private' in upload_args
self.calls = self._upload_calls(similarity, find_copies, private)
+
def RunEditor(desc, _, **kwargs):
self.assertEquals(
'# Enter a description of the change.\n'
@@ -393,12 +397,14 @@
desc)
return returned_description
self.mock(git_cl.gclient_utils, 'RunEditor', RunEditor)
+
def check_upload(args):
cmd_line = self._cmd_line(final_description, reviewers, similarity,
find_copies, private)
self.assertEquals(cmd_line, args)
return 1, 2
self.mock(git_cl.upload, 'RealMain', check_upload)
+
git_cl.main(['upload'] + upload_args)
def test_no_reviewer(self):
@@ -515,6 +521,8 @@
@classmethod
def _gerrit_base_calls(cls):
return [
+ ((['git', 'config', 'rietveld.autoupdate'],),
+ ''),
((['git',
'config', 'rietveld.server'],), 'codereview.example.com'),
((['git', 'symbolic-ref', 'HEAD'],), 'master'),
@@ -651,6 +659,8 @@
self.mock(git_cl, 'urlretrieve', self._mocked_call)
self.mock(git_cl, 'hasSheBang', self._mocked_call)
self.calls = [
+ ((['git', 'config', 'rietveld.autoupdate'],),
+ ''),
((['git', 'config', 'rietveld.server',
'gerrit.chromium.org'],), ''),
((['git', 'config', '--unset-all', 'rietveld.cc'],), ''),