11import { Command } from 'commander' ;
22import { Context } from '../types.js' ;
33import { color , Listr , ListrDefaultRendererLogLevels } from 'listr2' ;
4- import startServer from '../tasks/startServer.js' ;
54import auth from '../tasks/auth.js' ;
65import ctxInit from '../lib/ctx.js' ;
7- import getGitInfo from '../tasks/getGitInfo.js' ;
8- import createBuild from '../tasks/createBuild.js' ;
9- import snapshotQueue from '../lib/snapshotQueue.js' ;
10- import { startPolling , startPingPolling } from '../lib/utils.js' ;
11- import fetchBuildInfo from '../tasks/fetchBuildInfo.js'
6+ import fetchBranchInfo from '../tasks/fetchBranchInfo.js'
127import mergeBuilds from '../tasks/mergeBuilds.js'
138
149const command = new Command ( ) ;
1510
1611command
17- . name ( 'merge ' )
12+ . name ( 'branch ' )
1813 . description ( 'Merge a source branch into the target branch' )
19- . command ( 'branch' )
20- . description ( 'Merge the source branch into the target branch' )
2114 . requiredOption ( '--source <string>' , 'Source branch to merge' )
2215 . requiredOption ( '--target <string>' , 'Target branch to merge into' )
2316 . action ( async function ( this : Command , options : { source : string , target : string } ) {
@@ -33,15 +26,15 @@ command
3326 process . exit ( 1 ) ;
3427 }
3528
36- ctx . log . debug ( `Merging source branch '${ source } ' into target branch '${ target } '` ) ;
37- ctx . snapshotQueue = new snapshotQueue ( ctx ) ;
38- ctx . totalSnapshots = 0 ;
39- ctx . isStartExec = true ;
29+ ctx . log . debug ( `Merging source branch '${ source } ' into branch branch '${ target } '` ) ;
30+ ctx . mergeBranchSource = source
31+ ctx . mergeBranchTarget = target
32+ ctx . mergeByBranch = true
4033
4134 let tasks = new Listr < Context > (
4235 [
4336 auth ( ctx ) ,
44- fetchBuildInfo ( ctx ) ,
37+ fetchBranchInfo ( ctx ) ,
4538 mergeBuilds ( ctx ) ,
4639 ] ,
4740 {
0 commit comments