Debian Codegraph @

tests/test-hooklib-changeset_obsoleted.t

raw
1 $ cat <<EOF >> $HGRCPATH
2 > [experimental]
3 > evolution = true
4 >
5 > [extensions]
6 > notify =
7 > hooklib =
8 >
9 > [phases]
10 > publish = False
11 >
12 > [notify]
13 > sources = pull
14 > diffstat = False
15 > messageidseed = example
16 > domain = example.com
17 >
18 > [reposubs]
19 > * = baz
20 > EOF
21 $ hg init a
22 $ hg --cwd a debugbuilddag +2
23 $ hg init b
24 $ cat <<EOF >> b/.hg/hgrc
25 > [hooks]
26 > incoming.notify = python:hgext.notify.hook
27 > txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook
28 > EOF
29 $ hg --cwd b pull ../a | "$PYTHON" $TESTDIR/unwrap-message-id.py
30 pulling from ../a
31 requesting all changes
32 adding changesets
33 adding manifests
34 adding file changes
35 added 2 changesets with 0 changes to 0 files
36 new changesets 1ea73414a91b:66f7d451a68b (2 drafts)
37 MIME-Version: 1.0
38 Content-Type: text/plain; charset="us-ascii"
39 Content-Transfer-Encoding: 7bit
40 Date: * (glob)
41 Subject: changeset in * (glob)
42 From: [email protected]
43 X-Hg-Notification: changeset 1ea73414a91b
44 Message-Id: <hg.81c297828fd2d5afaadf2775a6a71b74143b6451dfaac09fac939e9107a50d01@example.com>
45 To: [email protected]
46
47 changeset 1ea73414a91b in $TESTTMP/b
48 details: $TESTTMP/b?cmd=changeset;node=1ea73414a91b
49 description:
50 r0
51 MIME-Version: 1.0
52 Content-Type: text/plain; charset="us-ascii"
53 Content-Transfer-Encoding: 7bit
54 Date: * (glob)
55 Subject: changeset in * (glob)
56 From: [email protected]
57 X-Hg-Notification: changeset 66f7d451a68b
58 Message-Id: <hg.364d03da7dc13829eb779a805be7e37f54f572e9afcea7d2626856a794d3e8f3@example.com>
59 To: [email protected]
60
61 changeset 66f7d451a68b in $TESTTMP/b
62 details: $TESTTMP/b?cmd=changeset;node=66f7d451a68b
63 description:
64 r1
65 (run 'hg update' to get a working copy)
66 $ hg --cwd a debugobsolete 1ea73414a91b0920940797d8fc6a11e447f8ea1e
67 1 new obsolescence markers
68 obsoleted 1 changesets
69 1 new orphan changesets
70 $ hg --cwd a push ../b --hidden | "$PYTHON" $TESTDIR/unwrap-message-id.py
71 1 new orphan changesets
72 pushing to ../b
73 searching for changes
74 no changes found
75 1 new obsolescence markers
76 obsoleted 1 changesets
77 Subject: changeset abandoned
78 In-reply-to: <hg.81c297828fd2d5afaadf2775a6a71b74143b6451dfaac09fac939e9107a50d01@example.com>
79 Message-Id: <hg.d6329e9481594f0f3c8a84362b3511318bfbce50748ab1123f909eb6fbcab018@example.com>
80 Date: * (glob)
81 From: [email protected]
82 To: [email protected]
83
84 This changeset has been abandoned.
85
86 Check that known changesets with known successors do not result in a mail.
87
88 $ hg init c
89 $ hg init d
90 $ cat <<EOF >> d/.hg/hgrc
91 > [hooks]
92 > incoming.notify = python:hgext.notify.hook
93 > txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook
94 > EOF
95 $ hg --cwd c debugbuilddag '.:parent.*parent'
96 $ hg --cwd c push ../d -r 1
97 pushing to ../d
98 searching for changes
99 adding changesets
100 adding manifests
101 adding file changes
102 added 2 changesets with 0 changes to 0 files
103 $ hg --cwd c debugobsolete $(hg --cwd c log -T '{node}' -r 1) $(hg --cwd c log -T '{node}' -r 2)
104 1 new obsolescence markers
105 obsoleted 1 changesets
106 $ hg --cwd c push ../d | "$PYTHON" $TESTDIR/unwrap-message-id.py
107 pushing to ../d
108 searching for changes
109 adding changesets
110 adding manifests
111 adding file changes
112 added 1 changesets with 0 changes to 0 files (+1 heads)
113 1 new obsolescence markers
114 obsoleted 1 changesets