diff tests/test-obsolete-changeset-exchange.t @ 17248:6ffb35b2284c stable

discovery: add extinct changesets to outgoing.excluded Before this change, push would incorrectly fast-path the bundle generation when extinct changesets are involved, because they are not added to outgoing.excluded. The reason to do so are related to outgoing.excluded being assumed to contain only secret changesets by scmutil.nochangesfound(), when displaying warnings like: changes found (ignored 9 secret changesets) Still, outgoing.excluded seems like a good API to report the extinct changesets instead of dedicated code and nothing in the docstring indicates it to be bound to secret changesets. This patch adds extinct changesets to outgoing.excluded and fixes scmutil.nochangesfound() to filter the excluded node list. Original version and test by Pierre-Yves.David@ens-lyon.org
author Patrick Mezard <patrick@mezard.eu>
date Wed, 25 Jul 2012 19:34:31 +0200
parents
children a1f8869f2eee
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-obsolete-changeset-exchange.t	Wed Jul 25 19:34:31 2012 +0200
@@ -0,0 +1,48 @@
+Test changesets filtering during exchanges (some tests are still in
+test-obsolete.t)
+
+Push does corrupt remote
+------------------------
+
+Create a DAG where a changeset reuses a revision from a file first used in an
+extinct changeset.
+
+  $ hg init local
+  $ cd local
+  $ echo 'base' > base
+  $ hg commit -Am base
+  adding base
+  $ echo 'A' > A
+  $ hg commit -Am A
+  adding A
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg revert -ar 1
+  adding A
+  $ hg commit -Am "A'"
+  created new head
+  $ hg log -G --template='{desc} {node}'
+  @  A' f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
+  |
+  | o  A 9d73aac1b2ed7d53835eaeec212ed41ea47da53a
+  |/
+  o  base d20a80d4def38df63a4b330b7fb688f3d4cae1e3
+  
+  $ hg debugobsolete 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
+
+Push it. The bundle should not refer to the extinct changeset.
+
+  $ hg init ../other
+  $ hg push ../other
+  pushing to ../other
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  $ hg -R ../other verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 2 changesets, 2 total revisions