@@ -591,46 +591,23 @@ WOQLClient.prototype.squashBranch = function(branch_id, commit_msg) {
591
591
* @param {string } commit_descriptor - a valid commit descriptor
592
592
* @returns {Promise }
593
593
*/
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 )
598
598
}
599
599
let errmsg = `Branch parameter error - you must specify a valid new branch id and a commit message`
600
600
return Promise . reject ( new Error ( ErrorMessage . getInvalidParameterMessage ( CONST . RESET_BRANCH , errmsg ) ) )
601
601
}
602
602
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
- }
610
603
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
- }
626
604
627
605
/**
628
606
* Optimize db branch
629
607
* @param {string } branch_id - local identifier of the new branch
630
608
* @returns {Promise }
631
609
*/
632
610
WOQLClient . prototype . optimize_branch = function ( branch_id ) {
633
- console . log ( "this.connectionConfig.optimizeBranchUrl(branch_id)" , this . connectionConfig . optimizeBranchUrl ( branch_id ) )
634
611
return this . dispatch ( CONST . OPTIMIZE_SYSTEM , this . connectionConfig . optimizeBranchUrl ( branch_id ) )
635
612
}
636
613
@@ -763,8 +740,9 @@ WOQLClient.prototype.generateCommitInfo = function(msg, author) {
763
740
* Generates the json structure for commit descriptor
764
741
* @param {string } commit_descriptor - a valid commit descriptor
765
742
*/
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 }
768
746
return ci
769
747
}
770
748
0 commit comments