@@ -181,7 +181,7 @@ func (*TCREngine) RunCheck(p params.Params) {
181
181
// PrintLog prints the TCR VCS commit history
182
182
func (tcr * TCREngine ) PrintLog (p params.Params ) {
183
183
tcrLogs := tcr .queryVCSLogs (p )
184
- report .PostInfo ("Printing TCR log for branch " , tcr .vcs .GetWorkingBranch ())
184
+ report .PostInfo ("Printing TCR log for " , tcr .vcs .SessionSummary ())
185
185
for _ , log := range tcrLogs {
186
186
report .PostTitle ("commit: " , log .Hash )
187
187
report .PostInfo ("timestamp: " , log .Timestamp )
@@ -194,7 +194,7 @@ func (tcr *TCREngine) PrintLog(p params.Params) {
194
194
// PrintStats prints the TCR execution stats
195
195
func (tcr * TCREngine ) PrintStats (p params.Params ) {
196
196
tcrLogs := tcr .queryVCSLogs (p )
197
- stats .Print (tcr .vcs .GetWorkingBranch (), tcrLogsToEvents (tcrLogs ))
197
+ stats .Print (tcr .vcs .SessionSummary (), tcrLogsToEvents (tcrLogs ))
198
198
}
199
199
200
200
func tcrLogsToEvents (tcrLogs vcs.LogItems ) (tcrEvents events.TcrEvents ) {
@@ -214,7 +214,7 @@ func (tcr *TCREngine) queryVCSLogs(p params.Params) vcs.LogItems {
214
214
report .PostError (err )
215
215
}
216
216
if len (logs ) == 0 {
217
- report .PostWarning ("no TCR commit found in branch " , tcr .vcs .GetWorkingBranch (), "'s history" )
217
+ report .PostWarning ("no TCR commit found in " , tcr .vcs .SessionSummary (), "'s history" )
218
218
}
219
219
return logs
220
220
}
@@ -252,9 +252,9 @@ func (tcr *TCREngine) initVCS(vcsName string) {
252
252
253
253
var err error
254
254
switch strings .ToLower (vcsName ) {
255
- case " git" :
255
+ case git . Name :
256
256
tcr .vcs , err = git .New (tcr .sourceTree .GetBaseDir ())
257
- case "p4" , "perforce" :
257
+ case p4 . Name :
258
258
tcr .vcs , err = p4 .New (tcr .sourceTree .GetBaseDir ())
259
259
default :
260
260
tcr .handleError (fmt .Errorf ("VCS not supported: %s" , vcsName ), true , status .ConfigError )
@@ -277,7 +277,7 @@ func (tcr *TCREngine) setVCS(vcsInterface vcs.Interface) {
277
277
func (tcr * TCREngine ) warnIfOnRootBranch (interactive bool ) {
278
278
if tcr .vcs .IsOnRootBranch () {
279
279
message := "Running " + settings .ApplicationName +
280
- " on branch \" " + tcr .vcs .GetWorkingBranch () + " \ " is not recommended"
280
+ " on " + tcr .vcs .SessionSummary () + " is not recommended"
281
281
if interactive {
282
282
if ! tcr .ui .Confirm (message , false ) {
283
283
tcr .Quit ()
@@ -457,7 +457,7 @@ func (tcr *TCREngine) test() (result toolchain.TestCommandResult) {
457
457
}
458
458
459
459
func (tcr * TCREngine ) commit (event events.TCREvent ) {
460
- report .PostInfo ("Committing changes on branch " , tcr .vcs .GetWorkingBranch ())
460
+ report .PostInfo ("Committing changes on " , tcr .vcs .SessionSummary ())
461
461
var err error
462
462
err = tcr .vcs .Add ()
463
463
tcr .handleError (err , false , status .VCSError )
@@ -550,13 +550,14 @@ func (tcr *TCREngine) revertFile(file string) error {
550
550
// Used mainly by the user interface packages to retrieve and display this information
551
551
func (tcr * TCREngine ) GetSessionInfo () SessionInfo {
552
552
return SessionInfo {
553
- BaseDir : tcr .sourceTree .GetBaseDir (),
554
- WorkDir : toolchain .GetWorkDir (),
555
- LanguageName : tcr .language .GetName (),
556
- ToolchainName : tcr .toolchain .GetName (),
557
- AutoPush : tcr .vcs .IsPushEnabled (),
558
- CommitOnFail : tcr .commitOnFail ,
559
- BranchName : tcr .vcs .GetWorkingBranch (),
553
+ BaseDir : tcr .sourceTree .GetBaseDir (),
554
+ WorkDir : toolchain .GetWorkDir (),
555
+ LanguageName : tcr .language .GetName (),
556
+ ToolchainName : tcr .toolchain .GetName (),
557
+ VCSName : tcr .vcs .Name (),
558
+ VCSSessionSummary : tcr .vcs .SessionSummary (),
559
+ GitAutoPush : tcr .vcs .IsPushEnabled (),
560
+ CommitOnFail : tcr .commitOnFail ,
560
561
}
561
562
}
562
563
0 commit comments