# HG changeset patch # User Yuya Nishihara # Date 1567217412 -32400 # Node ID 10841b9a80c32d576b65ef1bbf8f5066eb0c1588 # Parent 6a551a2dc666262c1b8ed26aff199bde27596d0f# Parent a4e32fd539ab41489a51b2aa88bda9a73b839562 merge with stable diff -r 6a551a2dc666 -r 10841b9a80c3 contrib/packaging/Makefile --- a/contrib/packaging/Makefile Thu Aug 29 15:49:16 2019 +0200 +++ b/contrib/packaging/Makefile Sat Aug 31 11:10:12 2019 +0900 @@ -1,15 +1,15 @@ $(eval HGROOT := $(shell cd ../..; pwd)) DEBIAN_CODENAMES := \ - jessie \ stretch \ - buster + buster \ + bullseye UBUNTU_CODENAMES := \ - trusty \ xenial \ - artful \ bionic \ + cosmic \ + disco FEDORA_RELEASES := \ 20 \ diff -r 6a551a2dc666 -r 10841b9a80c3 contrib/python-zstandard/c-ext/decompressor.c --- a/contrib/python-zstandard/c-ext/decompressor.c Thu Aug 29 15:49:16 2019 +0200 +++ b/contrib/python-zstandard/c-ext/decompressor.c Sat Aug 31 11:10:12 2019 +0900 @@ -68,13 +68,13 @@ }; ZstdCompressionDict* dict = NULL; - size_t maxWindowSize = 0; + Py_ssize_t maxWindowSize = 0; ZSTD_format_e format = ZSTD_f_zstd1; self->dctx = NULL; self->dict = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!II:ZstdDecompressor", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!nI:ZstdDecompressor", kwlist, &ZstdCompressionDictType, &dict, &maxWindowSize, &format)) { return -1; } diff -r 6a551a2dc666 -r 10841b9a80c3 mercurial/exchange.py --- a/mercurial/exchange.py Thu Aug 29 15:49:16 2019 +0200 +++ b/mercurial/exchange.py Sat Aug 31 11:10:12 2019 +0900 @@ -1036,6 +1036,12 @@ return 'delete' return 'update' +def _abortonsecretctx(pushop, node, b): + """abort if a given bookmark points to a secret changeset""" + if node and pushop.repo[node].phase() == phases.secret: + raise error.Abort(_('cannot push bookmark %s as it points to a secret' + ' changeset') % b) + def _pushb2bookmarkspart(pushop, bundler): pushop.stepsdone.add('bookmarks') if not pushop.outbookmarks: @@ -1044,6 +1050,7 @@ allactions = [] data = [] for book, old, new in pushop.outbookmarks: + _abortonsecretctx(pushop, new, book) new = bin(new) data.append((book, new)) allactions.append((book, _bmaction(old, new))) @@ -1072,6 +1079,7 @@ assert False for book, old, new in pushop.outbookmarks: + _abortonsecretctx(pushop, new, book) part = bundler.newpart('pushkey') part.addparam('namespace', enc('bookmarks')) part.addparam('key', enc(book)) diff -r 6a551a2dc666 -r 10841b9a80c3 tests/test-bookmarks-pushpull.t --- a/tests/test-bookmarks-pushpull.t Thu Aug 29 15:49:16 2019 +0200 +++ b/tests/test-bookmarks-pushpull.t Sat Aug 31 11:10:12 2019 +0900 @@ -1322,3 +1322,31 @@ abort: push failed on remote [255] #endif + +-- test for pushing bookmarks pointing to secret changesets + +Set up a "remote" repo + $ hg init issue6159remote + $ cd issue6159remote + $ echo a > a + $ hg add a + $ hg commit -m_ + $ hg bookmark foo + $ cd .. + +Clone a local repo + $ hg clone -q issue6159remote issue6159local + $ cd issue6159local + $ hg up -qr foo + $ echo b > b + +Move the bookmark "foo" to point at a secret changeset + $ hg commit -qAm_ --config phases.new-commit=secret + +Pushing the bookmark "foo" now fails as it contains a secret changeset + $ hg push -r foo + pushing to $TESTTMP/issue6159remote + searching for changes + no changes found (ignored 1 secret changesets) + abort: cannot push bookmark foo as it points to a secret changeset + [255]