@@ -591,46 +591,23 @@ WOQLClient.prototype.squashBranch = function(branch_id, commit_msg) {
591591 * @param {string } commit_descriptor - a valid commit descriptor
592592 * @returns {Promise }
593593 */
594- WOQLClient . prototype . resetBranch = function ( branch_id , commit_descriptor ) {
595- if ( commit_descriptor && branch_id ) {
596- let commit = this . generateCommitDescriptor ( commit_descriptor )
597- return this . dispatch ( CONST . RESET_BRANCH , this . connectionConfig . squashBranchURL ( ) , commit )
594+ WOQLClient . prototype . resetBranch = function ( branch_id , commit_id ) {
595+ if ( commit_id && branch_id ) {
596+ let commit_descriptor = this . generateCommitDescriptor ( commit_id )
597+ return this . dispatch ( CONST . RESET_BRANCH , this . connectionConfig . resetBranchUrl ( branch_id ) , commit_descriptor )
598598 }
599599 let errmsg = `Branch parameter error - you must specify a valid new branch id and a commit message`
600600 return Promise . reject ( new Error ( ErrorMessage . getInvalidParameterMessage ( CONST . RESET_BRANCH , errmsg ) ) )
601601}
602602
603- /**
604- * Optimize system
605- * @returns {Promise }
606- */
607- WOQLClient . prototype . optimize_system = function ( ) {
608- return this . dispatch ( CONST . OPTIMIZE_SYSTEM , this . connectionConfig . optimizeSystemUrl ( ) )
609- }
610603
611- /**
612- * Optimize db meta
613- * @returns {Promise }
614- */
615- WOQLClient . prototype . optimize_meta = function ( ) {
616- return this . dispatch ( CONST . OPTIMIZE_SYSTEM , this . connectionConfig . optimizeMetaUrl ( ) )
617- }
618-
619- /**
620- * Optimize db commits
621- * @returns {Promise }
622- */
623- WOQLClient . prototype . optimize_commit = function ( ) {
624- return this . dispatch ( CONST . OPTIMIZE_SYSTEM , this . connectionConfig . optimizeCommitUrl ( ) )
625- }
626604
627605/**
628606 * Optimize db branch
629607 * @param {string } branch_id - local identifier of the new branch
630608 * @returns {Promise }
631609 */
632610WOQLClient . prototype . optimize_branch = function ( branch_id ) {
633- console . log ( "this.connectionConfig.optimizeBranchUrl(branch_id)" , this . connectionConfig . optimizeBranchUrl ( branch_id ) )
634611 return this . dispatch ( CONST . OPTIMIZE_SYSTEM , this . connectionConfig . optimizeBranchUrl ( branch_id ) )
635612}
636613
@@ -763,8 +740,9 @@ WOQLClient.prototype.generateCommitInfo = function(msg, author) {
763740 * Generates the json structure for commit descriptor
764741 * @param {string } commit_descriptor - a valid commit descriptor
765742 */
766- WOQLClient . prototype . generateCommitDescriptor = function ( commit_descriptor ) {
767- let ci = { commit_descriptor : commit_descriptor }
743+ WOQLClient . prototype . generateCommitDescriptor = function ( commit_id ) {
744+ let cd = this . connectionConfig . commitDescriptorUrl ( commit_id )
745+ let ci = { commit_descriptor : cd }
768746 return ci
769747}
770748
0 commit comments