def GetRietveldCodereviewSettingsInteractively():
    'Prompt the user for settings.'
    server = settings.GetDefaultServerUrl(error_ok=True)
    prompt = 'Rietveld server (host[:port])'
    prompt += (' [%s]' % (server or DEFAULT_SERVER))
    newserver = ask_for_data((prompt + ':'))
    if ((not server) and (not newserver)):
        newserver = DEFAULT_SERVER
    if newserver:
        newserver = gclient_utils.UpgradeToHttps(newserver)
        if (newserver != server):
            RunGit(['config', 'rietveld.server', newserver])

    def SetProperty(initial, caption, name, is_url):
        prompt = caption
        if initial:
            prompt += (' ("x" to clear) [%s]' % initial)
        new_val = ask_for_data((prompt + ':'))
        if (new_val == 'x'):
            RunGit(['config', '--unset-all', ('rietveld.' + name)], error_ok=True)
        elif new_val:
            if is_url:
                new_val = gclient_utils.UpgradeToHttps(new_val)
            if (new_val != initial):
                RunGit(['config', ('rietveld.' + name), new_val])
    SetProperty(settings.GetDefaultCCList(), 'CC list', 'cc', False)
    SetProperty(settings.GetDefaultPrivateFlag(), 'Private flag (rietveld only)', 'private', False)
    SetProperty(settings.GetTreeStatusUrl(error_ok=True), 'Tree status URL', 'tree-status-url', False)
    SetProperty(settings.GetViewVCUrl(), 'ViewVC URL', 'viewvc-url', True)
    SetProperty(settings.GetBugPrefix(), 'Bug Prefix', 'bug-prefix', False)
    SetProperty(settings.GetRunPostUploadHook(), 'Run Post Upload Hook', 'run-post-upload-hook', False)
Prompt the user for settings.
def GetRietveldCodereviewSettingsInteractively():
    
    server = settings.GetDefaultServerUrl(error_ok=True)
    prompt = 'Rietveld server (host[:port])'
    prompt += (' [%s]' % (server or DEFAULT_SERVER))
    newserver = ask_for_data((prompt + ':'))
    if ((not server) and (not newserver)):
        newserver = DEFAULT_SERVER
    if newserver:
        newserver = gclient_utils.UpgradeToHttps(newserver)
        if (newserver != server):
            RunGit(['config', 'rietveld.server', newserver])

    def SetProperty(initial, caption, name, is_url):
        prompt = caption
        if initial:
            prompt += (' ("x" to clear) [%s]' % initial)
        new_val = ask_for_data((prompt + ':'))
        if (new_val == 'x'):
            RunGit(['config', '--unset-all', ('rietveld.' + name)], error_ok=True)
        elif new_val:
            if is_url:
                new_val = gclient_utils.UpgradeToHttps(new_val)
            if (new_val != initial):
                RunGit(['config', ('rietveld.' + name), new_val])
    SetProperty(settings.GetDefaultCCList(), 'CC list', 'cc', False)
    SetProperty(settings.GetDefaultPrivateFlag(), 'Private flag (rietveld only)', 'private', False)
    SetProperty(settings.GetTreeStatusUrl(error_ok=True), 'Tree status URL', 'tree-status-url', False)
    SetProperty(settings.GetViewVCUrl(), 'ViewVC URL', 'viewvc-url', True)
    SetProperty(settings.GetBugPrefix(), 'Bug Prefix', 'bug-prefix', False)
    SetProperty(settings.GetRunPostUploadHook(), 'Run Post Upload Hook', 'run-post-upload-hook', False)