Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index fa04059d9b5eb1d72eeeb11eba14e18af6b3e0d9..6803142076b4d2fd37782de2ad624f52b93393a0 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -267,9 +267,17 @@ class Settings(object): |
| def LazyUpdateIfNeeded(self): |
| """Updates the settings from a codereview.settings file, if available.""" |
| if not self.updated: |
| + noautoupdate = RunGit(['config', 'rietveld.noautoupdate'], error_ok=True |
| + ).strip().lower() |
|
iannucci
2013/12/17 00:21:39
polarity should reverse to 'autoupdate'
|
| + if noautoupdate == 'true': |
| + self.updated = True |
| + return |
|
iannucci
2013/12/17 00:21:39
then this block can go away.
|
| + |
| cr_settings_file = FindCodereviewSettingsFile() |
| if cr_settings_file: |
|
iannucci
2013/12/17 00:21:39
if autoupdate and cr_settings_file:
|
| LoadCodereviewSettingsFromFile(cr_settings_file) |
| + # set updated to True to avoid infinite calling loop |
| + # through DownloadHooks |
| self.updated = True |
| DownloadHooks(False) |
| self.updated = True |
| @@ -1079,7 +1087,22 @@ def DownloadHooks(force): |
| def CMDconfig(parser, args): |
| """Edits configuration for this tree.""" |
| - _, args = parser.parse_args(args) |
| + parser.add_option('--activate-update', action='store_true', |
| + help='activate auto-updating [rietveld] section in ' |
| + '.git/config') |
|
ghost stip (do not use)
2013/12/16 19:20:23
align '.git with 'activate
|
| + parser.add_option('--deactivate-update', action='store_true', |
|
iannucci
2013/12/17 00:21:39
Hm... I think these should both have dest='activat
|
| + help='deactivate auto-updating [rietveld] section in ' |
| + '.git/config') |
|
ghost stip (do not use)
2013/12/16 19:20:23
same
|
| + options, args = parser.parse_args(args) |
| + |
| + if options.deactivate_update: |
| + RunGit(['config', 'rietveld.noautoupdate', 'true']) |
|
iannucci
2013/12/17 00:21:39
option should be rietveld.autoupdate
|
| + return |
| + |
| + if options.activate_update: |
| + RunGit(['config', '--unset', 'rietveld.noautoupdate']) |
| + return |
| + |
| if len(args) == 0: |
| GetCodereviewSettingsInteractively() |
| DownloadHooks(True) |