Show More
@@ -1,15 +1,15 b'' | |||||
1 | $(eval HGROOT := $(shell cd ../..; pwd)) |
|
1 | $(eval HGROOT := $(shell cd ../..; pwd)) | |
2 |
|
2 | |||
3 | DEBIAN_CODENAMES := \ |
|
3 | DEBIAN_CODENAMES := \ | |
4 | jessie \ |
|
|||
5 | stretch \ |
|
4 | stretch \ | |
6 | buster |
|
5 | buster \ | |
|
6 | bullseye | |||
7 |
|
7 | |||
8 | UBUNTU_CODENAMES := \ |
|
8 | UBUNTU_CODENAMES := \ | |
9 | trusty \ |
|
|||
10 | xenial \ |
|
9 | xenial \ | |
11 | artful \ |
|
|||
12 | bionic \ |
|
10 | bionic \ | |
|
11 | cosmic \ | |||
|
12 | disco | |||
13 |
|
|
13 | ||
14 | FEDORA_RELEASES := \ |
|
14 | FEDORA_RELEASES := \ | |
15 | 20 \ |
|
15 | 20 \ |
@@ -68,13 +68,13 b' static int Decompressor_init(ZstdDecompr' | |||||
68 | }; |
|
68 | }; | |
69 |
|
69 | |||
70 | ZstdCompressionDict* dict = NULL; |
|
70 | ZstdCompressionDict* dict = NULL; | |
71 | size_t maxWindowSize = 0; |
|
71 | Py_ssize_t maxWindowSize = 0; | |
72 | ZSTD_format_e format = ZSTD_f_zstd1; |
|
72 | ZSTD_format_e format = ZSTD_f_zstd1; | |
73 |
|
73 | |||
74 | self->dctx = NULL; |
|
74 | self->dctx = NULL; | |
75 | self->dict = NULL; |
|
75 | self->dict = NULL; | |
76 |
|
76 | |||
77 |
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O! |
|
77 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!nI:ZstdDecompressor", kwlist, | |
78 | &ZstdCompressionDictType, &dict, &maxWindowSize, &format)) { |
|
78 | &ZstdCompressionDictType, &dict, &maxWindowSize, &format)) { | |
79 | return -1; |
|
79 | return -1; | |
80 | } |
|
80 | } |
@@ -1036,6 +1036,12 b' def _bmaction(old, new):' | |||||
1036 | return 'delete' |
|
1036 | return 'delete' | |
1037 | return 'update' |
|
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 | def _pushb2bookmarkspart(pushop, bundler): |
|
1045 | def _pushb2bookmarkspart(pushop, bundler): | |
1040 | pushop.stepsdone.add('bookmarks') |
|
1046 | pushop.stepsdone.add('bookmarks') | |
1041 | if not pushop.outbookmarks: |
|
1047 | if not pushop.outbookmarks: | |
@@ -1044,6 +1050,7 b' def _pushb2bookmarkspart(pushop, bundler' | |||||
1044 | allactions = [] |
|
1050 | allactions = [] | |
1045 | data = [] |
|
1051 | data = [] | |
1046 | for book, old, new in pushop.outbookmarks: |
|
1052 | for book, old, new in pushop.outbookmarks: | |
|
1053 | _abortonsecretctx(pushop, new, book) | |||
1047 | new = bin(new) |
|
1054 | new = bin(new) | |
1048 | data.append((book, new)) |
|
1055 | data.append((book, new)) | |
1049 | allactions.append((book, _bmaction(old, new))) |
|
1056 | allactions.append((book, _bmaction(old, new))) | |
@@ -1072,6 +1079,7 b' def _pushb2bookmarkspushkey(pushop, bund' | |||||
1072 | assert False |
|
1079 | assert False | |
1073 |
|
1080 | |||
1074 | for book, old, new in pushop.outbookmarks: |
|
1081 | for book, old, new in pushop.outbookmarks: | |
|
1082 | _abortonsecretctx(pushop, new, book) | |||
1075 | part = bundler.newpart('pushkey') |
|
1083 | part = bundler.newpart('pushkey') | |
1076 | part.addparam('namespace', enc('bookmarks')) |
|
1084 | part.addparam('namespace', enc('bookmarks')) | |
1077 | part.addparam('key', enc(book)) |
|
1085 | part.addparam('key', enc(book)) |
@@ -1322,3 +1322,31 b' attempt to move the bookmark is rejected' | |||||
1322 | abort: push failed on remote |
|
1322 | abort: push failed on remote | |
1323 | [255] |
|
1323 | [255] | |
1324 | #endif |
|
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