|
1
|
<title>Child Projects</title> |
|
2
|
|
|
3
|
<h2>Background</h2> |
|
4
|
|
|
5
|
The default behavior of Fossil is to share everything (all check-ins, |
|
6
|
tickets, wiki, etc) between all clients and all servers. Such a policy |
|
7
|
helps to promote a cohesive design for a cathedral-style project run |
|
8
|
by a small cliche of developers - the sort of project for which Fossil |
|
9
|
was designed. |
|
10
|
|
|
11
|
But sometimes it is desirable to branch off a side project that does not |
|
12
|
sync back to the master but does continue to track changes in the master. |
|
13
|
For example, the master project might be an open-source project like |
|
14
|
[https://www.sqlite.org/|SQLite] and a team might want to do a proprietary |
|
15
|
closed-source enhancement to that master project in a separate repository. |
|
16
|
All changes in the master project should flow forward into the derived |
|
17
|
project, but care must be taken to prevent proprietary content from the |
|
18
|
derived project from leaking back into the master. |
|
19
|
|
|
20
|
<h2>Child Projects</h2> |
|
21
|
|
|
22
|
A scenario such as the above can be accomplished in Fossil by creating |
|
23
|
a child project. The child project is able to freely pull from the parent, |
|
24
|
but the parent cannot push or pull from the child nor is the child able to |
|
25
|
push to the parent. Content flows from parent to child only, and then only |
|
26
|
at the request of the child. |
|
27
|
|
|
28
|
<h2>Creating a Child Project</h2> |
|
29
|
|
|
30
|
To create a new child project, first clone the parent. Then make manual |
|
31
|
SQL changes to the child repository as follows: |
|
32
|
|
|
33
|
<verbatim> |
|
34
|
UPDATE config SET name='parent-project-code' WHERE name='project-code'; |
|
35
|
UPDATE config SET name='parent-project-name' WHERE name='project-name'; |
|
36
|
INSERT INTO config(name,value) |
|
37
|
VALUES('project-code',lower(hex(randomblob(20)))); |
|
38
|
INSERT INTO config(name,value) |
|
39
|
VALUES('project-name','CHILD-PROJECT-NAME'); |
|
40
|
</verbatim> |
|
41
|
|
|
42
|
Modify the CHILD-PROJECT-NAME in the last statement to be the name of |
|
43
|
the child project, of course. |
|
44
|
|
|
45
|
The repository is now a separate project, independent from its parent. |
|
46
|
Clone the new project to the developers as needed. |
|
47
|
|
|
48
|
The child project and the parent project will not normally be able to sync |
|
49
|
with one another, since they are now separate projects with distinct |
|
50
|
project codes. However, if the |
|
51
|
"--from-parent-project" command-line option is provided to the |
|
52
|
"[/help/pull|fossil pull]" command in the child, and the URL of |
|
53
|
parent repository is also provided on the command-line, then updates to |
|
54
|
the parent project that occurred after the child was created will be added |
|
55
|
to the child repository. Thus, by periodically doing a |
|
56
|
pull --from-parent-project, the child project is able to stay up to date |
|
57
|
with all the latest changes in the parent. |
|
58
|
|