/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
5749.2.1 by mbp at sourcefrog
For the mini tutorial, just describe publishing to Launchpad, not SFTP
1
.. _publishing_a_branch:
2
2977.1.6 by Ian Clatworthy
first cut at Central development chapter
3
Publishing a branch
4
===================
5
6
Setting up a central repository
7
-------------------------------
8
9
While the centralized workflow can be used by socially nominating
10
any branch on any computer as the central one, in practice most
11
teams have a dedicated server for hosting central branches.
12
13
Just as it's best practice to use a shared repository locally,
14
it's advisable to put central branches in a shared repository.
15
Note that central shared branches typically only want to
16
store history, not working copies of files, so their enclosing
17
repository is usually creating using the ``no-trees`` option, e.g.::
18
6622.1.23 by Jelmer Vernooij
More renames in English docs.
19
  brz init-repo --no-trees bzr+ssh://centralhost/srv/brz/PROJECT
2977.1.6 by Ian Clatworthy
first cut at Central development chapter
20
21
You can think of this step as similar to setting up a new cvsroot or
6622.1.23 by Jelmer Vernooij
More renames in English docs.
22
Subversion repository. However, Breezy gives you more flexibility
3104.2.3 by Ian Clatworthy
make Choosing a shared repsoitory layout an appendix
23
in how branches may be organised in your repository. See
4634.39.41 by Ian Clatworthy
Fix the broken links in the User Guide
24
`Advanced shared repository layouts <shared_repository_layouts.html>`_
25
in the appendices for guidelines and examples.
3104.2.3 by Ian Clatworthy
make Choosing a shared repsoitory layout an appendix
26
2977.1.6 by Ian Clatworthy
first cut at Central development chapter
27
28
Starting a central branch
29
-------------------------
30
31
There are two ways of populating a central branch with some initial
32
content:
33
34
 1. Making a local branch and pushing it to a central location
35
 2. Making an empty central branch then committing content to it.
36
37
Here is an example of the first way::
38
6622.1.23 by Jelmer Vernooij
More renames in English docs.
39
  brz init-repo PROJECT  (prepare local repository)
40
  brz init PROJECT/trunk
3918.1.1 by Jari Aalto
In user guide, use 'PROJECT' as a metavariable not 'X-repo'
41
  cd PROJECT/trunk
42
			 (copy development files)
43
  cp -ar ~/PROJECT .     (copy files in using OS-specific tools)
6622.1.23 by Jelmer Vernooij
More renames in English docs.
44
  brz add                (populate repository; start version control)
45
  brz commit -m "Initial import"
3918.1.1 by Jari Aalto
In user guide, use 'PROJECT' as a metavariable not 'X-repo'
46
                         (publish to central repository)
6622.1.23 by Jelmer Vernooij
More renames in English docs.
47
  brz push bzr+ssh://centralhost/srv/brz/PROJECT/trunk
2977.1.6 by Ian Clatworthy
first cut at Central development chapter
48
49
Here is an example of the second way::
50
6622.1.23 by Jelmer Vernooij
More renames in English docs.
51
  brz init-repo PROJECT  (prepare local repository)
3918.1.1 by Jari Aalto
In user guide, use 'PROJECT' as a metavariable not 'X-repo'
52
  cd PROJECT
6622.1.23 by Jelmer Vernooij
More renames in English docs.
53
  brz init bzr+ssh://centralhost/srv/brz/PROJECT/trunk
54
  brz checkout bzr+ssh://centralhost/srv/brz/PROJECT/trunk
3918.1.1 by Jari Aalto
In user guide, use 'PROJECT' as a metavariable not 'X-repo'
55
  cd trunk
56
  cp -ar ~/PROJECT .     (copy files in using OS-specific tools)
6622.1.23 by Jelmer Vernooij
More renames in English docs.
57
  brz add                (populate repository; start version control)
58
  brz commit -m "Initial import"
3918.1.1 by Jari Aalto
In user guide, use 'PROJECT' as a metavariable not 'X-repo'
59
                         (publish to central repository)
2977.1.6 by Ian Clatworthy
first cut at Central development chapter
60
61
Note that committing inside a working tree created using
62
the ``checkout`` command implicitly commits the content to
63
the central location as well as locally. Had we used the
64
``branch`` command instead of ``checkout`` above, the
65
content would have only been committed locally.
66
67
Working trees that are tightly bound to a central location
68
like this are called *checkouts*. The rest of this chapter
69
explains their numerous features in more detail.