view tests/test-hooklib-changeset_obsoleted.t @ 44588:2a98b0cd4995

setup: build C extensions with -Werror=declaration-after-statement MSVC 2008 still needs declarations at the top of the scope. I added it to the 3rd party code too in case somebody vendors a new version with a problem- they'll get an early warning. Clang seems to ignore this (at least on 10.14 with Xcode 10), and gcc 7.4 will error out as desired on Ubuntu 18.04. Thanks to Yuya for remembering the name of the option. Differential Revision: https://phab.mercurial-scm.org/D8318
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 20 Mar 2020 23:30:23 -0400
parents 4cabeea6d214
children 04ef381000a8
line wrap: on
line source

  $ 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
  > pretxnclose.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
  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.
  1 new obsolescence markers
  obsoleted 1 changesets