~bzr-svn/bzr-svn/1.2

« back to all changes in this revision

Viewing changes to HACKING

  • Committer: Jelmer Vernooij
  • Date: 2012-04-21 23:14:27 UTC
  • Revision ID: jelmer@samba.org-20120421231427-x7ns11f7ryolk83v
Add some documentation about the structure of bzr-svn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
                revspec_registry.register_lazy("svn", "bzrlib.plugins.svn.revspec", 
22
22
                                                                           "RevisionSpec_svn")
23
23
 
 
24
Structure
 
25
~~~~~~~~~
 
26
 
 
27
bzr-svn provides Subversion-specific implementations of Branch, ControlDir,
 
28
Prober, Repository and WorkingTree.
 
29
 
 
30
Subversion essentially has two formats - the repository directory, which
 
31
contains all the revision data and the branches, and the working copy, which is
 
32
what the user works in.
 
33
 
 
34
Because of this, bzr-svn provides two custom probers and dir implementations - 
 
35
one that can probe for and open working copies and one which can probe for and
 
36
open Subversion repositories.
 
37
 
 
38
The control directory implementation for the working copy provides just a working
 
39
tree. The control directory implementation for the repository exists not just for the
 
40
file system directory of the repository itself but for each of the "virtual"
 
41
file paths in the repository too.
 
42
 
 
43
Most of the complexity in bzr-svn has to do with mapping Subversion history into 
 
44
Bazaar history and making the distinction between what is a branch and what isn't.
 
45
 
 
46
The "repository layout" is an object that takes a path and can tell whether it is
 
47
the path to a branch, merely a path inside of a branch or something else. There
 
48
are a couple of implementations of repository layouts which use common conventions
 
49
(like the standard trunk;branches/XX;tags/YY approach, or a branch at the
 
50
 repository root). If no repository layout is specified, bzr-svn will autodetect it
 
51
using the code in layout/guess.py.
 
52
 
 
53
A "mapping" describes a particular way in which bzr metadata is mapped onto svn
 
54
and vice versa.
 
55
 
 
56
There are three layers to the code that actually deals with analysis of history.
 
57
 
 
58
logwalker.py provides an overall view of the history, sticking mostly to the
 
59
Subversion semantics. There are two implementations - one that just calls out
 
60
to Subversion and one that stores the history in a cache and reads from that
 
61
cache later.
 
62
 
 
63
metagraph.py provides the next layer, which wraps the logwalker and allows
 
64
iterating over the history but split up by branch according to a specified branch
 
65
layout.
 
66
 
 
67
revmeta.py provides another layer, and allows walking over both branches and the
 
68
relevant mappings.
 
69
 
24
70
Coding Style, etc
25
71
~~~~~~~~~~~~~~~~~
26
72
Please refer to HACKING in the Bazaar source distribution.
27