comparison tests/test-share-bookmarks.t @ 42314:314056e438a9

tests: fix share test to actually share the repo "repo2" is clearly meant to be a share from "repo1" but without sharing bookmarks. However, `hg unshare` was called in the repo, so it had become completely unrelated and thus not testing what it was supposed to test. Differential Revision: https://phab.mercurial-scm.org/D6385
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 15 May 2019 11:53:22 -0700
parents 81ece800576a
children 526750cdd02d
comparison
equal deleted inserted replaced
42313:81ece800576a 42314:314056e438a9
19 $ cd .. 19 $ cd ..
20 $ hg share repo1 repo2 20 $ hg share repo1 repo2
21 updating working directory 21 updating working directory
22 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 22 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 23
24 unshare it
25
26 $ cd repo2
27 $ hg unshare
28
29 check that a change does not propagate
30
31 $ echo b >> b
32 $ hg commit -m'change in unshared'
33 $ cd ../repo1
34 $ hg id -r tip
35 c2e0ac586386 tip
36
37 $ cd ..
38
39 test sharing bookmarks 24 test sharing bookmarks
40 25
41 $ hg share -B repo1 repo3 26 $ hg share -B repo1 repo3
42 updating working directory 27 updating working directory
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 28 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ hg bookmarks 31 $ hg bookmarks
47 * bm1 2:c2e0ac586386 32 * bm1 2:c2e0ac586386
48 $ cd ../repo2 33 $ cd ../repo2
49 $ hg book bm2 34 $ hg book bm2
50 $ hg bookmarks 35 $ hg bookmarks
51 * bm2 3:0e6e70d1d5f1 36 * bm2 2:c2e0ac586386
52 $ cd ../repo3 37 $ cd ../repo3
53 $ hg bookmarks 38 $ hg bookmarks
54 bm1 2:c2e0ac586386 39 bm1 2:c2e0ac586386
55 $ hg book bm3 40 $ hg book bm3
56 $ hg bookmarks 41 $ hg bookmarks
67 In "hg share" case, another transaction can't run in other 52 In "hg share" case, another transaction can't run in other
68 repositories sharing same source repository, because starting 53 repositories sharing same source repository, because starting
69 transaction requires locking store of source repository. 54 transaction requires locking store of source repository.
70 55
71 Therefore, this test scenario ignores checking visibility of 56 Therefore, this test scenario ignores checking visibility of
72 .hg/bookmakrs.pending in repo2, which shares repo1 without bookmarks. 57 .hg/bookmarks.pending in repo2, which shares repo1 without bookmarks.
73 58
74 $ cat > $TESTTMP/checkbookmarks.sh <<EOF 59 $ cat > $TESTTMP/checkbookmarks.sh <<EOF
75 > echo "@repo1" 60 > echo "@repo1"
76 > hg -R "$TESTTMP/repo1" bookmarks 61 > hg -R "$TESTTMP/repo1" bookmarks
77 > echo "@repo2" 62 > echo "@repo2"
86 @repo1 71 @repo1
87 bm1 2:c2e0ac586386 72 bm1 2:c2e0ac586386
88 bm3 2:c2e0ac586386 73 bm3 2:c2e0ac586386
89 * bmX 2:c2e0ac586386 74 * bmX 2:c2e0ac586386
90 @repo2 75 @repo2
91 * bm2 3:0e6e70d1d5f1 76 * bm2 2:c2e0ac586386
92 @repo3 77 @repo3
93 bm1 2:c2e0ac586386 78 bm1 2:c2e0ac586386
94 * bm3 2:c2e0ac586386 79 * bm3 2:c2e0ac586386
95 bmX 2:c2e0ac586386 80 bmX 2:c2e0ac586386
96 transaction abort! 81 transaction abort!
107 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX 92 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
108 @repo1 93 @repo1
109 * bm1 2:c2e0ac586386 94 * bm1 2:c2e0ac586386
110 bm3 2:c2e0ac586386 95 bm3 2:c2e0ac586386
111 @repo2 96 @repo2
112 * bm2 3:0e6e70d1d5f1 97 * bm2 2:c2e0ac586386
113 @repo3 98 @repo3
114 bm1 2:c2e0ac586386 99 bm1 2:c2e0ac586386
115 bm3 2:c2e0ac586386 100 bm3 2:c2e0ac586386
116 * bmX 2:c2e0ac586386 101 * bmX 2:c2e0ac586386
117 transaction abort! 102 transaction abort!