svn

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CliName     = "svn"   // 命令名称
	BaseVersion = "1.8.3" // 依赖版本信息
)

@Date: 2018/12/5 0005 22:25 @Author: Joshua Conero @Name: Svn 包(基于 svn 命令)

Variables

This section is empty.

Functions

func Call

func Call(args ...string) (string, error)

调用命令

func Version

func Version() string

获取版本信息

Types

type Bridge

type Bridge struct {
	Path string // svn path
}

与 svn 之间的cli-命令桥

func (*Bridge) GetArgs

func (b *Bridge) GetArgs(args ...string) []string

获取命令

func (*Bridge) Info

func (b *Bridge) Info(pArgs ...string) (XmlInfo, error)

svn info --xml

func (*Bridge) Log

func (b *Bridge) Log(pArgs ...string) (XmlLog, error)

svn log --xml

type XICommit

type XICommit struct {
	XMLName  xml.Name `xml:"commit"`
	Author   string   `xml:"author"`
	Date     string   `xml:"date"`
	Revision string   `xml:"revision,attr"`
}

commit

type XIEnter

type XIEnter struct {
	XMLName  xml.Name `xml:"entry"`
	Path     string   `xml:"path,attr"`
	Revision string   `xml:"revision,attr"`
	Kind     string   `xml:"kind,attr"`
	Url      string   `xml:"url"`
	Repo     XIRepo
	Wc       XIWc
	Commit   XICommit
}

enter

type XIRepo

type XIRepo struct {
	XMLName xml.Name `xml:"repository"`
	Root    string   `xml:"root"`
	Uuid    string   `xml:"uuid"`
}

<?xml version="1.0" encoding="UTF-8"?> <info>

<entry path="." revision="4946" kind="dir">
   <url>https://121.40.183.166/svn/mci600a</url>
   <relative-url>^/</relative-url>
   <repository>
      <root>https://121.40.183.166/svn/mci600a</root>
      <uuid>24ad63d0-2e50-4f47-9934-a14da7c91441</uuid>
   </repository>
   <wc-info>
      <wcroot-abspath>D:/server/zmapp/mci600a</wcroot-abspath>
      <schedule>normal</schedule>
      <depth>infinity</depth>
   </wc-info>
   <commit revision="4946">
      <author>daiqi</author>
      <date>2018-12-06T01:10:25.592712Z</date>
   </commit>
</entry>

</info>

repository

type XIWc

type XIWc struct {
	XMLName xml.Name `xml:"wc-info"`
	Path    string   `xml:"wcroot-abspath"`
}

wc-info

type XLEnter

type XLEnter struct {
	XMLName  xml.Name `xml:"logentry"`
	Revision string   `xml:"revision,attr"`
	Author   string   `xml:"author"`
	Date     string   `xml:"date"`
	Msg      string   `xml:"msg"`
}

type XmlInfo

type XmlInfo struct {
	XMLName xml.Name `xml:"info"`
	Enter   XIEnter
}

info xml 格式

func (*XmlInfo) Author

func (x *XmlInfo) Author() string

author

func (*XmlInfo) Date

func (x *XmlInfo) Date() string

日期

func (*XmlInfo) Revision

func (x *XmlInfo) Revision() string

版本信息

func (*XmlInfo) Url

func (x *XmlInfo) Url() string

地址

func (*XmlInfo) Uuid

func (x *XmlInfo) Uuid() string

uuid

type XmlLog

type XmlLog struct {
	XMLName xml.Name `xml:"log"`
	Enter   []XLEnter
}

log --xml 输出格式

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL