Show More
@@ -1,15 +1,15 b'' | |||
|
1 | 1 | $(eval HGROOT := $(shell cd ../..; pwd)) |
|
2 | 2 | |
|
3 | 3 | DEBIAN_CODENAMES := \ |
|
4 | jessie \ | |
|
5 | 4 | stretch \ |
|
6 | buster | |
|
5 | buster \ | |
|
6 | bullseye | |
|
7 | 7 | |
|
8 | 8 | UBUNTU_CODENAMES := \ |
|
9 | trusty \ | |
|
10 | 9 | xenial \ |
|
11 | artful \ | |
|
12 | 10 | bionic \ |
|
11 | cosmic \ | |
|
12 | disco | |
|
13 | 13 |
|
|
14 | 14 | FEDORA_RELEASES := \ |
|
15 | 15 | 20 \ |
@@ -68,13 +68,13 b' static int Decompressor_init(ZstdDecompr' | |||
|
68 | 68 | }; |
|
69 | 69 | |
|
70 | 70 | ZstdCompressionDict* dict = NULL; |
|
71 | size_t maxWindowSize = 0; | |
|
71 | Py_ssize_t maxWindowSize = 0; | |
|
72 | 72 | ZSTD_format_e format = ZSTD_f_zstd1; |
|
73 | 73 | |
|
74 | 74 | self->dctx = NULL; |
|
75 | 75 | self->dict = NULL; |
|
76 | 76 | |
|
77 |
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O! |
|
|
77 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!nI:ZstdDecompressor", kwlist, | |
|
78 | 78 | &ZstdCompressionDictType, &dict, &maxWindowSize, &format)) { |
|
79 | 79 | return -1; |
|
80 | 80 | } |
@@ -1036,6 +1036,12 b' def _bmaction(old, new):' | |||
|
1036 | 1036 | return 'delete' |
|
1037 | 1037 | return 'update' |
|
1038 | 1038 | |
|
1039 | def _abortonsecretctx(pushop, node, b): | |
|
1040 | """abort if a given bookmark points to a secret changeset""" | |
|
1041 | if node and pushop.repo[node].phase() == phases.secret: | |
|
1042 | raise error.Abort(_('cannot push bookmark %s as it points to a secret' | |
|
1043 | ' changeset') % b) | |
|
1044 | ||
|
1039 | 1045 | def _pushb2bookmarkspart(pushop, bundler): |
|
1040 | 1046 | pushop.stepsdone.add('bookmarks') |
|
1041 | 1047 | if not pushop.outbookmarks: |
@@ -1044,6 +1050,7 b' def _pushb2bookmarkspart(pushop, bundler' | |||
|
1044 | 1050 | allactions = [] |
|
1045 | 1051 | data = [] |
|
1046 | 1052 | for book, old, new in pushop.outbookmarks: |
|
1053 | _abortonsecretctx(pushop, new, book) | |
|
1047 | 1054 | new = bin(new) |
|
1048 | 1055 | data.append((book, new)) |
|
1049 | 1056 | allactions.append((book, _bmaction(old, new))) |
@@ -1072,6 +1079,7 b' def _pushb2bookmarkspushkey(pushop, bund' | |||
|
1072 | 1079 | assert False |
|
1073 | 1080 | |
|
1074 | 1081 | for book, old, new in pushop.outbookmarks: |
|
1082 | _abortonsecretctx(pushop, new, book) | |
|
1075 | 1083 | part = bundler.newpart('pushkey') |
|
1076 | 1084 | part.addparam('namespace', enc('bookmarks')) |
|
1077 | 1085 | part.addparam('key', enc(book)) |
@@ -1322,3 +1322,31 b' attempt to move the bookmark is rejected' | |||
|
1322 | 1322 | abort: push failed on remote |
|
1323 | 1323 | [255] |
|
1324 | 1324 | #endif |
|
1325 | ||
|
1326 | -- test for pushing bookmarks pointing to secret changesets | |
|
1327 | ||
|
1328 | Set up a "remote" repo | |
|
1329 | $ hg init issue6159remote | |
|
1330 | $ cd issue6159remote | |
|
1331 | $ echo a > a | |
|
1332 | $ hg add a | |
|
1333 | $ hg commit -m_ | |
|
1334 | $ hg bookmark foo | |
|
1335 | $ cd .. | |
|
1336 | ||
|
1337 | Clone a local repo | |
|
1338 | $ hg clone -q issue6159remote issue6159local | |
|
1339 | $ cd issue6159local | |
|
1340 | $ hg up -qr foo | |
|
1341 | $ echo b > b | |
|
1342 | ||
|
1343 | Move the bookmark "foo" to point at a secret changeset | |
|
1344 | $ hg commit -qAm_ --config phases.new-commit=secret | |
|
1345 | ||
|
1346 | Pushing the bookmark "foo" now fails as it contains a secret changeset | |
|
1347 | $ hg push -r foo | |
|
1348 | pushing to $TESTTMP/issue6159remote | |
|
1349 | searching for changes | |
|
1350 | no changes found (ignored 1 secret changesets) | |
|
1351 | abort: cannot push bookmark foo as it points to a secret changeset | |
|
1352 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now