Apache Subversion

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(用户)
 
(未显示2个用户的45个中间版本)
第1行: 第1行:
[[Image:Subversion.jpeg|right]]
+
{{SeeWikipedia}}
  
==相关链接==
+
[[Image:Subversion-90x90.png|right]]
*http://subversion.tigris.org/
+
 
 +
==简介==
 +
 
 +
==功能==
 +
 
 +
==指南==
 +
===安装===
 +
Debian User
 +
#apt-get install subversion
 +
#apt-get install python2.3-subversion - python modules for interfacing with Subversion (aka. svn)
 +
#apt-get install libapache2-svn
 +
 +
http://www.howtoforge.com/debian_subversion_websvn
 +
 
 +
===用法===
 +
$ svnadmin create /home/allen/svn/
 +
$ svnadmin create /home/allen/svn/repos
 +
$ svnadmin create /home/allen/svn/repos/trunk
 +
$ svnadmin create /home/allen/svn/repos/branches
 +
$ svnadmin create /home/allen/svn/repos/tags
 +
$ svn delete file:///home/allen/svn/repos/spring // export SVN_EDITOR=/usr/bin/gedit
 +
$ svn list file:///home/allen/svn/repos
 +
$ svnserve -d -r /home/allen/svn/
 +
$ svn import src file:///home/allen/svn/repos/mondrian -m "initial mondrian 2.4.2.9831 src import"
 +
$ svnadmin verify /home/allen/svn/repos/
 +
$ svnlook author -r 1 /home/allen/svn/repos/
 +
$ svnlook changed -r 1 /home/allen/svn/repos/
 +
$ svnlook date -r 1 /home/allen/svn/repos/
 +
$ svnversion
 +
 +
===工作周期===
 +
Update your working copy
 +
svn update
 +
Make changes
 +
svn add
 +
svn delete
 +
svn copy
 +
svn move
 +
Examine your changes
 +
svn status
 +
svn diff
 +
Possibly undo some changes
 +
svn revert
 +
Resolve Conflicts(Merge Others' Changes)
 +
svn update
 +
svn resolved
 +
Commit your changes
 +
svn commit
 +
 
 +
===命令行===
 +
1. svn -h // The command-line client program
 +
Available subcommands:
 +
  add
 +
  blame (praise, annotate, ann)
 +
  cat
 +
  checkout (co)
 +
  cleanup
 +
  commit (ci)
 +
  copy (cp)
 +
  delete (del, remove, rm)
 +
  diff (di)
 +
  export
 +
  help (?, h)
 +
  import
 +
  info
 +
  list (ls)
 +
  lock
 +
  log
 +
  merge
 +
  mkdir
 +
  move (mv, rename, ren)
 +
  propdel (pdel, pd)
 +
  propedit (pedit, pe)
 +
  propget (pget, pg)
 +
  proplist (plist, pl)
 +
  propset (pset, ps)
 +
  resolved
 +
  revert
 +
  status (stat, st)
 +
  switch (sw)
 +
  unlock
 +
  update (up)
 +
 
 +
2. svnversion -h // A program for reporting the state of a working copy.
 +
$ svnversion ./repos/svn/trunk
 +
4168
 +
Valid options:
 +
  -n [--no-newline]        : do not output the trailing newline
 +
  -c [--committed]        : last changed rather than current revisions
 +
  -h [--help]              : display this help
 +
  --version                : show program version information
 +
 
 +
3. svnlook -h // A tool for directly inspecting a subversion repository
 +
Available subcommands:
 +
  author
 +
  cat
 +
  changed
 +
  date
 +
  diff
 +
  dirs-changed
 +
  help (?, h)
 +
  history
 +
  info
 +
  lock
 +
  log
 +
  propget (pget, pg)
 +
  proplist (plist, pl)
 +
  tree
 +
  uuid
 +
  youngest
 +
 
 +
4. svnadmin -h // A tool for creating, tweaking or repairing a subversion repository
 +
Available subcommands:
 +
  crashtest
 +
  create
 +
  deltify
 +
  dump
 +
  help (?, h)
 +
  hotcopy
 +
  list-dblogs
 +
  list-unused-dblogs
 +
  load
 +
  lslocks
 +
  lstxns
 +
  recover
 +
  rmlocks
 +
  rmtxns
 +
  setlog
 +
  verify
 +
 
 +
5. svndumpfilter -h // A program for fiiltering subversion repository dump streams.
 +
Available subcommands:
 +
  exclude
 +
  include
 +
  help (?, h)
 +
6. mod_dav_svn // A plug-in module for Apache HTTPD.
 +
 
 +
7. svnserve -h // A custom standalone server program, runnable as a daemon process or invokable by SSH; another way to make your repository available to others over a network.
 +
Valid options:
 +
  -d [--daemon]            : daemon mode
 +
  --listen-port arg        : listen port (for daemon mode)
 +
  --listen-host arg        : listen hostname or IP address (for daemon mode)
 +
  --foreground            : run in foreground (useful for debugging)
 +
  -h [--help]              : display this help
 +
  --version                : show program version information
 +
  -i [--inetd]            : inetd mode
 +
  -r [--root] arg          : root of directory to serve
 +
  -R [--read-only]        : force read only, overriding repository config file
 +
  -t [--tunnel]            : tunnel mode
 +
  --tunnel-user arg        : tunnel username (default is current uid's name)
 +
  -T [--threads]          : use threads instead of fork
 +
  -X [--listen-once]      : listen once (useful for debugging)
 +
  --pid-file arg          : write server process ID to file arg
 +
 
 +
8. svnsync -h // A program for incrementally mirroring one repository to another over a network.
 +
Available subcommands:
 +
  initialize (init)
 +
  synchronize (sync)
 +
  copy-revprops
 +
  help (?, h)
 +
 
 +
==Eclipse==
 +
Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE. The software is released under the Eclipse Public License (EPL) 1.0 open source license.
 +
[[Image:subclipse-install.png|right]]
 +
Name: Subclipse 1.2.x (Eclipse 3.2+)
 +
URL:  http://subclipse.tigris.org/update_1.2.x
 +
   
 +
Name: Subclipse 1.0.x (Eclipse 3.0/3.1)
 +
URL:  http://subclipse.tigris.org/update_1.0.x
 +
http://subclipse.tigris.org/
 +
 
 +
==NetBeans==
 +
 
 +
==客户端==
 +
*[[pysvn]]
 +
 
 +
==Windows==
 +
如:获得 http://download.huihoo.com/subversion/windows/svn-1.4.4-setup.exe
 +
设置系统环境:
 +
SVN_EDITOR= C:\Windows\Notepad.exe
 +
svnadmin create "D:\svn_repos"
 +
打开 firefox
 +
file:///D:/svn_repos/conf/
 +
打开 svnserve.conf 文件
 +
anon-access = read
 +
auth-access = write
 +
password-db = passwd
 +
打开 passwd 文件
 +
启动服务
 +
svnserve --daemon --root "D:\svn_repos"
 +
打开另一个窗口
 +
svn mkdir svn://localhost/huihoo
 +
svn mkdir svn://localhost/huihoo/trunk
 +
svn ls svn://localhost/
 +
安装 TortoiseSVN
 +
如: http://download.huihoo.com/subversion/windows/TortoiseSVN-1.4.4.9706-win32-svn-1.4.4.msi
 +
从另一台机器取出版本
 +
如: svn co svn://172.18.76.131/huihoo/trunk 
 +
导入源代码
 +
svn import redmine-0.6.0 file:///D;/svn_repos/redmine -m "inital redmine-0.6.0 src import"
 +
 
 +
==Apache HTTPD==
 +
svnadmin create /home/allen/svn
 +
apt-get install libapache2-svn
 +
vi etc/apache2/mods-available/dav_svn.conf
 +
将对应行改为:
 +
    <Location /svn>
 +
      DAV svn
 +
      SVNPath /home/allen/svn
 +
      AuthType Basic
 +
      AuthName "Subversion repository"
 +
      AuthUserFile /etc/subversion/passwd
 +
      <LimitExcept GET PROPFIND OPTIONS REPORT>
 +
        Require valid-user
 +
      </LimitExcept>
 +
    </Location>
 +
添加用户验证文件
 +
htpasswd -c /etc/subversion/passwd allen
 +
/etc/init.d/apache2 restart
 +
http://localhost/svn
 +
添加/home/allen/jfox 中的文件到repos里
 +
$ svn import -m "init jfox" /home/allen/jfox http://localhost/svn/jfox
 +
checkout http://localhost/svn/jfox 中的文件到/home/allen/test
 +
$ svn checkout http://localhost/svn/jfox /home/allen/test/jfox
 +
 
 +
==Lighttpd==
 +
==Berkeley DB==
 +
==Online Book==
 +
*[http://docs.huihoo.com/subversion/1.4/index.html Version Control with Subversion 1.4]
 +
*[http://docs.huihoo.com/subversion/1.2/index.html Version Control with Subversion 1.2]
 +
 
 +
==用户==
 +
*[https://core.trac.wordpress.org/browser/trunk WordPress] [[WordPress]]
 +
*[https://trac.edgewall.org/browser Trac] [[Trac]]
 +
*[[Redmine]] [https://svn.redmine.org/ svn 仓库]
 +
 
 +
==图集==
 +
<gallery>
 +
image:svn-arch-diagram.png|架构
 +
image:cee_architecture.gif|CollabNet Enterprise Edition
 +
</gallery>
 +
 
 +
==链接==
 +
*http://subversion.apache.org/
 
* [[ViewVC]]
 
* [[ViewVC]]
 +
* [[RapidSVN]]
 +
* 商业化产品和服务 - http://www.collab.net
 +
* [[Polarion Community]] for Subversion
  
[[Category:Free revision control software]]
+
[[category:revision control]]
 +
[[category:software development]]
 +
[[category:apache]]

2021年4月21日 (三) 01:53的最后版本

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Apache Subversion Thanks, Wikipedia.
Subversion-90x90.png

目录

[编辑] 简介

[编辑] 功能

[编辑] 指南

[编辑] 安装

Debian User

#apt-get install subversion
#apt-get install python2.3-subversion - python modules for interfacing with Subversion (aka. svn)
#apt-get install libapache2-svn

http://www.howtoforge.com/debian_subversion_websvn

[编辑] 用法

$ svnadmin create /home/allen/svn/
$ svnadmin create /home/allen/svn/repos
$ svnadmin create /home/allen/svn/repos/trunk
$ svnadmin create /home/allen/svn/repos/branches
$ svnadmin create /home/allen/svn/repos/tags
$ svn delete file:///home/allen/svn/repos/spring // export SVN_EDITOR=/usr/bin/gedit
$ svn list file:///home/allen/svn/repos
$ svnserve -d -r /home/allen/svn/
$ svn import src file:///home/allen/svn/repos/mondrian -m "initial mondrian 2.4.2.9831 src import"
$ svnadmin verify /home/allen/svn/repos/
$ svnlook author -r 1 /home/allen/svn/repos/
$ svnlook changed -r 1 /home/allen/svn/repos/
$ svnlook date -r 1 /home/allen/svn/repos/
$ svnversion

[编辑] 工作周期

Update your working copy

svn update

Make changes

svn add
svn delete
svn copy 
svn move

Examine your changes

svn status
svn diff

Possibly undo some changes

svn revert

Resolve Conflicts(Merge Others' Changes)

svn update
svn resolved

Commit your changes

svn commit

[编辑] 命令行

1. svn -h // The command-line client program

Available subcommands:
  add
  blame (praise, annotate, ann)
  cat
  checkout (co)
  cleanup
  commit (ci)
  copy (cp)
  delete (del, remove, rm)
  diff (di)
  export
  help (?, h)
  import
  info
  list (ls)
  lock
  log
  merge
  mkdir
  move (mv, rename, ren)
  propdel (pdel, pd)
  propedit (pedit, pe)
  propget (pget, pg)
  proplist (plist, pl)
  propset (pset, ps)
  resolved
  revert
  status (stat, st)
  switch (sw)
  unlock
  update (up)

2. svnversion -h // A program for reporting the state of a working copy.

$ svnversion ./repos/svn/trunk
4168

Valid options:

 -n [--no-newline]        : do not output the trailing newline
 -c [--committed]         : last changed rather than current revisions
 -h [--help]              : display this help
 --version                : show program version information

3. svnlook -h // A tool for directly inspecting a subversion repository

Available subcommands:
  author
  cat
  changed
  date
  diff
  dirs-changed
  help (?, h)
  history
  info
  lock
  log
  propget (pget, pg)
  proplist (plist, pl)
  tree
  uuid
  youngest

4. svnadmin -h // A tool for creating, tweaking or repairing a subversion repository

Available subcommands:
  crashtest
  create
  deltify
  dump
  help (?, h)
  hotcopy
  list-dblogs
  list-unused-dblogs
  load
  lslocks
  lstxns
  recover
  rmlocks
  rmtxns
  setlog
  verify

5. svndumpfilter -h // A program for fiiltering subversion repository dump streams.

Available subcommands:
  exclude
  include
  help (?, h)

6. mod_dav_svn // A plug-in module for Apache HTTPD.

7. svnserve -h // A custom standalone server program, runnable as a daemon process or invokable by SSH; another way to make your repository available to others over a network.

Valid options:
 -d [--daemon]            : daemon mode
 --listen-port arg        : listen port (for daemon mode)
 --listen-host arg        : listen hostname or IP address (for daemon mode)
 --foreground             : run in foreground (useful for debugging)
 -h [--help]              : display this help
 --version                : show program version information
 -i [--inetd]             : inetd mode
 -r [--root] arg          : root of directory to serve
 -R [--read-only]         : force read only, overriding repository config file
 -t [--tunnel]            : tunnel mode
 --tunnel-user arg        : tunnel username (default is current uid's name)
 -T [--threads]           : use threads instead of fork
 -X [--listen-once]       : listen once (useful for debugging)
 --pid-file arg           : write server process ID to file arg

8. svnsync -h // A program for incrementally mirroring one repository to another over a network.

Available subcommands:
  initialize (init)
  synchronize (sync)
  copy-revprops
  help (?, h)

[编辑] Eclipse

Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE. The software is released under the Eclipse Public License (EPL) 1.0 open source license.

Subclipse-install.png
Name: Subclipse 1.2.x (Eclipse 3.2+)
URL:  http://subclipse.tigris.org/update_1.2.x
   
Name: Subclipse 1.0.x (Eclipse 3.0/3.1)
URL:  http://subclipse.tigris.org/update_1.0.x

http://subclipse.tigris.org/

[编辑] NetBeans

[编辑] 客户端

[编辑] Windows

如:获得 http://download.huihoo.com/subversion/windows/svn-1.4.4-setup.exe

设置系统环境:

SVN_EDITOR= C:\Windows\Notepad.exe
svnadmin create "D:\svn_repos"
打开 firefox
file:///D:/svn_repos/conf/
打开 svnserve.conf 文件
anon-access = read
auth-access = write
password-db = passwd 
打开 passwd 文件

启动服务

svnserve --daemon --root "D:\svn_repos"

打开另一个窗口

svn mkdir svn://localhost/huihoo
svn mkdir svn://localhost/huihoo/trunk
svn ls svn://localhost/

安装 TortoiseSVN

如: http://download.huihoo.com/subversion/windows/TortoiseSVN-1.4.4.9706-win32-svn-1.4.4.msi

从另一台机器取出版本

如: svn co svn://172.18.76.131/huihoo/trunk  

导入源代码

svn import redmine-0.6.0 file:///D;/svn_repos/redmine -m "inital redmine-0.6.0 src import"

[编辑] Apache HTTPD

svnadmin create /home/allen/svn
apt-get install libapache2-svn
vi etc/apache2/mods-available/dav_svn.conf
将对应行改为:
   <Location /svn>
      DAV svn
      SVNPath /home/allen/svn
      AuthType Basic
      AuthName "Subversion repository"
      AuthUserFile /etc/subversion/passwd
      <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
      </LimitExcept>
    </Location> 
添加用户验证文件
htpasswd -c /etc/subversion/passwd allen
/etc/init.d/apache2 restart
http://localhost/svn
添加/home/allen/jfox 中的文件到repos里
$ svn import -m "init jfox" /home/allen/jfox http://localhost/svn/jfox
checkout http://localhost/svn/jfox 中的文件到/home/allen/test
$ svn checkout http://localhost/svn/jfox /home/allen/test/jfox

[编辑] Lighttpd

[编辑] Berkeley DB

[编辑] Online Book

[编辑] 用户

[编辑] 图集

[编辑] 链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱