##// END OF EJS Templates
test-bundle2: also test the argument of the changegroup hook...
Pierre-Yves David -
r22939:e4827754 default
parent child Browse files
Show More
@@ -1,474 +1,484 b''
1 Test exchange of common information using bundle2
1 Test exchange of common information using bundle2
2
2
3
3
4 $ getmainid() {
4 $ getmainid() {
5 > hg -R main log --template '{node}\n' --rev "$1"
5 > hg -R main log --template '{node}\n' --rev "$1"
6 > }
6 > }
7
7
8 enable obsolescence
8 enable obsolescence
9
9
10 $ cat > obs.py << EOF
10 $ cat > obs.py << EOF
11 > import mercurial.obsolete
11 > import mercurial.obsolete
12 > mercurial.obsolete._enabled = True
12 > mercurial.obsolete._enabled = True
13 > EOF
13 > EOF
14
14
15 $ cat >> $HGRCPATH << EOF
15 $ cat >> $HGRCPATH << EOF
16 > [extensions]
16 > [extensions]
17 > obsolete=$TESTTMP/obs.py
17 > obsolete=$TESTTMP/obs.py
18 > [experimental]
18 > [experimental]
19 > bundle2-exp=True
19 > bundle2-exp=True
20 > [ui]
20 > [ui]
21 > ssh=python "$TESTDIR/dummyssh"
21 > ssh=python "$TESTDIR/dummyssh"
22 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
22 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
23 > [web]
23 > [web]
24 > push_ssl = false
24 > push_ssl = false
25 > allow_push = *
25 > allow_push = *
26 > [phases]
26 > [phases]
27 > publish=False
27 > publish=False
28 > [hooks]
28 > [hooks]
29 > changegroup = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" changegroup"
29 > b2x-transactionclose = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" b2x-transactionclose"
30 > b2x-transactionclose = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" b2x-transactionclose"
30 > EOF
31 > EOF
31
32
32 The extension requires a repo (currently unused)
33 The extension requires a repo (currently unused)
33
34
34 $ hg init main
35 $ hg init main
35 $ cd main
36 $ cd main
36 $ touch a
37 $ touch a
37 $ hg add a
38 $ hg add a
38 $ hg commit -m 'a'
39 $ hg commit -m 'a'
39
40
40 $ hg unbundle $TESTDIR/bundles/rebase.hg
41 $ hg unbundle $TESTDIR/bundles/rebase.hg
41 adding changesets
42 adding changesets
42 adding manifests
43 adding manifests
43 adding file changes
44 adding file changes
44 added 8 changesets with 7 changes to 7 files (+3 heads)
45 added 8 changesets with 7 changes to 7 files (+3 heads)
46 changegroup hook: HG_SOURCE=unbundle HG_URL=bundle:*/tests/bundles/rebase.hg (glob)
45 (run 'hg heads' to see heads, 'hg merge' to merge)
47 (run 'hg heads' to see heads, 'hg merge' to merge)
46
48
47 $ cd ..
49 $ cd ..
48
50
49 Real world exchange
51 Real world exchange
50 =====================
52 =====================
51
53
52 Add more obsolescence information
54 Add more obsolescence information
53
55
54 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
56 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
55 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
57 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
56
58
57 clone --pull
59 clone --pull
58
60
59 $ hg -R main phase --public cd010b8cd998
61 $ hg -R main phase --public cd010b8cd998
60 $ hg clone main other --pull --rev 9520eea781bc
62 $ hg clone main other --pull --rev 9520eea781bc
61 adding changesets
63 adding changesets
62 adding manifests
64 adding manifests
63 adding file changes
65 adding file changes
64 added 2 changesets with 2 changes to 2 files
66 added 2 changesets with 2 changes to 2 files
65 1 new obsolescence markers
67 1 new obsolescence markers
68 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2
66 updating to branch default
69 updating to branch default
67 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 $ hg -R other log -G
71 $ hg -R other log -G
69 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
72 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
70 |
73 |
71 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
74 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
72
75
73 $ hg -R other debugobsolete
76 $ hg -R other debugobsolete
74 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
77 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
75
78
76 pull
79 pull
77
80
78 $ hg -R main phase --public 9520eea781bc
81 $ hg -R main phase --public 9520eea781bc
79 $ hg -R other pull -r 24b6387c8c8c
82 $ hg -R other pull -r 24b6387c8c8c
80 pulling from $TESTTMP/main (glob)
83 pulling from $TESTTMP/main (glob)
81 searching for changes
84 searching for changes
82 adding changesets
85 adding changesets
83 adding manifests
86 adding manifests
84 adding file changes
87 adding file changes
85 added 1 changesets with 1 changes to 1 files (+1 heads)
88 added 1 changesets with 1 changes to 1 files (+1 heads)
86 1 new obsolescence markers
89 1 new obsolescence markers
90 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2
87 (run 'hg heads' to see heads, 'hg merge' to merge)
91 (run 'hg heads' to see heads, 'hg merge' to merge)
88 $ hg -R other log -G
92 $ hg -R other log -G
89 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
93 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
90 |
94 |
91 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
95 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
92 |/
96 |/
93 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
97 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
94
98
95 $ hg -R other debugobsolete
99 $ hg -R other debugobsolete
96 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
100 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
97 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
101 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
98
102
99 pull empty (with phase movement)
103 pull empty (with phase movement)
100
104
101 $ hg -R main phase --public 24b6387c8c8c
105 $ hg -R main phase --public 24b6387c8c8c
102 $ hg -R other pull -r 24b6387c8c8c
106 $ hg -R other pull -r 24b6387c8c8c
103 pulling from $TESTTMP/main (glob)
107 pulling from $TESTTMP/main (glob)
104 no changes found
108 no changes found
105 $ hg -R other log -G
109 $ hg -R other log -G
106 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
110 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
107 |
111 |
108 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
112 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
109 |/
113 |/
110 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
114 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
111
115
112 $ hg -R other debugobsolete
116 $ hg -R other debugobsolete
113 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
117 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
114 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
118 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
115
119
116 pull empty
120 pull empty
117
121
118 $ hg -R other pull -r 24b6387c8c8c
122 $ hg -R other pull -r 24b6387c8c8c
119 pulling from $TESTTMP/main (glob)
123 pulling from $TESTTMP/main (glob)
120 no changes found
124 no changes found
121 $ hg -R other log -G
125 $ hg -R other log -G
122 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
126 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
123 |
127 |
124 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
128 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
125 |/
129 |/
126 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
130 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
127
131
128 $ hg -R other debugobsolete
132 $ hg -R other debugobsolete
129 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
133 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
130 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
134 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
131
135
132 add extra data to test their exchange during push
136 add extra data to test their exchange during push
133
137
134 $ hg -R main bookmark --rev eea13746799a book_eea1
138 $ hg -R main bookmark --rev eea13746799a book_eea1
135 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
139 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
136 $ hg -R main bookmark --rev 02de42196ebe book_02de
140 $ hg -R main bookmark --rev 02de42196ebe book_02de
137 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
141 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
138 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
142 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
139 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
143 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
140 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
144 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
141 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
145 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
142 $ hg -R main bookmark --rev 32af7686d403 book_32af
146 $ hg -R main bookmark --rev 32af7686d403 book_32af
143 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
147 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
144
148
145 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
149 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
146 $ hg -R other bookmark --rev cd010b8cd998 book_02de
150 $ hg -R other bookmark --rev cd010b8cd998 book_02de
147 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
151 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
148 $ hg -R other bookmark --rev cd010b8cd998 book_5fdd
152 $ hg -R other bookmark --rev cd010b8cd998 book_5fdd
149 $ hg -R other bookmark --rev cd010b8cd998 book_32af
153 $ hg -R other bookmark --rev cd010b8cd998 book_32af
150
154
151 $ hg -R main phase --public eea13746799a
155 $ hg -R main phase --public eea13746799a
152
156
153 push
157 push
154 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
158 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
155 pushing to other
159 pushing to other
156 searching for changes
160 searching for changes
157 b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=push HG_URL=push
161 b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=push HG_URL=push
162 changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2
158 remote: adding changesets
163 remote: adding changesets
159 remote: adding manifests
164 remote: adding manifests
160 remote: adding file changes
165 remote: adding file changes
161 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
166 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
162 remote: 1 new obsolescence markers
167 remote: 1 new obsolescence markers
163 updating bookmark book_eea1
168 updating bookmark book_eea1
164 $ hg -R other log -G
169 $ hg -R other log -G
165 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
170 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
166 |\
171 |\
167 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
172 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
168 | |
173 | |
169 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
174 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
170 |/
175 |/
171 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
176 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
172
177
173 $ hg -R other debugobsolete
178 $ hg -R other debugobsolete
174 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
179 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
175 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
180 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
176 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
181 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
177
182
178 pull over ssh
183 pull over ssh
179
184
180 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
185 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
181 pulling from ssh://user@dummy/main
186 pulling from ssh://user@dummy/main
182 searching for changes
187 searching for changes
183 adding changesets
188 adding changesets
184 adding manifests
189 adding manifests
185 adding file changes
190 adding file changes
186 added 1 changesets with 1 changes to 1 files (+1 heads)
191 added 1 changesets with 1 changes to 1 files (+1 heads)
187 1 new obsolescence markers
192 1 new obsolescence markers
188 updating bookmark book_02de
193 updating bookmark book_02de
194 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2
189 (run 'hg heads' to see heads, 'hg merge' to merge)
195 (run 'hg heads' to see heads, 'hg merge' to merge)
190 $ hg -R other debugobsolete
196 $ hg -R other debugobsolete
191 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
197 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
192 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
198 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
193 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
199 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
194 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
200 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
195
201
196 pull over http
202 pull over http
197
203
198 $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log
204 $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log
199 $ cat main.pid >> $DAEMON_PIDS
205 $ cat main.pid >> $DAEMON_PIDS
200
206
201 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
207 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
202 pulling from http://localhost:$HGPORT/
208 pulling from http://localhost:$HGPORT/
203 searching for changes
209 searching for changes
204 adding changesets
210 adding changesets
205 adding manifests
211 adding manifests
206 adding file changes
212 adding file changes
207 added 1 changesets with 1 changes to 1 files (+1 heads)
213 added 1 changesets with 1 changes to 1 files (+1 heads)
208 1 new obsolescence markers
214 1 new obsolescence markers
209 updating bookmark book_42cc
215 updating bookmark book_42cc
216 changegroup hook: HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2
210 (run 'hg heads .' to see heads, 'hg merge' to merge)
217 (run 'hg heads .' to see heads, 'hg merge' to merge)
211 $ cat main-error.log
218 $ cat main-error.log
212 $ hg -R other debugobsolete
219 $ hg -R other debugobsolete
213 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
220 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
214 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
221 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
215 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
222 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
216 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
223 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
217 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
224 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
218
225
219 push over ssh
226 push over ssh
220
227
221 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
228 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
222 pushing to ssh://user@dummy/other
229 pushing to ssh://user@dummy/other
223 searching for changes
230 searching for changes
224 remote: adding changesets
231 remote: adding changesets
225 remote: adding manifests
232 remote: adding manifests
226 remote: adding file changes
233 remote: adding file changes
227 remote: added 1 changesets with 1 changes to 1 files
234 remote: added 1 changesets with 1 changes to 1 files
228 remote: 1 new obsolescence markers
235 remote: 1 new obsolescence markers
229 updating bookmark book_5fdd
236 updating bookmark book_5fdd
230 remote: b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
237 remote: b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
238 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=bundle2 HG_URL=bundle2
231 $ hg -R other log -G
239 $ hg -R other log -G
232 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
240 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
233 |
241 |
234 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
242 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
235 |
243 |
236 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
244 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
237 | |
245 | |
238 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
246 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
239 | |/|
247 | |/|
240 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
248 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
241 |/ /
249 |/ /
242 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
250 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
243 |/
251 |/
244 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
252 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
245
253
246 $ hg -R other debugobsolete
254 $ hg -R other debugobsolete
247 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
255 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
248 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
256 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
249 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
257 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
250 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
258 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
251 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
259 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
252 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
260 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
253
261
254 push over http
262 push over http
255
263
256 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
264 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
257 $ cat other.pid >> $DAEMON_PIDS
265 $ cat other.pid >> $DAEMON_PIDS
258
266
259 $ hg -R main phase --public 32af7686d403
267 $ hg -R main phase --public 32af7686d403
260 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
268 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
261 pushing to http://localhost:$HGPORT2/
269 pushing to http://localhost:$HGPORT2/
262 searching for changes
270 searching for changes
263 remote: adding changesets
271 remote: adding changesets
264 remote: adding manifests
272 remote: adding manifests
265 remote: adding file changes
273 remote: adding file changes
266 remote: added 1 changesets with 1 changes to 1 files
274 remote: added 1 changesets with 1 changes to 1 files
267 remote: 1 new obsolescence markers
275 remote: 1 new obsolescence markers
268 updating bookmark book_32af
276 updating bookmark book_32af
269 $ cat other-error.log
277 $ cat other-error.log
270
278
271 Check final content.
279 Check final content.
272
280
273 $ hg -R other log -G
281 $ hg -R other log -G
274 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
282 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
275 |
283 |
276 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
284 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
277 |
285 |
278 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
286 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
279 |
287 |
280 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
288 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
281 | |
289 | |
282 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
290 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
283 | |/|
291 | |/|
284 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
292 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
285 |/ /
293 |/ /
286 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
294 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
287 |/
295 |/
288 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
296 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
289
297
290 $ hg -R other debugobsolete
298 $ hg -R other debugobsolete
291 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
299 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
292 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
300 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
293 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
301 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
294 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
302 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
295 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
303 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
296 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
304 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
297 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
305 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
298
306
299 Error Handling
307 Error Handling
300 ==============
308 ==============
301
309
302 Check that errors are properly returned to the client during push.
310 Check that errors are properly returned to the client during push.
303
311
304 Setting up
312 Setting up
305
313
306 $ cat > failpush.py << EOF
314 $ cat > failpush.py << EOF
307 > """A small extension that makes push fails when using bundle2
315 > """A small extension that makes push fails when using bundle2
308 >
316 >
309 > used to test error handling in bundle2
317 > used to test error handling in bundle2
310 > """
318 > """
311 >
319 >
312 > from mercurial import util
320 > from mercurial import util
313 > from mercurial import bundle2
321 > from mercurial import bundle2
314 > from mercurial import exchange
322 > from mercurial import exchange
315 > from mercurial import extensions
323 > from mercurial import extensions
316 >
324 >
317 > def _pushbundle2failpart(pushop, bundler):
325 > def _pushbundle2failpart(pushop, bundler):
318 > reason = pushop.ui.config('failpush', 'reason', None)
326 > reason = pushop.ui.config('failpush', 'reason', None)
319 > part = None
327 > part = None
320 > if reason == 'abort':
328 > if reason == 'abort':
321 > bundler.newpart('test:abort')
329 > bundler.newpart('test:abort')
322 > if reason == 'unknown':
330 > if reason == 'unknown':
323 > bundler.newpart('TEST:UNKNOWN')
331 > bundler.newpart('TEST:UNKNOWN')
324 > if reason == 'race':
332 > if reason == 'race':
325 > # 20 Bytes of crap
333 > # 20 Bytes of crap
326 > bundler.newpart('b2x:check:heads', data='01234567890123456789')
334 > bundler.newpart('b2x:check:heads', data='01234567890123456789')
327 >
335 >
328 > @bundle2.parthandler("test:abort")
336 > @bundle2.parthandler("test:abort")
329 > def handleabort(op, part):
337 > def handleabort(op, part):
330 > raise util.Abort('Abandon ship!', hint="don't panic")
338 > raise util.Abort('Abandon ship!', hint="don't panic")
331 >
339 >
332 > def uisetup(ui):
340 > def uisetup(ui):
333 > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart
341 > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart
334 > exchange.b2partsgenorder.insert(0, 'failpart')
342 > exchange.b2partsgenorder.insert(0, 'failpart')
335 >
343 >
336 > EOF
344 > EOF
337
345
338 $ cd main
346 $ cd main
339 $ hg up tip
347 $ hg up tip
340 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
348 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
341 $ echo 'I' > I
349 $ echo 'I' > I
342 $ hg add I
350 $ hg add I
343 $ hg ci -m 'I'
351 $ hg ci -m 'I'
344 $ hg id
352 $ hg id
345 e7ec4e813ba6 tip
353 e7ec4e813ba6 tip
346 $ cd ..
354 $ cd ..
347
355
348 $ cat << EOF >> $HGRCPATH
356 $ cat << EOF >> $HGRCPATH
349 > [extensions]
357 > [extensions]
350 > failpush=$TESTTMP/failpush.py
358 > failpush=$TESTTMP/failpush.py
351 > EOF
359 > EOF
352
360
353 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
361 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
354 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
362 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
355 $ cat other.pid >> $DAEMON_PIDS
363 $ cat other.pid >> $DAEMON_PIDS
356
364
357 Doing the actual push: Abort error
365 Doing the actual push: Abort error
358
366
359 $ cat << EOF >> $HGRCPATH
367 $ cat << EOF >> $HGRCPATH
360 > [failpush]
368 > [failpush]
361 > reason = abort
369 > reason = abort
362 > EOF
370 > EOF
363
371
364 $ hg -R main push other -r e7ec4e813ba6
372 $ hg -R main push other -r e7ec4e813ba6
365 pushing to other
373 pushing to other
366 searching for changes
374 searching for changes
367 abort: Abandon ship!
375 abort: Abandon ship!
368 (don't panic)
376 (don't panic)
369 [255]
377 [255]
370
378
371 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
379 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
372 pushing to ssh://user@dummy/other
380 pushing to ssh://user@dummy/other
373 searching for changes
381 searching for changes
374 abort: Abandon ship!
382 abort: Abandon ship!
375 (don't panic)
383 (don't panic)
376 [255]
384 [255]
377
385
378 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
386 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
379 pushing to http://localhost:$HGPORT2/
387 pushing to http://localhost:$HGPORT2/
380 searching for changes
388 searching for changes
381 abort: Abandon ship!
389 abort: Abandon ship!
382 (don't panic)
390 (don't panic)
383 [255]
391 [255]
384
392
385
393
386 Doing the actual push: unknown mandatory parts
394 Doing the actual push: unknown mandatory parts
387
395
388 $ cat << EOF >> $HGRCPATH
396 $ cat << EOF >> $HGRCPATH
389 > [failpush]
397 > [failpush]
390 > reason = unknown
398 > reason = unknown
391 > EOF
399 > EOF
392
400
393 $ hg -R main push other -r e7ec4e813ba6
401 $ hg -R main push other -r e7ec4e813ba6
394 pushing to other
402 pushing to other
395 searching for changes
403 searching for changes
396 abort: missing support for test:unknown
404 abort: missing support for test:unknown
397 [255]
405 [255]
398
406
399 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
407 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
400 pushing to ssh://user@dummy/other
408 pushing to ssh://user@dummy/other
401 searching for changes
409 searching for changes
402 abort: missing support for test:unknown
410 abort: missing support for test:unknown
403 [255]
411 [255]
404
412
405 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
413 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
406 pushing to http://localhost:$HGPORT2/
414 pushing to http://localhost:$HGPORT2/
407 searching for changes
415 searching for changes
408 abort: missing support for test:unknown
416 abort: missing support for test:unknown
409 [255]
417 [255]
410
418
411 Doing the actual push: race
419 Doing the actual push: race
412
420
413 $ cat << EOF >> $HGRCPATH
421 $ cat << EOF >> $HGRCPATH
414 > [failpush]
422 > [failpush]
415 > reason = race
423 > reason = race
416 > EOF
424 > EOF
417
425
418 $ hg -R main push other -r e7ec4e813ba6
426 $ hg -R main push other -r e7ec4e813ba6
419 pushing to other
427 pushing to other
420 searching for changes
428 searching for changes
421 abort: push failed:
429 abort: push failed:
422 'repository changed while pushing - please try again'
430 'repository changed while pushing - please try again'
423 [255]
431 [255]
424
432
425 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
433 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
426 pushing to ssh://user@dummy/other
434 pushing to ssh://user@dummy/other
427 searching for changes
435 searching for changes
428 abort: push failed:
436 abort: push failed:
429 'repository changed while pushing - please try again'
437 'repository changed while pushing - please try again'
430 [255]
438 [255]
431
439
432 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
440 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
433 pushing to http://localhost:$HGPORT2/
441 pushing to http://localhost:$HGPORT2/
434 searching for changes
442 searching for changes
435 abort: push failed:
443 abort: push failed:
436 'repository changed while pushing - please try again'
444 'repository changed while pushing - please try again'
437 [255]
445 [255]
438
446
439 Doing the actual push: hook abort
447 Doing the actual push: hook abort
440
448
441 $ cat << EOF >> $HGRCPATH
449 $ cat << EOF >> $HGRCPATH
442 > [failpush]
450 > [failpush]
443 > reason =
451 > reason =
444 > [hooks]
452 > [hooks]
445 > b2x-pretransactionclose.failpush = false
453 > b2x-pretransactionclose.failpush = false
446 > EOF
454 > EOF
447
455
448 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
456 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
449 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
457 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
450 $ cat other.pid >> $DAEMON_PIDS
458 $ cat other.pid >> $DAEMON_PIDS
451
459
452 $ hg -R main push other -r e7ec4e813ba6
460 $ hg -R main push other -r e7ec4e813ba6
453 pushing to other
461 pushing to other
454 searching for changes
462 searching for changes
455 transaction abort!
463 transaction abort!
456 rollback completed
464 rollback completed
465 changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_SOURCE=bundle2 HG_URL=bundle2
457 abort: b2x-pretransactionclose.failpush hook exited with status 1
466 abort: b2x-pretransactionclose.failpush hook exited with status 1
458 [255]
467 [255]
459
468
460 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
469 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
461 pushing to ssh://user@dummy/other
470 pushing to ssh://user@dummy/other
462 searching for changes
471 searching for changes
463 abort: b2x-pretransactionclose.failpush hook exited with status 1
472 abort: b2x-pretransactionclose.failpush hook exited with status 1
464 remote: transaction abort!
473 remote: transaction abort!
465 remote: rollback completed
474 remote: rollback completed
475 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_SOURCE=bundle2 HG_URL=bundle2
466 [255]
476 [255]
467
477
468 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
478 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
469 pushing to http://localhost:$HGPORT2/
479 pushing to http://localhost:$HGPORT2/
470 searching for changes
480 searching for changes
471 abort: b2x-pretransactionclose.failpush hook exited with status 1
481 abort: b2x-pretransactionclose.failpush hook exited with status 1
472 [255]
482 [255]
473
483
474
484
General Comments 0
You need to be logged in to leave comments. Login now