diff --git a/src/engine/tcr_test.go b/src/engine/tcr_test.go index 542d3730..fc43ebf5 100644 --- a/src/engine/tcr_test.go +++ b/src/engine/tcr_test.go @@ -321,7 +321,7 @@ func Test_introspective_variant(t *testing.T) { }) tcr.revert(*events.ATcrEvent()) - assert.Equal(t, []fake.Command{fake.CommitCommand, fake.RevertCommand}, vcsFake.GetLastCommands(2)) + assert.Equal(t, []fake.Command{fake.CommitCommand, fake.RollbackLastCommitCommand}, vcsFake.GetLastCommands(2)) } func Test_tcr_cycle_end_state(t *testing.T) { diff --git a/src/vcs/fake/vcs_test_fake.go b/src/vcs/fake/vcs_test_fake.go index 4a8d1439..e09e393f 100644 --- a/src/vcs/fake/vcs_test_fake.go +++ b/src/vcs/fake/vcs_test_fake.go @@ -51,16 +51,16 @@ func (gc Commands) contains(command Command) bool { // List of supported VCS commands const ( - AddCommand Command = "add" - CommitCommand Command = "commit" - DiffCommand Command = "diff" - LogCommand Command = "log" - PullCommand Command = "pull" - PushCommand Command = "push" - RevertLocalCommand Command = "revertLocal" - RevertCommand Command = "revert" - StashCommand Command = "stash" - UnStashCommand Command = "unStash" + AddCommand Command = "add" + CommitCommand Command = "commit" + DiffCommand Command = "diff" + LogCommand Command = "log" + PullCommand Command = "pull" + PushCommand Command = "push" + RevertLocalCommand Command = "revertLocal" + RollbackLastCommitCommand Command = "rollbackLastCommit" + StashCommand Command = "stash" + UnStashCommand Command = "unStash" ) type ( @@ -172,9 +172,9 @@ func (vf *VCSFake) UnStash(_ bool) error { return vf.fakeCommand(UnStashCommand) } -// Revert does nothing. Returns an error if in the list of failing commands -func (vf *VCSFake) Revert() error { - return vf.fakeCommand(RevertCommand) +// RollbackLastCommit does nothing. Returns an error if in the list of failing commands +func (vf *VCSFake) RollbackLastCommit() error { + return vf.fakeCommand(RollbackLastCommitCommand) } // GetRootDir returns the root directory path diff --git a/src/vcs/git/git_impl.go b/src/vcs/git/git_impl.go index d7ad2e05..76a2a0e0 100644 --- a/src/vcs/git/git_impl.go +++ b/src/vcs/git/git_impl.go @@ -258,9 +258,9 @@ func (g *gitImpl) RevertLocal(path string) error { return g.traceGit("checkout", "HEAD", "--", path) } -// Revert runs a git revert operation. +// RollbackLastCommit runs a git revert operation. // Current implementation uses a direct call to git -func (g *gitImpl) Revert() error { +func (g *gitImpl) RollbackLastCommit() error { report.PostInfo("Reverting changes") return g.traceGit("revert", "--no-gpg-sign", "--no-edit", "HEAD") } diff --git a/src/vcs/git/git_impl_test.go b/src/vcs/git/git_impl_test.go index e9e2bc8a..dec1c884 100644 --- a/src/vcs/git/git_impl_test.go +++ b/src/vcs/git/git_impl_test.go @@ -500,7 +500,7 @@ func Test_git_revert(t *testing.T) { return tt.gitError } - err := g.Revert() + err := g.RollbackLastCommit() if tt.expectError { assert.Error(t, err) } else { diff --git a/src/vcs/p4/p4_impl.go b/src/vcs/p4/p4_impl.go index 400b4fb9..ff492ebc 100644 --- a/src/vcs/p4/p4_impl.go +++ b/src/vcs/p4/p4_impl.go @@ -175,7 +175,7 @@ func (p *p4Impl) RevertLocal(path string) error { // Revert runs a p4 revert operation. // TODO: VCS Revert - p4 revert -func (*p4Impl) Revert() error { +func (*p4Impl) RollbackLastCommit() error { return errors.New("VCS revert operation not yet available for p4") } diff --git a/src/vcs/vcs.go b/src/vcs/vcs.go index 3207e803..bce99e2c 100644 --- a/src/vcs/vcs.go +++ b/src/vcs/vcs.go @@ -58,7 +58,7 @@ type Interface interface { Add(paths ...string) error Commit(amend bool, messages ...string) error RevertLocal(path string) error - Revert() error + RollbackLastCommit() error Push() error Pull() error Stash(message string) error