[PATCH 1 of 2 STABLE] tests: test changegroup generation for filtered changesets (issue4982)

Gregory Szorc gregory.szorc at gmail.com
Wed Dec 2 22:20:35 UTC 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1449094813 28800
#      Wed Dec 02 14:20:13 2015 -0800
# Branch stable
# Node ID 36b3a5ae03ae1df7a5a03e21f2f715da3116ea7c
# Parent  7e1fac6c0a9ce6afd3edeed5e47bcca343155d8a
tests: test changegroup generation for filtered changesets (issue4982)

The test demonstrates the buggy behavior from issue4982 where the
changegroup contains changesets it shouldn't.

diff --git a/tests/test-obsolete-changeset-exchange.t b/tests/test-obsolete-changeset-exchange.t
--- a/tests/test-obsolete-changeset-exchange.t
+++ b/tests/test-obsolete-changeset-exchange.t
@@ -82,4 +82,77 @@ check that bundle is not affected
   adding manifests
   adding file changes
   added 1 changesets with 0 changes to 1 files (+1 heads)
   (run 'hg heads' to see heads)
+  $ cd ..
+
+pull does not fetch excessive changesets when common node is hidden (issue4982)
+-------------------------------------------------------------------------------
+
+initial repo with server and client matching
+
+  $ hg init pull-hidden-common
+  $ cd pull-hidden-common
+  $ touch foo
+  $ hg -q commit -A -m initial
+  $ echo 1 > foo
+  $ hg commit -m 1
+  $ echo 2a > foo
+  $ hg commit -m 2a
+  $ cd ..
+  $ hg clone --pull pull-hidden-common pull-hidden-common-client
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+server obsoletes the old head
+
+  $ cd pull-hidden-common
+  $ hg -q up -r 1
+  $ echo 2b > foo
+  $ hg -q commit -m 2b
+  $ hg debugobsolete 6a29ed9c68defff1a139e5c6fa9696fb1a75783d bec0734cd68e84477ba7fc1d13e6cff53ab70129
+  $ cd ..
+
+client only pulls down 1 changeset
+("all local heads known remotely" may change if the wire protocol discovery
+commands ever stop saying they have hidden changesets)
+
+  $ cd pull-hidden-common-client
+  $ hg pull --debug
+  pulling from $TESTTMP/pull-hidden-common
+  query 1; heads
+  searching for changes
+  all local heads known remotely
+  3 changesets found
+  list of changesets:
+  96ee1d7354c4ad7372047672c36a1f561e3a6a4c
+  a33779fdfc23063680fc31e9ff637dff6876d3d2
+  bec0734cd68e84477ba7fc1d13e6cff53ab70129
+  listing keys for "phase"
+  listing keys for "bookmarks"
+  bundle2-output-bundle: "HG20", 3 parts total
+  bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
+  bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
+  bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
+  bundle2-input-bundle: with-transaction
+  bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
+  adding changesets
+  add changeset 96ee1d7354c4
+  add changeset a33779fdfc23
+  add changeset bec0734cd68e
+  adding manifests
+  adding file changes
+  adding foo revisions
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  bundle2-input-part: total payload size 1378
+  bundle2-input-part: "listkeys" (params: 1 mandatory) supported
+  bundle2-input-part: "listkeys" (params: 1 mandatory) supported
+  bundle2-input-bundle: 2 parts total
+  checking for updated bookmarks
+  listing keys for "phases"
+  updating the branch cache
+  (run 'hg heads' to see heads, 'hg merge' to merge)


More information about the Mercurial-devel mailing list