##// END OF EJS Templates
phases: exchange phase boundaries on pull...
Pierre-Yves David -
r15650:5b26667f default
parent child Browse files
Show More
@@ -1507,6 +1507,7 b' class localrepository(repo.repository):'
1507 common, fetch, rheads = tmp
1507 common, fetch, rheads = tmp
1508 if not fetch:
1508 if not fetch:
1509 self.ui.status(_("no changes found\n"))
1509 self.ui.status(_("no changes found\n"))
1510 added = []
1510 result = 0
1511 result = 0
1511 else:
1512 else:
1512 if heads is None and list(common) == [nullid]:
1513 if heads is None and list(common) == [nullid]:
@@ -1526,8 +1527,26 b' class localrepository(repo.repository):'
1526 "changegroupsubset."))
1527 "changegroupsubset."))
1527 else:
1528 else:
1528 cg = remote.changegroupsubset(fetch, heads, 'pull')
1529 cg = remote.changegroupsubset(fetch, heads, 'pull')
1530 clstart = len(self.changelog)
1529 result = self.addchangegroup(cg, 'pull', remote.url())
1531 result = self.addchangegroup(cg, 'pull', remote.url())
1530 phases.advanceboundary(self, 0, common)
1532 clend = len(self.changelog)
1533 added = [self.changelog.node(r) for r in xrange(clstart, clend)]
1534
1535
1536 # Get remote phases data from remote
1537 remotephases = remote.listkeys('phases')
1538 publishing = bool(remotephases.get('publishing', False))
1539 if remotephases and not publishing:
1540 # remote is new and unpublishing
1541 subset = common + added
1542 rheads, rroots = phases.analyzeremotephases(self, subset,
1543 remotephases)
1544 for phase, boundary in enumerate(rheads):
1545 phases.advanceboundary(self, phase, boundary)
1546 else:
1547 # Remote is old or publishing all common changesets
1548 # should be seen as public
1549 phases.advanceboundary(self, 0, common + added)
1531 finally:
1550 finally:
1532 lock.release()
1551 lock.release()
1533
1552
@@ -192,6 +192,7 b' listkeys hook'
192 pulling from ../a
192 pulling from ../a
193 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
193 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
194 no changes found
194 no changes found
195 listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
195 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
196 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
196 importing bookmark bar
197 importing bookmark bar
197 $ cd ../a
198 $ cd ../a
@@ -105,17 +105,21 b' do not use the proxy if it is in the no '
105 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
105 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
106 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
106 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
107 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
107 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
108 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
108 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
109 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
109 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
110 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
110 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
111 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
111 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
112 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
113 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
112 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
114 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
113 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
115 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
114 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
116 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
115 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
117 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
118 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
116 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
119 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
117 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
120 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
118 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
121 * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
119 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
122 * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
123 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
120 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
124 * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
121
125
@@ -146,8 +146,8 b' pull without cacert'
146 adding manifests
146 adding manifests
147 adding file changes
147 adding file changes
148 added 1 changesets with 1 changes to 1 files
148 added 1 changesets with 1 changes to 1 files
149 warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
149 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
150 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
150 warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
151 (run 'hg update' to get a working copy)
151 (run 'hg update' to get a working copy)
152 $ cd ..
152 $ cd ..
153
153
@@ -112,6 +112,9 b' update must update phase of common chang'
112 Publish configuration option
112 Publish configuration option
113 ----------------------------
113 ----------------------------
114
114
115 Pull
116 ````
117
115 changegroup are added without phase movement
118 changegroup are added without phase movement
116
119
117 $ hg bundle -a ../base.bundle
120 $ hg bundle -a ../base.bundle
@@ -137,3 +140,133 b' changegroup are added without phase move'
137 0 1 a-A - 054250a37db4
140 0 1 a-A - 054250a37db4
138 $ cd ..
141 $ cd ..
139
142
143 Pulling from publish=False to publish=False does not move boundary.
144
145 $ hg init nu
146 $ cd nu
147 $ cat > .hg/hgrc << EOF
148 > [phases]
149 > publish=0
150 > EOF
151 $ hg pull ../mu -r 54acac6f23ab
152 pulling from ../mu
153 adding changesets
154 adding manifests
155 adding file changes
156 added 3 changesets with 3 changes to 3 files
157 (run 'hg update' to get a working copy)
158 $ hgph
159 2 1 a-C - 54acac6f23ab
160 1 1 a-B - 548a3d25dbf0
161 0 1 a-A - 054250a37db4
162
163 Even for common
164
165 $ hg pull ../mu -r f54f1bb90ff3
166 pulling from ../mu
167 searching for changes
168 adding changesets
169 adding manifests
170 adding file changes
171 added 1 changesets with 1 changes to 1 files (+1 heads)
172 (run 'hg heads' to see heads, 'hg merge' to merge)
173 $ hgph
174 3 1 b-A - f54f1bb90ff3
175 2 1 a-C - 54acac6f23ab
176 1 1 a-B - 548a3d25dbf0
177 0 1 a-A - 054250a37db4
178
179
180 Pulling from Publish=True to Publish=False move boundary in common set.
181 we are in nu
182
183 $ hg pull ../alpha -r b555f63b6063
184 pulling from ../alpha
185 searching for changes
186 adding changesets
187 adding manifests
188 adding file changes
189 added 1 changesets with 1 changes to 1 files
190 (run 'hg update' to get a working copy)
191 $ hgph
192 4 0 a-D - b555f63b6063
193 3 0 b-A - f54f1bb90ff3
194 2 0 a-C - 54acac6f23ab
195 1 0 a-B - 548a3d25dbf0
196 0 0 a-A - 054250a37db4
197
198 pulling from Publish=False to publish=False with some public
199
200 $ hg up -q f54f1bb90ff3
201 $ mkcommit n-A
202 $ mkcommit n-B
203 $ hgph
204 6 1 n-B - 145e75495359
205 5 1 n-A - d6bcb4f74035
206 4 0 a-D - b555f63b6063
207 3 0 b-A - f54f1bb90ff3
208 2 0 a-C - 54acac6f23ab
209 1 0 a-B - 548a3d25dbf0
210 0 0 a-A - 054250a37db4
211 $ cd ../mu
212 $ hg pull ../nu
213 pulling from ../nu
214 searching for changes
215 adding changesets
216 adding manifests
217 adding file changes
218 added 2 changesets with 2 changes to 2 files
219 (run 'hg update' to get a working copy)
220 $ hgph
221 6 1 n-B - 145e75495359
222 5 1 n-A - d6bcb4f74035
223 4 0 a-D - b555f63b6063
224 3 0 a-C - 54acac6f23ab
225 2 0 b-A - f54f1bb90ff3
226 1 0 a-B - 548a3d25dbf0
227 0 0 a-A - 054250a37db4
228 $ cd ..
229
230 pulling into publish=True
231
232 $ cd alpha
233 $ hgph
234 4 0 b-A - f54f1bb90ff3
235 3 0 a-D - b555f63b6063
236 2 0 a-C - 54acac6f23ab
237 1 0 a-B - 548a3d25dbf0
238 0 0 a-A - 054250a37db4
239 $ hg pull ../mu
240 pulling from ../mu
241 searching for changes
242 adding changesets
243 adding manifests
244 adding file changes
245 added 2 changesets with 2 changes to 2 files
246 (run 'hg update' to get a working copy)
247 $ hgph
248 6 0 n-B - 145e75495359
249 5 0 n-A - d6bcb4f74035
250 4 0 b-A - f54f1bb90ff3
251 3 0 a-D - b555f63b6063
252 2 0 a-C - 54acac6f23ab
253 1 0 a-B - 548a3d25dbf0
254 0 0 a-A - 054250a37db4
255 $ cd ..
256
257 pulling back into original repo
258
259 $ cd nu
260 $ hg pull ../alpha
261 pulling from ../alpha
262 searching for changes
263 no changes found
264 $ hgph
265 6 0 n-B - 145e75495359
266 5 0 n-A - d6bcb4f74035
267 4 0 a-D - b555f63b6063
268 3 0 b-A - f54f1bb90ff3
269 2 0 a-C - 54acac6f23ab
270 1 0 a-B - 548a3d25dbf0
271 0 0 a-A - 054250a37db4
272 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now