Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
8bf2ad75
Commit
8bf2ad75
authored
Aug 22, 2011
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/hgpatch: remove container/vector
R=golang-dev, dsymonds CC=golang-dev
https://golang.org/cl/4921044
parent
ab1c164e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
main.go
src/cmd/hgpatch/main.go
+7
-6
No files found.
src/cmd/hgpatch/main.go
View file @
8bf2ad75
...
...
@@ -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
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment