D6740: tests: add test to demonstrate issue6159
navaneeth.suresh (Navaneeth Suresh)
phabricator at mercurial-scm.org
Sat Aug 17 21:28:18 UTC 2019
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D6740
AFFECTED FILES
tests/test-bookmarks-pushpull.t
CHANGE DETAILS
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -1322,3 +1322,91 @@
abort: push failed on remote
[255]
#endif
+
+-- test for stop 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_
+ $ hg phase -s -f
+ $ hg log -r . --template '{node}'
+ cf489fd8a374cab73c2dc19e899bde6fe3a43f8f (no-eol)
+
+
+Pushing the bookmark "foo" now fails as it contains a secret changeset
+#if b2-pushkey
+ $ hg push -r foo
+ pushing to $TESTTMP/issue6159remote
+ searching for changes
+ no changes found (ignored 1 secret changesets)
+ abort: updating bookmark foo failed!
+ [255]
+#endif
+
+#if b2-binary
+ $ hg push -r foo
+ pushing to $TESTTMP/issue6159remote
+ searching for changes
+ no changes found (ignored 1 secret changesets)
+ updating bookmark foo
+ [1]
+#endif
+
+Now the "remote" repo contains a bookmark pointing to a nonexistent revision
+#if b2-pushkey
+ $ cd ../a
+ $ hg bookmark
+ @ 1:0d2164f0ce0d
+ @1 2:9b140be10808
+ * X 1:0d2164f0ce0d
+ X at 1 2:9b140be10808
+ Y 5:c922c0139ca0
+ Z 1:0d2164f0ce0d
+ foo -1:000000000000
+ foobar 2:9b140be10808
+ $ cat .hg/bookmarks
+ 0d2164f0ce0d8f1d6f94351eba04b794909be66c @
+ 9b140be1080824d768c5a4691a564088eede71f9 @1
+ 0d2164f0ce0d8f1d6f94351eba04b794909be66c X
+ 9b140be1080824d768c5a4691a564088eede71f9 X at 1
+ c922c0139ca03858f655e4a2af4dd02796a63969 Y
+ 0d2164f0ce0d8f1d6f94351eba04b794909be66c Z
+ 0000000000000000000000000000000000000000 foo
+ 9b140be1080824d768c5a4691a564088eede71f9 foobar
+#endif
+
+#if b2-binary
+ $ cd ../a
+ $ hg bookmark
+ @ 1:0d2164f0ce0d
+ @1 2:9b140be10808
+ * X 1:0d2164f0ce0d
+ X at 1 2:9b140be10808
+ Y 5:c922c0139ca0
+ Z 1:0d2164f0ce0d
+ foo -1:000000000000
+ foobar 2:9b140be10808
+ $ cat .hg/bookmarks
+ 0d2164f0ce0d8f1d6f94351eba04b794909be66c @
+ 9b140be1080824d768c5a4691a564088eede71f9 @1
+ 0d2164f0ce0d8f1d6f94351eba04b794909be66c X
+ 9b140be1080824d768c5a4691a564088eede71f9 X at 1
+ c922c0139ca03858f655e4a2af4dd02796a63969 Y
+ 0d2164f0ce0d8f1d6f94351eba04b794909be66c Z
+ 0000000000000000000000000000000000000000 foo
+ 9b140be1080824d768c5a4691a564088eede71f9 foobar
+#endif
To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list