Skip to content

Commit

Permalink
[#791] Add comments explaining the createChangeList method if Perforc…
Browse files Browse the repository at this point in the history
…e implementation

So that we don't spend so much time understanding the perforce quirks next time
  • Loading branch information
philou committed Oct 4, 2024
1 parent edb6166 commit 95c9972
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vcs/p4/p4_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ func (p *p4Impl) RevertLocal(path string) error {

// RollbackLastCommit runs a p4 revert operation.
func (*p4Impl) RollbackLastCommit() error {
// TO IMPLEMENT
// get the changelist to rollback "p4 changes -m1 @<client_name>"
// undo this changelist "p4 undo @,@"
// no commit to do, will be called by TCR
return errors.New("VCS revert operation not yet available for p4")
}

Expand Down Expand Up @@ -275,6 +279,9 @@ func (p *p4Impl) buildP4Args(args ...string) []string {

func (p *p4Impl) createChangeList(messages ...string) (*changeList, error) {
// Command: p4 --field "Description=<message>" change -o | p4 change -i
// `change -o` outputs a "changelist spec" to stdout
// `change -i` then reads it and creates a real changelist from it
// `change -o` takes all the changed files from the Default changelist and adds them to this new changelist
out, err := p.runPipedP4(newP4Command(p.buildP4Args("change", "-i")...),
"-Q", "utf8",
"--field", buildDescriptionField(shell.GetAttributes(), messages...),
Expand Down

0 comments on commit 95c9972

Please sign in to comment.