Patchwork D1752: tests: show phases aren't preserved part of streaming clone (issue5648)

login
register
mail settings
Submitter phabricator
Date Dec. 24, 2017, 6:06 p.m.
Message ID <differential-rev-PHID-DREV-sf2lkrouxwizm3zvh3jb-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26426/
State New
Headers show

Comments

phabricator - Dec. 24, 2017, 6:06 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  draft and secret changesets are promoted to public changesets when
  transferred via a stream clone. That's not desirable behavior. Add
  tests demonstrating it.
  
  As far as I can tell, this buggy behavior has been present since
  phases were introduced. Stream clone predated phases (1.7 versus 1.9)
  and stream clone was never taught to be phase aware.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-clone-uncompressed.t

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-clone-uncompressed.t b/tests/test-clone-uncompressed.t
--- a/tests/test-clone-uncompressed.t
+++ b/tests/test-clone-uncompressed.t
@@ -58,6 +58,64 @@ 
   bundle2-input-bundle: 1 parts total
   checking for updated bookmarks
 
+Phases on publishing server are promoted to public
+
+  $ hg -R server log -T '{rev} {phase}\n'
+  1 draft
+  0 draft
+
+  $ hg clone --stream -U http://localhost:$HGPORT publishing-server
+  streaming all changes
+  1027 files to transfer, 96.3 KB of data
+  transferred 96.3 KB in * seconds (*/sec) (glob)
+  searching for changes
+  no changes found
+
+  $ hg -R publishing-server log -T '{rev} {phase}\n'
+  1 public
+  0 public
+
+Phases on non-publishing server are preserved as draft
+
+  $ killdaemons.py
+  $ cd server
+  $ cat >> .hg/hgrc << EOF
+  > [phases]
+  > publish = false
+  > EOF
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid
+  $ cat hg.pid > $DAEMON_PIDS
+  $ cd ..
+
+  $ hg clone --stream -U http://localhost:$HGPORT all-draft
+  streaming all changes
+  1027 files to transfer, 96.3 KB of data
+  transferred 96.3 KB in * seconds (*/sec) (glob)
+  searching for changes
+  no changes found
+
+TODO this is buggy
+
+  $ hg -R all-draft log -T '{rev} {phase}\n'
+  1 public
+  0 public
+
+Mixed phase is preserved
+
+  $ hg -R server phase --public -r 0
+  $ hg clone --stream -U http://localhost:$HGPORT mixed-draft
+  streaming all changes
+  1027 files to transfer, 96.3 KB of data
+  transferred 96.3 KB in * seconds (*/sec) (glob)
+  searching for changes
+  no changes found
+
+TODO this is buggy
+
+  $ hg -R mixed-draft log -T '{rev} {phase}\n'
+  1 public
+  0 public
+
 Cannot stream clone when there are secret changesets
 
   $ hg -R server phase --force --secret -r tip
@@ -86,6 +144,13 @@ 
   searching for changes
   no changes found
 
+TODO this is buggy
+(likely requires bundle2 stream clone support to fix)
+
+  $ hg -R secret-allowed log -T '{rev} {phase}\n'
+  1 public
+  0 public
+
   $ killdaemons.py
 
 Verify interaction between preferuncompressed and secret presence