Clifford Wolf, September 22, 2004 SubMaster – p. 1
Distributed Software Development using Subversion and SubMaster
Infrastructure for the Bazaar
Clifford Wolf
LINBIT http://www.linbit.com
Infrastructure for the Bazaar Clifford Wolf LINBIT - - PowerPoint PPT Presentation
Distributed Software Development using Subversion and SubMaster Infrastructure for the Bazaar Clifford Wolf LINBIT http://www.linbit.com Clifford Wolf, September 22, 2004 SubMaster p. 1 Introduction Development Models
Clifford Wolf, September 22, 2004 SubMaster – p. 1
LINBIT http://www.linbit.com
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 2
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 3
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 4
■ Everyone must have the possibility to send patches ■ There must be no way for patches to be lost or ignored ■ Creating and sending patches must be as easy as possible ■ Keeping local changes and main tree in sync must be easy ■ There must be no restictions due to licences or binary only
■ Using the system without a GUI should be possible
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 5
■ Subversion is a a version control system ■ The entire history of a project including all branches is stored
■ A Subversion Repository can also be seen as a filesystem
■ Pleople can check out files or directories from a Subversion
■ Some changes can be done directly on the repository
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 6
■ Subversion Repositories can be accessed thru the
■ The tool for creating and maintaining the database behind a
■ The tool for working with the Subversion Repository and
■ The calling convention for ’svn’ is simmilar to the calling
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 7
■ Subversion on it’s own is not good for bazaar-style
■ There is only one central repository ■ Only a limited number of people has write access to the tree ■ Everyone else has to send patches per email ■ It’s hard to keep a local tree with patches in sync with the
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 8
■ SubMaster is a set of scripts based on Subversion targeting
■ Everyone has his own local Subversion repository ■ SubMaster keeps the local repository in sync with the master
■ SubMaster provides an infrastructure for sending patches,
■ Working with SubMaster almost feels like having write
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 9
SVN Working Copy SVN Working Copy
Introduction
Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 10
■ In his keynote about Linux Kenrel development at the
■ He called that
■ So the SubMaster tools are nothing else than
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 11
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 12
■ Creating the repository itself is easy:
■ If the repository should be accessable thru HTTP/WebDAV
■ If the repository should be accessable thru the Subversion
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 13
■ Using the tool s
■ A Working copy can be created with:
■ Note that no equivalent to $CVSROOT exists. ■ Within the working copy, every directory has a .
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 14
■ Modifying files: ◆ Just edit them as usual with your favorite editor ◆ Note that Subversion is using binary deltas and has good
■ Adding files: ◆ First create the new file as usual ◆ Then execute s
■ Removing files: ◆ Just execute s
◆ The file will automatically removed by s
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 15
■ Moving/renaming files: ◆ Using s
■ Copying files: ◆ Using s
■ Making changes without a working copy: ◆ Most operations can also be performed directly on the
◆ s
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 16
■ Commiting changes made in the working copy:
■ Listing status (modified, etc) of files in working copy:
■ Bringing changes from the repository into the working copy:
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 17
■ Subversion has no explicit support for branching. ■ But it has support for copying directories in O(1). ■ Creating a branch is just the same as creating a copy:
■ Merging changes from somewhere else to working copy:
■ A “tagged version” is also just a copy. It just never gets
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 18
■ The command s
■ The command s
Introduction Using Subversion
The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 19
■ The command s
■ The command s
■ The Subversion Handbook is a great Subversion tutorial:
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 20
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 21
■ The SubMaster client s
■ The SubMaster client also automates the creation of patches
■ A detailed help message explaining all subcommands to s
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 22
■ Create a local copy of the master repository:
◆ d
◆ d
■ Create an account at the SubMaster Server:
■ Add your SubMaster Login information to your SM tree:
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 23
■ Make your changes in d
■ Use s
■ Use s
■ Sometimes an s
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 24
■ Use s
■ Use s
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 25
■ Merging changes from master tree to local tree: ◆ s
◆ manually resolve conflicts, if any ◆ patches beeing applied in master do not result in conflicts ◆ s
■ Full-syncing local tree to master: ◆ s
◆ This will discard all local changes ■ Showing differences between local tree and master: ◆ s
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 26
■ The WIP (work-in-progress) archive can be used to suspend
■ Revert in working copy and save as patch in WIP archive:
■ Apply patch in working tree and remove from WIP archive:
■ Move patch from WIP archive to current working directory:
■ Move patch from current working directory to WIP archive:
■ List patches in WIP archive: s
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 27
■ d
■ d
■ d
■ d
■ d
■ d
Introduction Using Subversion The SubMaster Client
The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 28
■ d
■ d
■ d
■ d
■ d
Introduction Using Subversion The SubMaster Client The SubMaster Server
The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 29
Introduction Using Subversion The SubMaster Client The SubMaster Server
The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 30
■ Basically a cgi-based relay for patches ■ Everyone can register as user ■ Everyone can upload patches ■ Everyone can vote for/agains and comment patches ■ The tree maintainer can pull patches and apply them to the
■ The tools s
■ E-mail notifications, etc. can be implemented using action
Introduction Using Subversion The SubMaster Client The SubMaster Server
The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 31
■ A Unique Patch ID (such as "2
■ The login-name of the user who created the patch ■ Current patch status (open, applied, rejected and discarded) ■ The patch file itself ■ The patch description (header of the patch file) ■ Votes pro and contra the patch ■ Other users (single-line) comments on the patch ■ Auto-created additional info from the action scripts
Introduction Using Subversion The SubMaster Client The SubMaster Server
The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 32
■ p
■ p
■ u
■ o
Introduction Using Subversion The SubMaster Client The SubMaster Server
The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 33
■ d
■ d
■ d
■ d
■ d
■ d
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script
SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 34
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script
SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 35
■ Helps applying patches from the SM Server ◆ Download patch from server ◆ Check if it applies cleanly ◆ Apply the patch to the current directory ◆ Run s
◆ Run s
◆ Mark patch as applied ■ E.g. for maintaining the official tree ■ E.g. for testing or extending patches ■ Sometimes called by s
■ Usage: s
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script
SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 36
■ -pN -l -R
■ -d
■ -S
■ -E
■ -D
■ -a file
■ -A
■ -M
■ -C
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script
SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 37
■ If this is a SubMaster tree, read config from the SM config. ■ Otherwise read server URL, Username and Password from
■ It’s also possible modify the parameter list in .
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script
SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 38
■ Can be used to create patches for patches (e.g. so they
■ s
■ f
■ Merge p
■ f
■ -
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts
URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 39
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts
URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 40
■ Action scripts are called whenever the status of a patch
■ This can be used to send notify mails ■ .. to check who should review the patch ■ .. to eventually run any regression test on the patch ■ The action scripts can be written in any language ■ The action script for the ROCK SM is written in shell
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts
URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 41
■ .
■ .
■ .
■ .
■ .
■ .
■ .
■ .
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References
Clifford Wolf, September 22, 2004 SubMaster – p. 42
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References
Clifford Wolf, September 22, 2004 SubMaster – p. 43
■ The Subversion Handbook:
■ The Subversion Homepage:
■ The SubMaster Homepage:
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References
Clifford Wolf, September 22, 2004 SubMaster – p. 44
■ SVK: A decentralized system based on Subversion ■ Transvn: A patch-scripts clone based on Subversion
■ SVM: Mirror Remote Subversion Repository to local
Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References
Clifford Wolf, September 22, 2004 SubMaster – p. 45
■ LINBIT Information Technologies GmbH:
■ The ROCK Linux Project:
■ Clifford Wolf: