annotate tests/test-exchange-obsmarkers-case-D3.t @ 2679:5156a67f66a6

topics: update current topic to the topic of newly rebased commit (issue5551) The rebase code passes branchmerge equals to True while updating to the rebased commit. We need to make sure topic is preserved even after rebase and hence we need to update the topic even when branchmerge argument is set to True. But there is a twist in the tale, merge also uses this part of code and we allow to update topic when brancmerge is True, in merge cases the topic after merge will the topic of the destination commit, not the topic of working directory parent. So we need the function to have information about whether a rebase is going on, and we do it by wrapping the rebase command and storing some value in the config. This is a bit hacky but works for now. This patch fixes issue related to loosing of topic while rebase. Thanks to Boris Feld for the rigourous tests.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 29 Jun 2017 02:31:55 +0530
parents 51a1dd295fe0
children 21f06d932231
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
1 ============================================
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
2 Testing obsolescence markers push: Cases D.3
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
3 ============================================
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
4
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
5 Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
6 all changesets that requested to be "in sync" after the push (even if they are
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
7 already on both side).
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
8
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
9 This test belongs to a series of tests checking such set is properly computed
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
10 and applied. This does not tests "obsmarkers" discovery capabilities.
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
11
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
12 Category D: Partial Information Case
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
13 TestCase 3: missing prune target (prune not in "pushed set")
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
14
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
15 D.3 missing prune target (prune not in "pushed set")
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
16 ====================================================
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
17
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
18 .. {{{
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
19 .. A ø⇠✕ A'
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
20 .. | |
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
21 .. | ○ B
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
22 .. |/
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
23 .. ● O
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
24 .. }}}
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
25 ..
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
26 .. Marker exist from:
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
27 ..
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
28 .. * `A ø⇠o A'`
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
29 .. * A' (prune)
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
30 ..
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
31 .. Command runs:
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
32 ..
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
33 .. * hg push
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
34 ..
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
35 .. Expected exclude:
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
36 ..
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
37 .. * `A ø⇠o A'`
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
38 .. * A' (prune)
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
39
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
40 Setup
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
41 -----
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
42
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
43 $ . $TESTDIR/testlib/exchange-obsmarker-util.sh
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
44
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
45 initial
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
46
2266
fe4ca27ed700 tests: fix directory names in exchange-D3 test
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
47 $ setuprepos D.3
fe4ca27ed700 tests: fix directory names in exchange-D3 test
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
48 creating test repo for test case D.3
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
49 - pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
50 - main
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
51 - pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
52 cd into `main` and proceed with env setup
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
53 $ cd main
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
54 $ mkcommit A0
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
55 $ hg up -q 0
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
56 $ mkcommit B
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
57 created new head
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
58 $ mkcommit A1
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
59 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
60 $ hg prune -d '0 0' .
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
62 working directory now at 35b183996678
1239
8a06b32061ce evolve: apply prune update before creating obsolescence markers
Laurent Charignon <lcharignon@fb.com>
parents: 1093
diff changeset
63 1 changesets pruned
2562
279ec10273b8 test-exchange-case-D3: avoid stripping obsolescence marker
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2268
diff changeset
64 $ hg strip --hidden -q 'desc(A1)' --config devel.strip-obsmarkers=no
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
65 $ hg log -G --hidden
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
66 @ 35b183996678 (draft): B
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
67 |
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
68 | x 28b51eb45704 (draft): A0
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
69 |/
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
70 o a9bdc8b26820 (public): O
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
71
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
72 $ inspect_obsmarkers
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
73 obsstore content
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
74 ================
2580
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
75 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 (*) {'user': 'test'} (glob)
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
76 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (*) {'ef1': '*', 'user': 'test'} (glob)
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
77 obshashtree
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
78 ===========
2083
778afb036245 discovery: introduce a official 'obshash associated to a range
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1239
diff changeset
79 a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04 0000000000000000000000000000000000000000
778afb036245 discovery: introduce a official 'obshash associated to a range
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1239
diff changeset
80 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0000000000000000000000000000000000000000
2580
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
81 35b1839966785d5703a01607229eea932db42f87 43ff2c20d850ad18dee0f7f252c98c1f1a0cfd5c
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
82 obshashrange
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
83 ============
2228
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
84 rev node index size depth obshash
2580
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
85 2 35b183996678 0 2 2 43ff2c20d850
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
86 2 35b183996678 1 1 2 43ff2c20d850
2228
3b18440cca74 debugstablerange: improve output spacing
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2118
diff changeset
87 0 a9bdc8b26820 0 1 1 000000000000
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
88 $ cd ..
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
89 $ cd ..
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
90
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
91 Actual Test
2268
f2ebe960998b tests: update test to match upstreamable version
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2266
diff changeset
92 -----------
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
93
2266
fe4ca27ed700 tests: fix directory names in exchange-D3 test
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
94 $ dotest D.3 O
fe4ca27ed700 tests: fix directory names in exchange-D3 test
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2230
diff changeset
95 ## Running testcase D.3
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
96 # testing echange of "O" (a9bdc8b26820)
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
97 ## initial state
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
98 # obstore: main
2580
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
99 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 (*) {'user': 'test'} (glob)
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
100 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (*) {'ef1': '*', 'user': 'test'} (glob)
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
101 # obstore: pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
102 # obstore: pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
103 ## pushing "O" from main to pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
104 pushing to pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
105 searching for changes
1078
5717d023da63 obsexc: use the common discovery
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 1067
diff changeset
106 no changes found
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
107 ## post push state
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
108 # obstore: main
2580
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
109 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 (*) {'user': 'test'} (glob)
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
110 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (*) {'ef1': '*', 'user': 'test'} (glob)
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
111 # obstore: pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
112 # obstore: pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
113 ## pulling "a9bdc8b26820" from main into pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
114 pulling from main
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
115 no changes found
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
116 ## post pull state
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
117 # obstore: main
2580
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
118 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 (*) {'user': 'test'} (glob)
51a1dd295fe0 effectflag: activate effect flag for obsmarkers-case-*.t test files
Boris Feld <boris.feld@octobus.net>
parents: 2562
diff changeset
119 6aa67a7b4baa6fb41b06aed38d5b1201436546e2 0 {35b1839966785d5703a01607229eea932db42f87} (*) {'ef1': '*', 'user': 'test'} (glob)
850
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
120 # obstore: pushdest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
121 # obstore: pulldest
3618454a4da0 exchange: add test case for D.3
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
122