Commit 8bf2ad75 authored by Rob Pike's avatar Rob Pike

cmd/hgpatch: remove container/vector

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4921044
parent ab1c164e
......@@ -6,7 +6,6 @@ package main
import (
"bytes"
"container/vector"
"exec"
"flag"
"fmt"
......@@ -242,15 +241,17 @@ func chk(err os.Error) {
// Undo log
type undo func() os.Error
var undoLog vector.Vector // vector of undo
var undoLog []undo
func undoRevert(name string) { undoLog.Push(undo(func() os.Error { return hgRevert(name) })) }
func undoRevert(name string) {
undoLog = append(undoLog, undo(func() os.Error { return hgRevert(name) }))
}
func undoRm(name string) { undoLog.Push(undo(func() os.Error { return os.Remove(name) })) }
func undoRm(name string) { undoLog = append(undoLog, undo(func() os.Error { return os.Remove(name) })) }
func runUndo() {
for i := undoLog.Len() - 1; i >= 0; i-- {
if err := undoLog.At(i).(undo)(); err != nil {
for i := len(undoLog) - 1; i >= 0; i-- {
if err := undoLog[i](); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment