##// END OF EJS Templates
bookmarks: fix pushkey compatibility mode (issue5777)...
Boris Feld -
r35829:e35320ce stable
parent child Browse files
Show More
@@ -2033,7 +2033,7 b' def handlebookmark(op, inpart):'
2033 for book, node in changes:
2033 for book, node in changes:
2034 hookargs = tr.hookargs.copy()
2034 hookargs = tr.hookargs.copy()
2035 hookargs['pushkeycompat'] = '1'
2035 hookargs['pushkeycompat'] = '1'
2036 hookargs['namespace'] = 'bookmark'
2036 hookargs['namespace'] = 'bookmarks'
2037 hookargs['key'] = book
2037 hookargs['key'] = book
2038 hookargs['old'] = nodemod.hex(bookstore.get(book, ''))
2038 hookargs['old'] = nodemod.hex(bookstore.get(book, ''))
2039 hookargs['new'] = nodemod.hex(node if node is not None else '')
2039 hookargs['new'] = nodemod.hex(node if node is not None else '')
@@ -1173,3 +1173,72 b' Using http'
1173
1173
1174 $ hg -R ../issue4455-dest/ bookmarks
1174 $ hg -R ../issue4455-dest/ bookmarks
1175 no bookmarks set
1175 no bookmarks set
1176
1177 $ cd ..
1178
1179 Test that pre-pushkey compat for bookmark works as expected (issue5777)
1180
1181 $ cat << EOF >> $HGRCPATH
1182 > [ui]
1183 > ssh="$PYTHON" "$TESTDIR/dummyssh"
1184 > [server]
1185 > bookmarks-pushkey-compat = yes
1186 > EOF
1187
1188 $ hg init server
1189 $ echo foo > server/a
1190 $ hg -R server book foo
1191 $ hg -R server commit -Am a
1192 adding a
1193 $ hg clone ssh://user@dummy/server client
1194 requesting all changes
1195 adding changesets
1196 adding manifests
1197 adding file changes
1198 added 1 changesets with 1 changes to 1 files
1199 new changesets 79513d0d7716
1200 updating to branch default
1201 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1202
1203 Forbid bookmark move on the server
1204
1205 $ cat << EOF >> server/.hg/hgrc
1206 > [hooks]
1207 > prepushkey.no-bm-move= echo \$HG_NAMESPACE | grep -v bookmarks
1208 > EOF
1209
1210 pushing changeset is okay
1211
1212 $ echo bar >> client/a
1213 $ hg -R client commit -m b
1214 $ hg -R client push
1215 pushing to ssh://user@dummy/server
1216 searching for changes
1217 remote: adding changesets
1218 remote: adding manifests
1219 remote: adding file changes
1220 remote: added 1 changesets with 1 changes to 1 files
1221
1222 attempt to move the bookmark is rejected
1223
1224 $ hg -R client book foo -r .
1225 moving bookmark 'foo' forward from 79513d0d7716
1226
1227 #if b2-pushkey
1228 $ hg -R client push
1229 pushing to ssh://user@dummy/server
1230 searching for changes
1231 no changes found
1232 remote: pushkey-abort: prepushkey.no-bm-move hook exited with status 1
1233 abort: updating bookmark foo failed!
1234 [255]
1235 #endif
1236 #if b2-binary
1237 $ hg -R client push
1238 pushing to ssh://user@dummy/server
1239 searching for changes
1240 no changes found
1241 remote: prepushkey.no-bm-move hook exited with status 1
1242 abort: push failed on remote
1243 [255]
1244 #endif
@@ -253,7 +253,7 b' push'
253 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
253 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
254 remote: 1 new obsolescence markers
254 remote: 1 new obsolescence markers
255 remote: pre-close-tip:eea13746799a public book_eea1
255 remote: pre-close-tip:eea13746799a public book_eea1
256 remote: pushkey: lock state after "bookmark"
256 remote: pushkey: lock state after "bookmarks"
257 remote: lock: free
257 remote: lock: free
258 remote: wlock: free
258 remote: wlock: free
259 remote: postclose-tip:eea13746799a public book_eea1
259 remote: postclose-tip:eea13746799a public book_eea1
@@ -339,7 +339,7 b' push over ssh'
339 remote: added 1 changesets with 1 changes to 1 files
339 remote: added 1 changesets with 1 changes to 1 files
340 remote: 1 new obsolescence markers
340 remote: 1 new obsolescence markers
341 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
341 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
342 remote: pushkey: lock state after "bookmark"
342 remote: pushkey: lock state after "bookmarks"
343 remote: lock: free
343 remote: lock: free
344 remote: wlock: free
344 remote: wlock: free
345 remote: postclose-tip:5fddd98957c8 draft book_5fdd
345 remote: postclose-tip:5fddd98957c8 draft book_5fdd
@@ -390,7 +390,7 b' push over http'
390 remote: added 1 changesets with 1 changes to 1 files
390 remote: added 1 changesets with 1 changes to 1 files
391 remote: 1 new obsolescence markers
391 remote: 1 new obsolescence markers
392 remote: pre-close-tip:32af7686d403 public book_32af
392 remote: pre-close-tip:32af7686d403 public book_32af
393 remote: pushkey: lock state after "bookmark"
393 remote: pushkey: lock state after "bookmarks"
394 remote: lock: free
394 remote: lock: free
395 remote: wlock: free
395 remote: wlock: free
396 remote: postclose-tip:32af7686d403 public book_32af
396 remote: postclose-tip:32af7686d403 public book_32af
@@ -244,7 +244,7 b' pushkey hook'
244 no changes found
244 no changes found
245 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
245 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
246 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
246 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
247 pushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmark HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
247 pushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
248 txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
248 txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
249 exporting bookmark foo
249 exporting bookmark foo
250 [1]
250 [1]
@@ -281,7 +281,7 b' test that prepushkey can prevent incomin'
281 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
281 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
282 no changes found
282 no changes found
283 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
283 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
284 prepushkey.forbid hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=baz HG_NAMESPACE=bookmark HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
284 prepushkey.forbid hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
285 abort: prepushkey hook exited with status 1
285 abort: prepushkey hook exited with status 1
286 [255]
286 [255]
287 $ cd ../a
287 $ cd ../a
General Comments 0
You need to be logged in to leave comments. Login now