-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference.go
136 lines (122 loc) · 2.89 KB
/
reference.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Package svn provides svn date reference
package svn
import (
"encoding/xml"
"time"
)
// CMD for svn
const (
cmdAdd = "add"
cmdAuth = "auth"
cmdBlame = "blame"
cmdCat = "cat"
cmdChangelist = "changelist"
cmdCheckout = "checkout"
cmdCleanup = "cleanup"
cmdCommit = "commit"
cmdCopy = "copy"
cmdDelete = "delete"
cmdDiff = "diff"
cmdExport = "export"
cmdHelp = "help"
cmdImport = "import"
cmdInfo = "info"
cmdList = "list"
cmdLock = "lock"
cmdLog = "log"
cmdMerge = "merge"
cmdMergeinfo = "mergeinfo"
cmdMkdir = "mkdir"
cmdMove = "move"
cmdPatch = "patch"
cmdPropdel = "propdel"
cmdPropedit = "propedit"
cmdPropget = "propget"
cmdProplist = "proplist"
cmdPropset = "propset"
cmdRelocate = "relocate"
cmdResolve = "resolve"
cmdResolved = "resolved"
cmdRevert = "revert"
cmdStatus = "status"
cmdSwitch = "switch"
cmdUnlock = "unlock"
cmdUpdate = "update"
cmdUpgrade = "upgrade"
)
// Kind
const (
KindFile = "file"
KindDir = "dir"
)
// BlameResp Blame
type BlameResp struct {
XMLName xml.Name `xml:"blame"`
BlameTarget Target `xml:"target"`
}
// Target recode info for each line
type Target struct {
Path string `xml:"path,attr"`
Entrys []Entry `xml:"entry"`
}
// Entry LineInfo
type Entry struct {
LineNumber string `xml:"line-number,attr"`
Commit CommitT `xml:"commit"`
}
// CommitT Commit Type
type CommitT struct {
Revision string `xml:"revision,attr"`
Auther string `xml:"author"`
DateTime time.Time `xml:"date"`
}
// File snv file type
type File struct {
Kind string `xml:"kind,attr"`
Commit CommitT `xml:"commit"`
Name string `xml:"name"`
}
// ListResp ListResp
type ListResp struct {
XMLName xml.Name `xml:"lists"`
Files []File `xml:"list>entry"`
}
// LogResp svn log struct
type LogResp struct {
XMLName xml.Name `xml:"log"`
Logentrys []Logentry `xml:"logentry"`
}
// Logentry svn logentry
type Logentry struct {
Revision string `xml:"revision,attr"`
Author string `xml:"author"`
DateTime time.Time `xml:"date"`
Msg string `xml:"msg"`
Paths []Path `xml:"paths>path"`
}
// Path svn path
type Path struct {
Action string `xml:"action,attr"`
PropMods string `xml:"prop-mods,attr"`
TextMods string `xml:"text-mods,attr"`
Kind string `xml:"kind,attr"`
Value string `xml:",chardata"`
}
// InfoResp InfoResp
type InfoResp struct {
XMLName xml.Name `xml:"info"`
Info InfoT `xml:"entry"`
}
// InfoT svn info
type InfoT struct {
Kind string `xml:"kind,attr"`
Path string `xml:"path,attr"`
Revision string `xml:"revision,attr"`
URL string `xml:"url"`
RelativeURL string `xml:"relative-url"`
Repository struct {
Root string `xml:"root"`
uuid string `xml:"uuid"`
} `xml:"repository"`
Commit CommitT `xml:"commit"`
}