tests/test-hooklib-changeset_obsoleted.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Sun, 14 Apr 2024 02:33:36 +0200
changeset 51587 8cd317c033b8
parent 45075 04ef381000a8
permissions -rw-r--r--
stream-clone: disable gc for the entry listing section for the v2 format This is similar to the change we did for the v3 format in 6e4c8366c5ce. The benchmark bellow show this gives us a notable gains, especially on larger repositories. ### benchmark.name = hg.perf.stream-locked-section # benchmark.name = hg.perf.stream-locked-section # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.version = v2 ## data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog 5e931bf8707c: 0.503820 ~~~~~ 1106d1bf695e: 0.470078 (-6.70%, -0.03) ## data-env-vars.name = pypy-2024-03-22-zstd-sparse-revlog 5e931bf8707c: 0.535756 ~~~~~ 1106d1bf695e: 0.490249 (-8.49%, -0.05) ## data-env-vars.name = heptapod-public-2024-03-25-zstd-sparse-revlog 5e931bf8707c: 1.327041 ~~~~~ 1106d1bf695e: 1.174636 (-11.48%, -0.15) ## data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog 5e931bf8707c: 2.439158 ~~~~~ 1106d1bf695e: 2.220515 (-8.96%, -0.22) ## data-env-vars.name = netbeans-2019-11-07-zstd-sparse-revlog 5e931bf8707c: 2.630794 ~~~~~ 1106d1bf695e: 2.261473 (-14.04%, -0.37) ## data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog 5e931bf8707c: 5.769002 ~~~~~ 1106d1bf695e: 5.062000 (-12.26%, -0.71) ## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog 5e931bf8707c: 13.351750 ~~~~~ 1106d1bf695e: 12.346655 (-7.53%, -1.01) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog 5e931bf8707c: 10.772939 ~~~~~ 1106d1bf695e: 9.495407 (-11.86%, -1.28) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog 5e931bf8707c: 10.864297 ~~~~~ 1106d1bf695e: 9.475597 (-12.78%, -1.39) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog 5e931bf8707c: 17.448335 ~~~~~ 1106d1bf695e: 16.027474 (-8.14%, -1.42)

  $ cat <<EOF >> $HGRCPATH
  > [experimental]
  > evolution = true
  > 
  > [extensions]
  > notify =
  > hooklib =
  > 
  > [phases]
  > publish = False
  > 
  > [notify]
  > sources = pull
  > diffstat = False
  > messageidseed = example
  > domain = example.com
  > 
  > [reposubs]
  > * = baz
  > EOF
  $ hg init a
  $ hg --cwd a debugbuilddag +2
  $ hg init b
  $ cat <<EOF >> b/.hg/hgrc
  > [hooks]
  > incoming.notify = python:hgext.notify.hook
  > txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook
  > EOF
  $ hg --cwd b pull ../a | "$PYTHON" $TESTDIR/unwrap-message-id.py
  pulling from ../a
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 0 changes to 0 files
  new changesets 1ea73414a91b:66f7d451a68b (2 drafts)
  MIME-Version: 1.0
  Content-Type: text/plain; charset="us-ascii"
  Content-Transfer-Encoding: 7bit
  Date: * (glob)
  Subject: changeset in * (glob)
  From: debugbuilddag@example.com
  X-Hg-Notification: changeset 1ea73414a91b
  Message-Id: <hg.81c297828fd2d5afaadf2775a6a71b74143b6451dfaac09fac939e9107a50d01@example.com>
  To: baz@example.com
  
  changeset 1ea73414a91b in $TESTTMP/b
  details: $TESTTMP/b?cmd=changeset;node=1ea73414a91b
  description:
  	r0
  MIME-Version: 1.0
  Content-Type: text/plain; charset="us-ascii"
  Content-Transfer-Encoding: 7bit
  Date: * (glob)
  Subject: changeset in * (glob)
  From: debugbuilddag@example.com
  X-Hg-Notification: changeset 66f7d451a68b
  Message-Id: <hg.364d03da7dc13829eb779a805be7e37f54f572e9afcea7d2626856a794d3e8f3@example.com>
  To: baz@example.com
  
  changeset 66f7d451a68b in $TESTTMP/b
  details: $TESTTMP/b?cmd=changeset;node=66f7d451a68b
  description:
  	r1
  (run 'hg update' to get a working copy)
  $ hg --cwd a debugobsolete 1ea73414a91b0920940797d8fc6a11e447f8ea1e
  1 new obsolescence markers
  obsoleted 1 changesets
  1 new orphan changesets
  $ hg --cwd a push ../b --hidden | "$PYTHON" $TESTDIR/unwrap-message-id.py
  1 new orphan changesets
  pushing to ../b
  searching for changes
  no changes found
  1 new obsolescence markers
  obsoleted 1 changesets
  Subject: changeset abandoned
  In-reply-to: <hg.81c297828fd2d5afaadf2775a6a71b74143b6451dfaac09fac939e9107a50d01@example.com>
  Message-Id: <hg.d6329e9481594f0f3c8a84362b3511318bfbce50748ab1123f909eb6fbcab018@example.com>
  Date: * (glob)
  From: test@example.com
  To: baz@example.com
  
  This changeset has been abandoned.

Check that known changesets with known successors do not result in a mail.

  $ hg init c
  $ hg init d
  $ cat <<EOF >> d/.hg/hgrc
  > [hooks]
  > incoming.notify = python:hgext.notify.hook
  > txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook
  > EOF
  $ hg --cwd c debugbuilddag '.:parent.*parent'
  $ hg --cwd c push ../d -r 1
  pushing to ../d
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 0 changes to 0 files
  $ hg --cwd c debugobsolete $(hg --cwd c log -T '{node}' -r 1) $(hg --cwd c log -T '{node}' -r 2)
  1 new obsolescence markers
  obsoleted 1 changesets
  $ hg --cwd c push ../d | "$PYTHON" $TESTDIR/unwrap-message-id.py
  pushing to ../d
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 0 changes to 0 files (+1 heads)
  1 new obsolescence markers
  obsoleted 1 changesets