none
Issue in adding files to StarTeam Source control

    Question

  • Greetings,

     

    I am experiencing an issue while adding my Visual Studio project to StarTeam. Let me give a brief explanation about the issue,

     

    I have created a project in the following path, C:\Projects\Test\Test\ABC.Project

     

    The outer folder Test has following file(s)/folder(s)

    1. Test.sln file

    2. Test folder

     

    The inner folder Test has following file(s)

    1. ABC.project files

    2. Some .CS files.

     

    I am writing a custom program to add the solution to StarTeam source control by using SCC API's in C++.

     

    While adding StarTeam pop us a window to select the working folder and i selected the working folder "C:\Projects\Test"

     

    After initialization, i am trying to add .CS files to add into the source control and called the Open project API, below is the piece of code

     

    int Manager::ProviderOpenProject()

    {

                    // initialize the scc

                    long   dwFlags;

                    typedef SCCRTN (*SccOpenProject)(void*, HWND, char*, char*, const char*, char*, const char*, LPTEXTOUTPROC, long);

                    SccOpenProject ProcOpenProject;

                    ProcOpenProject = (SccOpenProject) GetProcAddress(MyInstance, "SccOpenProject");

     

                    // If the function address is valid, call the function.

                    if (NULL == ProcOpenProject)

                    {

                                    return SCC_E_NONSPECIFICERROR;

                    }

     

                    dwFlags                =  SCC_OP_CREATEIFNEW;

     

                    return (ProcOpenProject)

                                    (

                                                    MyContext,

                                                    MyWindow,

                                                    MyProviderUserName,

                                                    MyProviderProjectName,

                                                    LocalProjectPath,

                                                    MyProviderAuxillaryPath,

                                                    "",              // comment    on OpenProject() not needed.

                                                    (LPTEXTOUTPROC)0,

                                                    dwFlags

                                    );

    }

     

    LocalProjectPath is "C:\Projects\Test" (default working folder) and used below API to add .CS files

     

    void Manager::BatchAdd

    (

                    const char* fileNames[],                              ///< [in] Names of the files.       

                    const int                               numFiles,            ///< [in] How many files are there?

                    const char* comment                    ///< [in] Comment used during this operation.

    )

    {

                    // initialise the scc api call.

                    typedef SCCRTN (*SccAdd)(void*, HWND, long, const char**, const char*, long*, LPCMDOPTS);

                    SccAdd ProcAdd  = (SccAdd)GetProcAddress(MyInstance, "SccAdd");   

     

                    // If the function address is valid, call the function.

                    if (NULL == ProcAdd)

                                    throw new SCCError(SCC_E_NONSPECIFICERROR);

     

                    int cmdOpts = 0;

                    long* dwFlags = new long[numFiles];

                    std::fill_n(dwFlags, numFiles, SCC_FILETYPE_UTF8);

     

                    ProcessReturnValue

                    (

                                    (ProcAdd)

                                    (

                                                    MyContext,

                                                    MyWindow,

                                                    numFiles,

                                                    fileNames, // E.g C:\Projects\Test\Test\Program.CS.

                                                    comment,

                                                    dwFlags,

                                                    (LPCMDOPTS)&cmdOpts

                                    )

                    );

     

                    delete dwFlags;

    }

    Everything seems to be fine. After opening the StarTeam client for viewing, .CS files are added in a new folder.

     

    Following is structure in StarTeam,

     

    The outer folder Test has following file(s)/folder(s)

    1. Test.sln file

    2. Test folder

    3. Another Test folder(which is created by StarTeam by default)

     

    The inner folder Test has following file(s)

    ABC.project file

     

    Another inner folder Test(which is created by StarTeam) has following file(s)

    All the .CS files.

     

    I don't want  StarTeam to create a new folder, instead the .CS files should add to the Inner folder Test.

     

    Can anyone help me to resolve the issue?

     

    Warm Regards

    Sathyanarayanan.R

     

     

     


    Sathyanarayanan.R
    • Moved by Chao Kuo Tuesday, July 20, 2010 3:27 AM Third-party product,not support in this forum (From:Visual Studio Source Control and SourceSafe)
    Monday, July 12, 2010 5:56 AM

All replies

  • Hi Sathyanarayanan,

    You may try the following steps:

    1. Add the project from the StarTeam client.

    2. In Visual Studio, choose StarTeam as the current source control provider at Tools->Options->Source Control and then go to File->Source Control->Change Source Control to bind the files to the server folder.

    Regards,


    Catherine Sea
    Version Control Software | Software Configuration Management Solution

    • Marked as answer by Chao Kuo Monday, July 19, 2010 2:24 AM
    • Unmarked as answer by SathyanarayananR Monday, July 19, 2010 5:39 AM
    Wednesday, July 14, 2010 11:33 PM
  • Hi Catherine Sea,

    Sorry for delay in response. I should not do any steps manually. All i want to do via code. Suggest if you have any solutions.

    Warm Regards

    Sathyanarayanan.R


    Sathyanarayanan.R
    Monday, July 19, 2010 5:41 AM