wise1372 Posted February 6, 2012 Report Share Posted February 6, 2012 Doing the fast import to our new install resulted in all the branches losing their owners. Can this be changed and the original owners regained? If not how can I change the owner I of the imported branches? The branches imported under my account with me as the owner and when I set a query in the GUI for my branches everything is shaded/color for me. At a minimum I want the ownership changed to our admin account so going forward my ownerships are correct. Link to comment Share on other sites More sharing options...
psantosl Posted February 14, 2012 Report Share Posted February 14, 2012 That's true. It is a pain, and it is true. It is simple to use with the setowner command. Is it ok? Do you need more help? Link to comment Share on other sites More sharing options...
dave Posted February 14, 2012 Report Share Posted February 14, 2012 Hi, try these commands to automate setowner (inside a workspace pointing to the repository you want to set owners) cm find branches --format={name} --nototal >out.txt for /f %i in (out.txt) do cm setowner -user=dave br:%i Hope it helps, David Link to comment Share on other sites More sharing options...
wise1372 Posted February 20, 2012 Author Report Share Posted February 20, 2012 David, Almost there what do I do when the branch name is to long and gets chopped off? we have some long branch names and I can't figure out how to set them up because the file truncates them. Link to comment Share on other sites More sharing options...
manu Posted February 21, 2012 Report Share Posted February 21, 2012 Hi wise1372, the "cm find" command should not chop the branch name, it's like a SQL query. Can you please post here a chopped branch name example? Link to comment Share on other sites More sharing options...
wise1372 Posted February 21, 2012 Author Report Share Posted February 21, 2012 You were correct it wasn't the find command failing it was the for command because it was written to presume our branch names didn't have spaces in them. The updated command sets that resolved the problem were: Output the branch names with quotes around them: cm find branches --format="\"{name}\"" --nototal > out.txt By default the for command uses spaces and tabs as the delimiter, bad if your branch names contain spaces. Since we exported the filenames above with quotes we can use the usebackq option and no delimiters to get the full branch name with: for /f "usebackq delims=" %i in (out.txt) do cm setowner -user=Admin br:%i Link to comment Share on other sites More sharing options...
manu Posted February 21, 2012 Report Share Posted February 21, 2012 cm find branches --format="\"{name}\"" --nototal > out.txt for /f "usebackq delims=" %i in (out.txt) do cm setowner -user=Admin br:%i Yep! That's the right way if your branches have spaced in them! Perfect. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.