Patchwork D6740: tests: add test to demonstrate issue6159

login
register
mail settings
Submitter phabricator
Date Aug. 25, 2019, 4:26 p.m.
Message ID <f05dd935ddf5eb5d1478134c0bdbc6c3@localhost.localdomain>
Download mbox | patch
Permalink /patch/41406/
State Not Applicable
Headers show

Comments

phabricator - Aug. 25, 2019, 4:26 p.m.
Closed by commit rHGcf9dbc7377de: tests: add test to demonstrate issue6159 (authored by navaneeth.suresh).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6740?vs=16298&id=16314

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6740/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6740

AFFECTED FILES
  tests/test-bookmarks-pushpull.t

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers, pulkit
Cc: pulkit, mercurial-devel

Patch

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,61 @@ 
   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
+#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
+  $ cd ../issue6159remote
+#if b2-pushkey
+  $ hg bookmark
+   * foo                       0:1599bc8b897a
+  $ hg log -r 1599bc8b897a
+  0:1599bc8b897a _ (no-eol)
+#endif
+
+#if b2-binary
+  $ hg bookmark
+  no bookmarks set
+  $ cat .hg/bookmarks
+  cf489fd8a374cab73c2dc19e899bde6fe3a43f8f foo
+  $ hg log -r cf489fd8a374
+  abort: unknown revision 'cf489fd8a374'!
+  [255]
+#endif