示例#1
0
def vcs_clone(request, response):
    user = request.user
    source = request.POST.get("source")
    taskname = "Clone/checkout"
    if source:
         taskname += " from %s" % (source)
    jobid = vcs.clone(user, **dict(request.POST))
    response.content_type = "application/json"
    response.body = simplejson.dumps(dict(jobid=jobid, taskname=taskname))
    return response()
示例#2
0
def vcs_clone(request, response):
    user = request.user
    source = request.POST.get("source")
    taskname = "Clone/checkout"
    if source:
        taskname += " from %s" % (source)
    jobid = vcs.clone(user, **dict(request.POST))
    response.content_type = "application/json"
    response.body = simplejson.dumps(dict(jobid=jobid, taskname=taskname))
    return response()
示例#3
0
文件: test_vcs.py 项目: spot/bespin
def test_run_an_hg_clone(run_command_params):
    _init_data()
    output = vcs.clone(macgyver, source="http://hg.mozilla.org/labs/bespin")
    command, context = run_command_params
    
    assert isinstance(command, hg.clone)
    working_dir = context.working_dir
    assert working_dir == macgyver.get_location()
    assert output == clone_output
    assert str(command) == "clone http://hg.mozilla.org/labs/bespin bespin"
    
    bespin = model.get_project(macgyver, macgyver, "bespin")
    metadata = bespin.metadata
    
    assert 'remote_auth' not in metadata
    assert 'push' not in metadata
    assert metadata['remote_url'] == "http://hg.mozilla.org/labs/bespin"
    metadata.close()
示例#4
0
def vcs_clone(request, response):
    user = request.user
    output = vcs.clone(user, **dict(request.POST))
    response.content_type = "application/json"
    response.body = simplejson.dumps(dict(output=output))
    return response()