3 # Copyright (c) 2005 Petr Baudis
5 test_description
="Tests circular cg-fetch
7 The base for the test is the following description of Russel King workflow:
9 Linus' kernel.org tree --> Local pristine tree
12 | | working tree 1 working tree 2
14 | \`----------------' |
15 \`---------------------------------'
17 Changes are made in working tree 1, and made available to Linus. Linus
18 merges them into his tree. I fetch them into the pristine tree. Assume
19 other changes occurred. in Linus' tree.
21 The pristine tree is obviously a superset of the working tree.
23 One example of a problem arising from this - after one round, objects which
24 first appeared in working tree would be overwritten with the same objects
29 # repo1 == kernel.org, repo2 == pristine tree, repo3 == working tree
30 # FIXME: Simulate network communication with repo1.
34 test_expect_success
'initialize repo1' \
35 "(cd repo1 && cg-init -I && cg-add brm && cg-commit -C -m\"Initial commit\")"
36 test_expect_success
'clone repo2' \
37 "cg-clone repo1 repo2"
38 test_expect_success
'clone repo3' \
39 "cg-clone repo2 repo3"
41 test_expect_success
'registering repo3 in repo1' \
42 "(cd repo1 && cg-branch-add origin ../repo3)"
45 test_expect_success
'local commit in repo3' \
46 "(cd repo3 && cg-commit -m\"Second commit\")"
48 test_expect_success
'updating repo1' \
49 "(cd repo1 && cg-update origin)"
50 test_expect_success
'updating repo2' \
51 "(cd repo2 && cg-update)"
52 test_expect_success
'updating repo3' \
53 "(cd repo3 && cg-update)"