##// END OF EJS Templates
hidden: add support for --remote-hidden to localpeer
Manuel Jacob -
r51310:b15b6e2c default
parent child Browse files
Show More
@@ -312,18 +312,12 b' class localpeer(repository.peer):'
312 repo.ui, path=path, remotehidden=remotehidden
312 repo.ui, path=path, remotehidden=remotehidden
313 )
313 )
314
314
315 if remotehidden:
316 msg = _(
317 b"ignoring `--remote-hidden` request\n"
318 b"(access to hidden changeset for %r not "
319 b"supported yet)\n"
320 ) % type(self)
321 self.ui.warn(msg)
322
323 if caps is None:
315 if caps is None:
324 caps = moderncaps.copy()
316 caps = moderncaps.copy()
325 self._repo = repo.filtered(b'served')
317 if remotehidden:
326
318 self._repo = repo.filtered(b'served.hidden')
319 else:
320 self._repo = repo.filtered(b'served')
327 if repo._wanted_sidedata:
321 if repo._wanted_sidedata:
328 formatted = bundle2.format_remote_wanted_sidedata(repo)
322 formatted = bundle2.format_remote_wanted_sidedata(repo)
329 caps.add(b'exp-wanted-sidedata=' + formatted)
323 caps.add(b'exp-wanted-sidedata=' + formatted)
@@ -112,6 +112,67 b' changesets in secret and higher phases a'
112
112
113 $ killdaemons.py
113 $ killdaemons.py
114
114
115 Test --remote-hidden for local peer
116 -----------------------------------
117
118 $ hg clone --pull repo-with-hidden client
119 requesting all changes
120 adding changesets
121 adding manifests
122 adding file changes
123 added 2 changesets with 2 changes to 1 files
124 2 new obsolescence markers
125 new changesets 5f354f46e585:c33affeb3f6b (1 drafts)
126 updating to branch default
127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 $ hg -R client log -G --hidden -v
129 @ 1:c33affeb3f6b c_Amend_New [draft]
130 |
131 o 0:5f354f46e585 c_Public [public]
132
133
134 pulling an hidden changeset should fail:
135
136 $ hg -R client pull -r be215fbb8c50
137 pulling from $TESTTMP/repo-with-hidden
138 abort: filtered revision 'be215fbb8c50' (not in 'served' subset)
139 [10]
140
141 pulling an hidden changeset with --remote-hidden should succeed:
142
143 $ hg -R client pull --remote-hidden --traceback -r be215fbb8c50
144 pulling from $TESTTMP/repo-with-hidden
145 searching for changes
146 adding changesets
147 adding manifests
148 adding file changes
149 added 1 changesets with 1 changes to 1 files (+1 heads)
150 (1 other changesets obsolete on arrival)
151 (run 'hg heads' to see heads)
152 $ hg -R client log -G --hidden -v
153 x 2:be215fbb8c50 c_Amend_Old [draft]
154 |
155 | @ 1:c33affeb3f6b c_Amend_New [draft]
156 |/
157 o 0:5f354f46e585 c_Public [public]
158
159
160 Pulling a secret changeset is still forbidden:
161
162 secret visible:
163
164 $ hg -R client pull --remote-hidden -r 8d28cbe335f3
165 pulling from $TESTTMP/repo-with-hidden
166 abort: filtered revision '8d28cbe335f3' (not in 'served.hidden' subset)
167 [10]
168
169 secret hidden:
170
171 $ hg -R client pull --remote-hidden -r 1c6afd79eb66
172 pulling from $TESTTMP/repo-with-hidden
173 abort: filtered revision '1c6afd79eb66' (not in 'served.hidden' subset)
174 [10]
175
115 Test accessing hidden changeset through hgweb
176 Test accessing hidden changeset through hgweb
116 ---------------------------------------------
177 ---------------------------------------------
117
178
General Comments 0
You need to be logged in to leave comments. Login now