copy project and create new vcs root with REST API

i have a project that has a shared vcs root. i want to copy said project, but without sharing the vcs root. the parameter shareVCSRoots='false' does not seem to act as i'd expect. i would like to create a new vcs root and associate it with the new, copied project. all other settings on the new project should be the same as the source project.

is this possible using the REST API? i feel like i am so close. i can do most of the steps with the API, but for making a copy of the vcs root which needs to be done with the web interface manually afterwards. please help.

thanks.

5 comments
Comment actions Permalink

Hi George,

Seems like alike issue is discussed in http://youtrack.jetbrains.com/issue/TW-20394
Is the behavior in REST API different from that in the web UI?
If yes, can you please detail the difference and note the actual results?
Please also note shared/not shared  setting of the VCS root.

0
Comment actions Permalink

when i copy with the UI, i manually change the vcs root name and url, and then select 'Apply to all templates & configurations of MY_NEW_PROJECT project where this VCS root is used (a copy of this VCS root will be created)'. it is this step that i am not sure how to do with the REST API.

if i create a new VCS root for the new project with the REST API, then it shows as an additional root, but it is also still shows the one shared from the source project. and the builds get triggered by changes to the source project's vcs.

if feels like i should be making the copy of the project, and then editing the vcs root of this new project. if a copy of a shared one needs to be made (like selecting the radio button mentioned above) before editing, i can't how this might be done.

edit: the project i am copying from has shared vcs roots.

thanks.

0
Comment actions Permalink

George,

> i manually change the vcs root name and url, and then select 'Apply to all templates & configurations of MY_NEW_PROJECT project where this VCS root is used (a copy of this VCS root will be  created)'. it is this step that i am not sure how to do with the REST API.

With the REST API there are no such options, but you can do whatever you like (copy/change/ attach/detach) with the API just doing several operations instead.


>  if a copy of a shared one needs to be made (like selecting the radio  button mentioned above) before editing, i can't how this might be done.

Doesn't " shareVCSRoots='false' " work for you?

I am still not sure wht is the issue here. Would it be possible to detail one specific case with allthe the relevant VCS root settings, used REST request and expected/actual result?

0
Comment actions Permalink

And how can i copy a vcs root ?

or attach

0
Comment actions Permalink

> And how can i copy a vcs root ?

There is no dedicated operation to copy, but you can create a new VCS root with all the settings as in already existing one.

> or attach

By POSTing to app/rest/buildTypes/XXX/vcs-root-entries XML like returned via app/rest/buildTypes/XXX/vcs-root-entries/YYY

0

Please sign in to leave a comment.