Patchwork D6740: tests: add test to demonstrate issue6159

login
register
mail settings
Submitter phabricator
Date Aug. 17, 2019, 9:28 p.m.
Message ID <differential-rev-PHID-DREV-43vapumsnu4fyc3ht3ec-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41344/
State Superseded
Headers show

Comments

phabricator - Aug. 17, 2019, 9:28 p.m.
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




To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel
phabricator - Aug. 19, 2019, 3:16 p.m.
pulkit added inline comments.

INLINE COMMENTS

> test-bookmarks-pushpull.t:1344
> +Move the bookmark "foo" to point at a secret changeset
> +  $ hg commit -qAm_
> +  $ hg phase -s -f

`--config phases.new-commit=secret` can be used here instead to create a secret commit.

> test-bookmarks-pushpull.t:1371
> +#if b2-pushkey
> +  $ cd ../a
> +  $ hg bookmark

we should cd to `issue6519remote` here right?

> test-bookmarks-pushpull.t:1381
> +     foobar                    2:9b140be10808
> +  $ cat .hg/bookmarks
> +  0d2164f0ce0d8f1d6f94351eba04b794909be66c @

No need for this.

REPOSITORY
  rHG Mercurial

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

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

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Aug. 20, 2019, 12:23 p.m.
navaneeth.suresh added a comment.


  @pulkit Now I'm unable to reproduce the test result given in the bug report. It seems like the remote repo recognizes the secret changeset `cf489fd8a374`.

REPOSITORY
  rHG Mercurial

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

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

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Aug. 23, 2019, 7:06 p.m.
navaneeth.suresh added a comment.


  I'm able to reproduce the tests now. The case `b2-binary` can reproduce the test results.

REPOSITORY
  rHG Mercurial

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

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

To: navaneeth.suresh, #hg-reviewers
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,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@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@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@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@1
+  c922c0139ca03858f655e4a2af4dd02796a63969 Y
+  0d2164f0ce0d8f1d6f94351eba04b794909be66c Z
+  0000000000000000000000000000000000000000 foo
+  9b140be1080824d768c5a4691a564088eede71f9 foobar
+#endif