Infrastructure for the Bazaar Clifford Wolf LINBIT - - PowerPoint PPT Presentation

infrastructure for the bazaar
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

slide-3
SLIDE 3

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

Development Models

D e c e n t r a l i z e d M

  • d

e l C e n t r a l i z e d M

  • d

e l

D i s t r i b u t e d M

  • d

e l

H i e r a r c h i c M

  • d

e l

slide-4
SLIDE 4

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

Requirements

■ 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

executables

■ Using the system without a GUI should be possible

slide-5
SLIDE 5

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

What is Subversion (1)

■ Subversion is a a version control system ■ The entire history of a project including all branches is stored

in a Database called Subversion Repository

■ A Subversion Repository can also be seen as a filesystem

with special capabilities

■ Pleople can check out files or directories from a Subversion

Repository, change them and commit the changes back to the repository

■ Some changes can be done directly on the repository

without creating a working copy

slide-6
SLIDE 6

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

What is Subversion (2)

■ Subversion Repositories can be accessed thru the

filesystem, using HTTP/WebDAV or by a special SVN:// protocol

■ The tool for creating and maintaining the database behind a

Subversion Repository is called ’svnadmin’

■ The tool for working with the Subversion Repository and

Working copies is called ’svn’

■ The calling convention for ’svn’ is simmilar to the calling

convention for ’cvs’

slide-7
SLIDE 7

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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 is for the Cathedral

■ Subversion on it’s own is not good for bazaar-style

development

■ 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

  • fficial tree
slide-8
SLIDE 8

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

What is SubMaster

■ SubMaster is a set of scripts based on Subversion targeting

bazaar-style development

■ Everyone has his own local Subversion repository ■ SubMaster keeps the local repository in sync with the master

repository preserving local changes

■ SubMaster provides an infrastructure for sending patches,

collecting feedback and applying patches to the master tree

■ Working with SubMaster almost feels like having write

access to the official tree

slide-9
SLIDE 9

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

Components

SVN Working Copy SVN Working Copy

s m . p l s m a p . s h C

  • m

p

  • n

e n t s

  • f

a S u b M a s t e r E n v i r

  • n

m e n t S e r v e r C

  • m

p

  • n

e n t s L

  • c

a l D e v e l

  • p

e r T r e e P r

  • j

e c t M a i n t a i n e r Subversion Repository Client SubMaster Server Subversion Repository Master

slide-10
SLIDE 10

Introduction

  • Development Models
  • Requirements
  • What is Subversion (1)
  • What is Subversion (2)
  • Subversion is for the Cathedral
  • What is SubMaster
  • Components
  • Mortal Kombat

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

Mortal Kombat

■ In his keynote about Linux Kenrel development at the

german Linux Kongress, Russty Russel did talk about "Code By Confrontation".

■ He called that

The Mortal Kombat Model

  • f Software Development

■ So the SubMaster tools are nothing else than

The Weapons and Battlefield of the Mortal Kombat of Software Development

slide-11
SLIDE 11

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 11

Using Subversion

slide-12
SLIDE 12

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

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 a repository

■ Creating the repository itself is easy:

s v n a d m i n c r e a t e / h

  • m

e / s v n / r e p

  • s

■ If the repository should be accessable thru HTTP/WebDAV

(http://), you need to configure your apache to load the Subversion module and set it up.

■ If the repository should be accessable thru the Subversion

protocol (svn://), you need to set up the Subversion server s v n s e r v e .

slide-13
SLIDE 13

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 13

Creating a working copy

■ Using the tool s

v n is very simmilar to using c v s.

■ A Working copy can be created with:

s v n c

  • f

i l e : / / / h

  • m

e / s v n / r e p

  • s

l

  • c

a l d i r c d l

  • c

a l d i r

■ Note that no equivalent to $CVSROOT exists. ■ Within the working copy, every directory has a .

s v n subdirectory containing the Subversion metadata.

slide-14
SLIDE 14

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 14

Making changes (1)

■ Modifying files: ◆ Just edit them as usual with your favorite editor ◆ Note that Subversion is using binary deltas and has good

support for non-ascii files

■ Adding files: ◆ First create the new file as usual ◆ Then execute s

v n a d d

filename

■ Removing files: ◆ Just execute s

v n r m filename

◆ The file will automatically removed by s

v n

slide-15
SLIDE 15

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 15

Making changes (2)

■ Moving/renaming files: ◆ Using s

v n m v instead of m v

■ Copying files: ◆ Using s

v n c p instead of c p

■ Making changes without a working copy: ◆ Most operations can also be performed directly on the

repository:

◆ s

v n c

  • p

y

  • m "

C

  • m

m i t m e s s a g e " \ f i l e : / / / h

  • m

e / s v n / r e p

  • s

/ d e m

  • 2

. t x t \ f i l e : / / / h

  • m

e / s v n / r e p

  • s

/ d e m

  • 3

. t x t

slide-16
SLIDE 16

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 16

Committing changes

■ Commiting changes made in the working copy:

s v n c

  • m

m i t

■ Listing status (modified, etc) of files in working copy:

s v n s t a t u s

■ Bringing changes from the repository into the working copy:

s v n u p

slide-17
SLIDE 17

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 17

Branches and tags

■ 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:

s v n c

  • p

y

  • m "

C r e a t i n g b r a n c h d u m m y " \ f i l e : / / / h

  • m

e / s v n / r e p

  • s

/ t r u n k \ f i l e : / / / h

  • m

e / s v n / r e p

  • s

/ b r a n c h e s / d u m m y

■ Merging changes from somewhere else to working copy:

s v n m e r g e

  • r

7 : 8 6 \ f i l e : / / / s v n / r e p

  • s

/ b r a n c h / t e s t i n g . s v n m e r g e f i l e : / / / s v n / r e p

  • s

/ b r a n c h / s t a b l e \ f i l e : / / / s v n / r e p

  • s

/ b r a n c h / t e s t i n g .

■ A “tagged version” is also just a copy. It just never gets

modified.

slide-18
SLIDE 18

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 18

Getting Help (1)

■ The command s

v n h e l p lists all subcommands for s v n: a d d , b l a m e ( p r a i s e , a n n

  • t

a t e , a n n ) , c a t , c h e c k

  • u

t ( c

  • )

, c l e a n u p , c

  • m

m i t ( c i ) , c

  • p

y ( c p ) , d e l e t e ( d e l , r e m

  • v

e , r m ) , d i f f ( d i ) , e x p

  • r

t , h e l p ( ? , h ) , i m p

  • r

t , i n f

  • ,

l i s t ( l s ) , l

  • g

, m e r g e , m k d i r , m

  • v

e ( m v , r e n a m e , r e n ) , p r

  • p

d e l ( p d e l , p d ) , p r

  • p

e d i t ( p e d i t , p e ) , p r

  • p

g e t ( p g e t , p g ) , p r

  • p

l i s t ( p l i s t , p l ) , p r

  • p

s e t ( p s e t , p s ) , r e s

  • l

v e d , r e v e r t , s t a t u s ( s t a t , s t ) , s w i t c h ( s w ) , u p d a t e ( u p )

■ The command s

v n h e l p

subcommand gives a detailed

description

slide-19
SLIDE 19

Introduction Using Subversion

  • Creating a repository
  • Creating a working copy
  • Making changes (1)
  • Making changes (2)
  • Committing changes
  • Branches and tags
  • Getting Help (1)
  • Getting Help (2)

The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 19

Getting Help (2)

■ The command s

v n a d m i n h e l p does it for s v n a d m i n : c r e a t e , d e l t i f y , d u m p , h e l p ( ? , h ) , h

  • t

c

  • p

y , l i s t

  • d

b l

  • g

s , l i s t

  • u

n u s e d

  • d

b l

  • g

s , l

  • a

d , l s t x n s , r e c

  • v

e r , r m t x n s , s e t l

  • g

, v e r i f y

■ The command s

v n a d m i n h e l p

subcommand gives a

detailed description

■ The Subversion Handbook is a great Subversion tutorial:

http://svnbook.red-bean.com/

slide-20
SLIDE 20

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 20

The SubMaster Client

slide-21
SLIDE 21

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 21

Overview

■ The SubMaster client s

m is a simple perl script which automates the creation and management of local Subversion repositories

■ The SubMaster client also automates the creation of patches

and sending them upstream to the SubMaster server

■ A detailed help message explaining all subcommands to s

m is printed out by s m h e l p

slide-22
SLIDE 22

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 22

Creating a local tree

■ Create a local copy of the master repository:

s m c r e a t e s v n : / / e x a m p l e .

  • r

g / d e m

  • /

t r u n k d e m

  • ■ This creates two directories:

◆ d

e m

  • The local working copy

◆ d

e m

  • .

s m Local repository and other sm data

■ Create an account at the SubMaster Server:

w 3 m h t t p s : / / e x a m p l e .

  • r

g / d e m

  • /

s u b m a s t e r

■ Add your SubMaster Login information to your SM tree:

v i d e m

  • .

s m / S M / s e r v e r . t x t h t t p s : / / e x a m p l e .

  • r

g / d e m

  • /

s u b m a s t e r < u s e r n a m e > < p a s s w

  • r

d >

slide-23
SLIDE 23

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 23

Creating patches (1)

■ Make your changes in d

e m

  • / as usual.

■ Use s

v n a d d, s v n r m and s v n m v for adding, removing and moving files or directories

■ Use s

m c

  • m

m i t instead of s v n c

  • m

m i t to commit your changes to the local repository

■ Sometimes an s

v n u p is required before s m c

  • m

m i t can succeed.

slide-24
SLIDE 24

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 24

Creating patches (2)

■ Use s

m q u e u e to list the pending changes: r 4 4 | r

  • t

| 2 4

  • 1
  • 1

1 2 : 1 : 5 8 + 1 ( S a t , A d d e d p a c k a g e

  • p

r

  • f

i l e .

  • r

5 1 | r

  • t

| 2 4

  • 1
  • 1

1 3 : 3 4 : 3 5 + 1 ( S a t , O p r

  • f

i l e : d

  • n

’ t r u n d e p m

  • d

.

  • ■ Use s

m p a t c h to create a patch from your changes: s m p a t c h r 4 4 r 5 1

■ Use s

m s e n d to send the patch upstream to the SubMaster Server.

slide-25
SLIDE 25

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 25

Syncing with the main tree

■ Merging changes from master tree to local tree: ◆ s

m s y n c

◆ manually resolve conflicts, if any ◆ patches beeing applied in master do not result in conflicts ◆ s

v n c

  • m

m i t

  • m "

S M S y n c 2 4 3 4 : 2 4 4 2 "

■ Full-syncing local tree to master: ◆ s

m f s y n c

◆ This will discard all local changes ■ Showing differences between local tree and master: ◆ s

m d i f f

slide-26
SLIDE 26

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 26

WIP Archive

■ The WIP (work-in-progress) archive can be used to suspend

the work on a changeset and resume it later.

■ Revert in working copy and save as patch in WIP archive:

s m w i p p u s h

name r

1 8 r 1 8 1 r 1 8 2

■ Apply patch in working tree and remove from WIP archive:

s m w i p p u l l

name

■ Move patch from WIP archive to current working directory:

s m w i p c

  • name

■ Move patch from current working directory to WIP archive:

s m w i p c i name

■ List patches in WIP archive: s

m w i p

slide-27
SLIDE 27

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 27

Filesystem Layout (1)

■ d

e m

  • /

The local Subversion working copy

■ d

e m

  • .

s m / * . p a t c h Patches waiting to be send to server

■ d

e m

  • .

s m / S E N T / Patches already sent to server

■ d

e m

  • .

s m / W I P / Archive of work-in-progres patches

■ d

e m

  • .

s m / M A S T E R / Exported up-to-date master tree

■ d

e m

  • .

s m / S V N / Local Subversion Repository (DB)

slide-28
SLIDE 28

Introduction Using Subversion The SubMaster Client

  • Overview
  • Creating a local tree
  • Creating patches (1)
  • Creating patches (2)
  • Syncing with the main tree
  • WIP Archive
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 28

Filesystem Layout (2)

■ d

e m

  • /

S M / m a s t e r . t x t URL of main SVN repository

■ d

e m

  • /

S M / m r e v . t x t Revision currently in MASTER/

■ d

e m

  • /

S M / q u e u e . t x t Revisions in the change queue

■ d

e m

  • /

S M / s e r v e r . t x t URL, etc. for SM Server

■ d

e m

  • /

S M / s y n c . t x t Last master rev. synced to local

slide-29
SLIDE 29

Introduction Using Subversion The SubMaster Client The SubMaster Server

  • Overview
  • Patch Properties
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 29

The SubMaster Server

slide-30
SLIDE 30

Introduction Using Subversion The SubMaster Client The SubMaster Server

  • Overview
  • Patch Properties
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 30

Overview

■ 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

master Subversion Repository

■ The tools s

m and s m a p can communicate directly with the cgi script, no webbrowser is needed

■ E-mail notifications, etc. can be implemented using action

scripts

slide-31
SLIDE 31

Introduction Using Subversion The SubMaster Client The SubMaster Server

  • Overview
  • Patch Properties
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 31

Patch Properties

■ A Unique Patch ID (such as "2

4 1 1 2 3 6 4 6 1 5 1 8 ")

■ 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

slide-32
SLIDE 32

Introduction Using Subversion The SubMaster Client The SubMaster Server

  • Overview
  • Patch Properties
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 32

Filesystem Layout (1)

■ p

a s s w

  • r

d / < u s e r n a m e > . t x t encrypted password

■ p

a s s w

  • r

d / < u s e r n a m e > . s u p e r if this file exists, the matching user is a superuser

■ u

s e r / < u s e r n a m e > . e m a i l the e-mail address of that user

■ o

p e n / < y e a r > < m

  • n

t h > < i d > .

  • p

e n empy file which marks a patch as open

slide-33
SLIDE 33

Introduction Using Subversion The SubMaster Client The SubMaster Server

  • Overview
  • Patch Properties
  • Filesystem Layout (1)
  • Filesystem Layout (2)

The smap helper script SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 33

Filesystem Layout (2)

■ d

a t a / < y e a r > / < m

  • n

t h > / < i d > . p a t c h the patch file as originally sent by the user

■ d

a t a / < y e a r > / < m

  • n

t h > / < i d > . m s g messages attached to the patch

■ d

a t a / < y e a r > / < m

  • n

t h > / < i d > . v

  • t

e s votes by different users

■ d

a t a / < y e a r > / < m

  • n

t h > / < i d > .

  • w

n e r this patches owner

■ d

a t a / < y e a r > / < m

  • n

t h > / < i d > . i n f

  • auto-created additional info

■ d

a t a / < y e a r > / < m

  • n

t h > / < i d > . d

  • n

e eighter "Applied" or "Rejected" does not exist for open patches

slide-34
SLIDE 34

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script

  • Overview
  • Options
  • Configuration
  • Fixdiff

SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 34

The smap helper script

slide-35
SLIDE 35

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script

  • Overview
  • Options
  • Configuration
  • Fixdiff

SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 35

Overview

■ 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

v n a d d and s v n r m commands

◆ Run s

v n c

  • m

m i t

◆ Mark patch as applied ■ E.g. for maintaining the official tree ■ E.g. for testing or extending patches ■ Sometimes called by s

m

■ Usage: s

m a p [

  • p

t i

  • n

s ] < p a t c h

  • i

d >

slide-36
SLIDE 36

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script

  • Overview
  • Options
  • Configuration
  • Fixdiff

SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 36

Options

■ -pN -l -R

pass this option to the patch program

■ -d

just make a dry-run

■ -S

don’t commit to svn (e.g. if this isn’t a svn tree)

■ -E

edit commit message before running svn commit

■ -D

don’t remove temp files after success

■ -a file

add this smap command to file after success

■ -A

don’t apply anything, just do -a

■ -M

mark patch as applied on SM Server

■ -C

do nothing if already marked as applied

slide-37
SLIDE 37

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script

  • Overview
  • Options
  • Configuration
  • Fixdiff

SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 37

Configuration

■ If this is a SubMaster tree, read config from the SM config. ■ Otherwise read server URL, Username and Password from

. / s m a p . c f g .

■ It’s also possible modify the parameter list in .

/ s m a p . c f g : s e t -

  • -

M - I " $ @ " U R L = " h t t p s : / / w w w . r

  • c

k l i n u x . n e t / s u b m a s t e r " U S E R = " a d m i n

  • u

s e r n a m e " P A S S = " a d m i n

  • p

a s s w

  • r

d "

slide-38
SLIDE 38

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script

  • Overview
  • Options
  • Configuration
  • Fixdiff

SubMaster Action Scripts URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 38

Fixdiff

■ Can be used to create patches for patches (e.g. so they

apply cleanly)

■ s

m a p 2 4 4 5 9 4 2 3 3 2 7 9 1 3 (this fails)

■ f

i x d i f f 2 4 4 5 9 4 2 3 3 2 7 9 1 3 . p a t c h c

  • p

a c k a g e / b a s e / l i n u x 2 4 / l x c

  • n

f i g . s h

■ Merge p

a c k a g e / b a s e / l i n u x 2 4 / l x c

  • n

f i g . s h . r e j

■ f

i x d i f f 2 4 4 5 9 4 2 3 3 2 7 9 1 3 . p a t c h c i p a c k a g e / b a s e / l i n u x 2 4 / l x c

  • n

f i g . s h

■ -

  • > f

i x d i f f 2 4 4 5 9 4 2 3 3 2 7 9 1 3 . p a t c h

slide-39
SLIDE 39

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts

  • Overview
  • Calling Convention

URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 39

SubMaster Action Scripts

slide-40
SLIDE 40

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts

  • Overview
  • Calling Convention

URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 40

Overview

■ Action scripts are called whenever the status of a patch

changes

■ 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

slide-41
SLIDE 41

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts

  • Overview
  • Calling Convention

URLs and References Clifford Wolf, September 22, 2004 SubMaster – p. 41

Calling Convention

■ .

/ a c t i

  • n

. s h

id user n

e w

■ .

/ a c t i

  • n

. s h

id user m

s g ’

Message Text’

■ .

/ a c t i

  • n

. s h

id user v

  • t

e c

  • n

t r a

■ .

/ a c t i

  • n

. s h

id user v

  • t

e p r

  • ■ .

/ a c t i

  • n

. s h

id user v

  • t

e d e l e t e

■ .

/ a c t i

  • n

. s h

id user s

t a t u s r e j e c t e d

■ .

/ a c t i

  • n

. s h

id user s

t a t u s a p p l i e d

■ .

/ a c t i

  • n

. s h

id user s

t a t u s

  • p

e n e d

■ .

/ a c t i

  • n

. s h

id user s

t a t u s d i s c a r d e d

slide-42
SLIDE 42

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References

  • Subversion and SubMaster
  • Related Projects
  • Credits

Clifford Wolf, September 22, 2004 SubMaster – p. 42

URLs and References

slide-43
SLIDE 43

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References

  • Subversion and SubMaster
  • Related Projects
  • Credits

Clifford Wolf, September 22, 2004 SubMaster – p. 43

Subversion and SubMaster

■ The Subversion Handbook:

http://svnbook.red-bean.com/

■ The Subversion Homepage:

http://subversion.tigris.org/

■ The SubMaster Homepage:

http://www.rocklinux.org/submaster.html

slide-44
SLIDE 44

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References

  • Subversion and SubMaster
  • Related Projects
  • Credits

Clifford Wolf, September 22, 2004 SubMaster – p. 44

Related Projects

■ SVK: A decentralized system based on Subversion ■ Transvn: A patch-scripts clone based on Subversion

http://alexm.here.ru/transvn/

■ SVM: Mirror Remote Subversion Repository to local

http://search.cpan.org/ clkao/SVN-Mirror/

slide-45
SLIDE 45

Introduction Using Subversion The SubMaster Client The SubMaster Server The smap helper script SubMaster Action Scripts URLs and References

  • Subversion and SubMaster
  • Related Projects
  • Credits

Clifford Wolf, September 22, 2004 SubMaster – p. 45

Credits

■ LINBIT Information Technologies GmbH:

http://www.linbit.com/

■ The ROCK Linux Project:

http://www.rocklinux.org/

■ Clifford Wolf:

http://www.clifford.at/ http://www.rocklinux.org/submaster.html