view tests/test-obsolete-changeset-exchange.t @ 17758:5863f0e4cd3a

histedit: replace various nodes lists with replacement graph (and issue3582) This changeset rewrites the change tracking logic of histedit to record every operation it does. Tracked operations record the full list of "old" node that will eventually be removed to the list of new nodes that replace it. Operations on temporary nodes are tracked too. Dropped changesets are also recorded as an "old" node replacement by nothing. This logic is similar to the obsolescence marker one and will be used for this purpose in later commit. This new logic implies a big amount of change in the histedit code base. histedit action functions now always return a tuple of (new-ctx, [list of rewriting operations]) The old `created`, `replaced` and `tmpnodes` are no longer returned and stored during histedit operation. When such information is necessary it is computed from the replacement graph. This computation is done in the `processreplacement` function. The `replacemap` is also dropped. It is computed at the end of the command from the graph. The `bootstrapcontinue` methods are altered to compute this different kind of information. This new mechanism requires much less information to be written on disk. Note: This changes allows a more accurate bookmark movement. bookmark on dropped changeset are now move of their parent (or replacement of their parent) instead of their children. This fix issue3582
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 11 Oct 2012 08:36:50 +0200
parents 7f5094bb3f42
children 4d9f7dd2ac82
line wrap: on
line source

Test changesets filtering during exchanges (some tests are still in
test-obsolete.t)

  $ cat > obs.py << EOF
  > import mercurial.obsolete
  > mercurial.obsolete._enabled = True
  > EOF
  $ echo '[extensions]' >> $HGRCPATH
  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH

Push does not 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