Mercurial > hg
annotate 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 |
rev | line source |
---|---|
12487 | 1 $ echo "[extensions]" >> $HGRCPATH |
2 $ echo "share = " >> $HGRCPATH | |
3 | |
4 prepare repo1 | |
9990 | 5 |
12487 | 6 $ hg init repo1 |
7 $ cd repo1 | |
8 $ echo a > a | |
9 $ hg commit -A -m'init' | |
10 adding a | |
42313
81ece800576a
tests: separate out bookmarks tests from test-share.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
41965
diff
changeset
|
11 $ echo a >> a |
81ece800576a
tests: separate out bookmarks tests from test-share.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
41965
diff
changeset
|
12 $ hg commit -m'change in shared clone' |
81ece800576a
tests: separate out bookmarks tests from test-share.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
41965
diff
changeset
|
13 $ echo b > b |
81ece800576a
tests: separate out bookmarks tests from test-share.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
41965
diff
changeset
|
14 $ hg commit -A -m'another file' |
81ece800576a
tests: separate out bookmarks tests from test-share.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
41965
diff
changeset
|
15 adding b |
12487 | 16 |
17 share it | |
9990 | 18 |
12487 | 19 $ cd .. |
20 $ hg share repo1 repo2 | |
21 updating working directory | |
42313
81ece800576a
tests: separate out bookmarks tests from test-share.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
41965
diff
changeset
|
22 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
12487 | 23 |
23614
cd79fb4d75fd
share: add option to share bookmarks
Ryan McElroy <rmcelroy@fb.com>
parents:
23548
diff
changeset
|
24 test sharing bookmarks |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
25 |
23614
cd79fb4d75fd
share: add option to share bookmarks
Ryan McElroy <rmcelroy@fb.com>
parents:
23548
diff
changeset
|
26 $ hg share -B repo1 repo3 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
27 updating working directory |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
28 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
29 $ cd repo1 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
30 $ hg bookmark bm1 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
31 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
32 * bm1 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
33 $ cd ../repo2 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
34 $ hg book bm2 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
35 $ hg bookmarks |
42314
314056e438a9
tests: fix share test to actually share the repo
Martin von Zweigbergk <martinvonz@google.com>
parents:
42313
diff
changeset
|
36 * bm2 2:c2e0ac586386 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
37 $ cd ../repo3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
38 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
39 bm1 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
40 $ hg book bm3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
41 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
42 bm1 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
43 * bm3 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
44 $ cd ../repo1 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
45 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
46 * bm1 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
47 bm3 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
48 |
31052
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
49 check whether HG_PENDING makes pending changes only in relatd |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
50 repositories visible to an external hook. |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
51 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
52 In "hg share" case, another transaction can't run in other |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
53 repositories sharing same source repository, because starting |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
54 transaction requires locking store of source repository. |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
55 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
56 Therefore, this test scenario ignores checking visibility of |
42314
314056e438a9
tests: fix share test to actually share the repo
Martin von Zweigbergk <martinvonz@google.com>
parents:
42313
diff
changeset
|
57 .hg/bookmarks.pending in repo2, which shares repo1 without bookmarks. |
31052
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
58 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
59 $ cat > $TESTTMP/checkbookmarks.sh <<EOF |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
60 > echo "@repo1" |
31767
6c800688afe1
tests: quote paths in shell script hooks
Matt Harbison <matt_harbison@yahoo.com>
parents:
31766
diff
changeset
|
61 > hg -R "$TESTTMP/repo1" bookmarks |
31052
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
62 > echo "@repo2" |
31767
6c800688afe1
tests: quote paths in shell script hooks
Matt Harbison <matt_harbison@yahoo.com>
parents:
31766
diff
changeset
|
63 > hg -R "$TESTTMP/repo2" bookmarks |
31052
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
64 > echo "@repo3" |
31767
6c800688afe1
tests: quote paths in shell script hooks
Matt Harbison <matt_harbison@yahoo.com>
parents:
31766
diff
changeset
|
65 > hg -R "$TESTTMP/repo3" bookmarks |
31052
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
66 > exit 1 # to avoid adding new bookmark for subsequent tests |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
67 > EOF |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
68 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
69 $ cd ../repo1 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
70 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
71 @repo1 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
72 bm1 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
73 bm3 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
74 * bmX 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
75 @repo2 |
42314
314056e438a9
tests: fix share test to actually share the repo
Martin von Zweigbergk <martinvonz@google.com>
parents:
42313
diff
changeset
|
76 * bm2 2:c2e0ac586386 |
31052
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
77 @repo3 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
78 bm1 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
79 * bm3 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
80 bmX 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
81 transaction abort! |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
82 rollback completed |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
83 abort: pretxnclose hook exited with status 1 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
84 [255] |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
85 $ hg book bm1 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
86 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
87 FYI, in contrast to above test, bmX is invisible in repo1 (= shared |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
88 src), because (1) HG_PENDING refers only repo3 and (2) |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
89 "bookmarks.pending" is written only into repo3. |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
90 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
91 $ cd ../repo3 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
92 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
93 @repo1 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
94 * bm1 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
95 bm3 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
96 @repo2 |
42314
314056e438a9
tests: fix share test to actually share the repo
Martin von Zweigbergk <martinvonz@google.com>
parents:
42313
diff
changeset
|
97 * bm2 2:c2e0ac586386 |
31052
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
98 @repo3 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
99 bm1 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
100 bm3 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
101 * bmX 2:c2e0ac586386 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
102 transaction abort! |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
103 rollback completed |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
104 abort: pretxnclose hook exited with status 1 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
105 [255] |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
106 $ hg book bm3 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
107 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
108 $ cd ../repo1 |
0332b8fafd05
bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25474
diff
changeset
|
109 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
110 test that commits work |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
111 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
112 $ echo 'shared bookmarks' > a |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
113 $ hg commit -m 'testing shared bookmarks' |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
114 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
115 * bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
116 bm3 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
117 $ cd ../repo3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
118 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
119 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
120 * bm3 2:c2e0ac586386 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
121 $ echo 'more shared bookmarks' > a |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
122 $ hg commit -m 'testing shared bookmarks' |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
123 created new head |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
124 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
125 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
126 * bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
127 $ cd ../repo1 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
128 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
129 * bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
130 bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
131 $ cd .. |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
132 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
133 test pushing bookmarks works |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
134 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
135 $ hg clone repo3 repo4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
136 updating to branch default |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
137 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
138 $ cd repo4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
139 $ hg boo bm4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
140 $ echo foo > b |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
141 $ hg commit -m 'foo in b' |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
142 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
143 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
144 bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
145 * bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
146 $ hg push -B bm4 |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
33986
diff
changeset
|
147 pushing to $TESTTMP/repo3 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
148 searching for changes |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
149 adding changesets |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
150 adding manifests |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
151 adding file changes |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
152 added 1 changesets with 1 changes to 1 files |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
153 exporting bookmark bm4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
154 $ cd ../repo1 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
155 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
156 * bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
157 bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
158 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
159 $ cd ../repo3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
160 $ hg bookmarks |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
161 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
162 * bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
163 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
164 $ cd .. |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
165 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
166 test behavior when sharing a shared repo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
167 |
39186
e8deaa77c1b6
share: allow more than one level of directories to be created
Matt Harbison <matt_harbison@yahoo.com>
parents:
38781
diff
changeset
|
168 $ hg share -B repo3 missingdir/repo5 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
169 updating working directory |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
39186
e8deaa77c1b6
share: allow more than one level of directories to be created
Matt Harbison <matt_harbison@yahoo.com>
parents:
38781
diff
changeset
|
171 $ cd missingdir/repo5 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
172 $ hg book |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
173 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
174 bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
175 bm4 5:92793bfc8cad |
39186
e8deaa77c1b6
share: allow more than one level of directories to be created
Matt Harbison <matt_harbison@yahoo.com>
parents:
38781
diff
changeset
|
176 $ cd ../.. |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
177 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
178 test what happens when an active bookmark is deleted |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
179 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
180 $ cd repo1 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
181 $ hg boo -d bm3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
182 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
183 * bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
184 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
185 $ cd ../repo3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
186 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
187 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
188 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
189 $ cd .. |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
190 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
191 verify that bookmarks are not written on failed transaction |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
192 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
193 $ cat > failpullbookmarks.py << EOF |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
194 > """A small extension that makes bookmark pulls fail, for testing""" |
33986
169c97d4e722
tests: update test-share to pass our import checker
Augie Fackler <raf@durin42.com>
parents:
33539
diff
changeset
|
195 > from __future__ import absolute_import |
169c97d4e722
tests: update test-share to pass our import checker
Augie Fackler <raf@durin42.com>
parents:
33539
diff
changeset
|
196 > from mercurial import ( |
169c97d4e722
tests: update test-share to pass our import checker
Augie Fackler <raf@durin42.com>
parents:
33539
diff
changeset
|
197 > error, |
169c97d4e722
tests: update test-share to pass our import checker
Augie Fackler <raf@durin42.com>
parents:
33539
diff
changeset
|
198 > exchange, |
169c97d4e722
tests: update test-share to pass our import checker
Augie Fackler <raf@durin42.com>
parents:
33539
diff
changeset
|
199 > extensions, |
169c97d4e722
tests: update test-share to pass our import checker
Augie Fackler <raf@durin42.com>
parents:
33539
diff
changeset
|
200 > ) |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
201 > def _pullbookmarks(orig, pullop): |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
202 > orig(pullop) |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
203 > raise error.HookAbort('forced failure by extension') |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
204 > def extsetup(ui): |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
205 > extensions.wrapfunction(exchange, '_pullbookmarks', _pullbookmarks) |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
206 > EOF |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
207 $ cd repo4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
208 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
209 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
210 bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
211 * bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
212 $ cd ../repo3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
213 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
214 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
215 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
216 $ hg --config "extensions.failpullbookmarks=$TESTTMP/failpullbookmarks.py" pull $TESTTMP/repo4 |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
33986
diff
changeset
|
217 pulling from $TESTTMP/repo4 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
218 searching for changes |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
219 no changes found |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
220 adding remote bookmark bm3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
221 abort: forced failure by extension |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
222 [255] |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
223 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
224 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
225 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
226 $ hg pull $TESTTMP/repo4 |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
33986
diff
changeset
|
227 pulling from $TESTTMP/repo4 |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
228 searching for changes |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
229 no changes found |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
230 adding remote bookmark bm3 |
38250
d0abd7949ea3
phases: use "published" in the phase movement message
Boris Feld <boris.feld@octobus.net>
parents:
38249
diff
changeset
|
231 1 local changesets published |
23548
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
232 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
233 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
234 * bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
235 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
236 $ cd .. |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
237 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
238 verify bookmark behavior after unshare |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
239 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
240 $ cd repo3 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
241 $ hg unshare |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
242 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
243 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
244 * bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
245 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
246 $ hg boo -d bm4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
247 $ hg boo bm5 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
248 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
249 bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
250 bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
251 * bm5 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
252 $ cd ../repo1 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
253 $ hg boo |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
254 * bm1 3:b87954705719 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
255 bm3 4:62f4ded848e4 |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
256 bm4 5:92793bfc8cad |
141baca16059
share: implement shared bookmark functionality
Ryan McElroy <rmcelroy@fb.com>
parents:
22046
diff
changeset
|
257 $ cd .. |