Mendix SDK branch not working?

0
When I try to use the Mendix SDK on a branch the changes in the script are comitted to the main line. Is this a bug? I'm using the code:   const username = process.argv[2]; const apikey = process.argv[3]; const projectId = process.argv[4]; const projectName = process.argv[5]; const moduleName = process.argv[6]; const pageName = process.argv[7]; let branchName = null; // null for mainline if (process.argv[8]){ branchName = process.argv[8]; } let revNo = -1; // -1 for latest if (process.argv[9]){ revNo = process.argv[9]; } const client = new MendixSdkClient(username, apikey); const project = new Project(client, projectId, projectName); client.platform().createOnlineWorkingCopy(project, new Revision(revNo, new Branch(project, branchName))) .then(workingCopy => loadDomainModel(workingCopy)) .then(workingCopy => { ... }) .then(workingCopy => workingCopy.commit()) .done( revision => console.log(`Successfully committed revision: ${revision.num() }. Done.`), error => { console.log('Something went wrong:'); console.dir(error); }); (I also tried setting branchName hardcoded)
asked
2 answers
2

Your commit statement misses the 'branchName' argument.

.then(workingCopy => workingCopy.commit())

The commit is not automatically done on the branch from which you created your working copy.

From the Platform SDK documentation:

commit(branchName?: string, baseRevision?: number): Promise<Revision>
Parameters

    Optional branchName: string

    (Optional) the branch to commit to. Use null for main line.
    Optional baseRevision: number

    (Optional) the base revision of this commit.

 

answered
0

This is also not working in Mendix 7.2.0. Anybody?

answered