annotate tests/test-push-checkheads-pruned-B1.t @ 33116:6c113a7dec52

tests: use the system hg for examining the local repository Most test scripts use "hg" to interact with a temporary test repository. However a few tests also want to run hg commands to interact with the local repository containing the mercurial source code. Notably, many of the test-check-* tests want to check local files and commit messages. These tests were previously using the version of hg being tested to query the source repository. However, this will fail if the source repository requires extensions or other settings not supported by the version of mercurial being tested. The source repository was typically initially cloned using the system hg installation, so we should use the system hg installation to query it. There was already a helpers-testrepo.sh script designed to help cope with different requirements for the source repository versus the test repositories. However, it only handled the evolve extension. This new behavior works with any extensions that are different between the system installation and the test installation.
author Adam Simpkins <simpkins@fb.com>
date Tue, 27 Jun 2017 17:24:31 -0700
parents c6cb21ddf74a
children 53b3a1968aa6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32009
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
1 ====================================
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
2 Testing head checking code: Case B-1
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
3 ====================================
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
4
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
5 Mercurial checks for the introduction of new heads on push. Evolution comes
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
6 into play to detect if existing branches on the server are being replaced by
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
7 some of the new one we push.
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
8
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
9 This case is part of a series of tests checking this behavior.
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
10
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
11 Category B: simple case involving pruned changesets
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
12 TestCase 1: single pruned changeset
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
13
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
14 .. old-state:
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
15 ..
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
16 .. * 1 changeset branch
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
17 ..
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
18 .. new-state:
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
19 ..
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
20 .. * old branch is pruned
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
21 .. * 1 new unrelated branch
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
22 ..
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
23 .. expected-result:
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
24 ..
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
25 .. * push allowed
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
26 ..
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
27 .. graph-summary:
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
28 ..
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
29 .. ◔ B
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
30 .. |
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
31 .. A ⊗ |
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
32 .. |/
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
33 .. ●
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
34
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
35 $ . $TESTDIR/testlib/push-checkheads-util.sh
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
36
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
37 Test setup
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
38 ----------
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
39
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
40 $ mkdir B1
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
41 $ cd B1
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
42 $ setuprepos
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
43 creating basic server and client repo
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
44 updating to branch default
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
46 $ cd client
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
47 $ hg up 0
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
49 $ mkcommit B0
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
50 created new head
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
51 $ hg debugobsolete --record-parents `getid "desc(A0)"`
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
52 $ hg log -G --hidden
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
53 @ 74ff5441d343 (draft): B0
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
54 |
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
55 | x 8aaa48160adc (draft): A0
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
56 |/
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
57 o 1e4be0697311 (public): root
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
58
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
59
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
60 Actual testing
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
61 --------------
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
62
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
63 $ hg push
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
64 pushing to $TESTTMP/B1/server (glob)
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
65 searching for changes
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
66 adding changesets
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
67 adding manifests
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
68 adding file changes
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
69 added 1 changesets with 1 changes to 1 files (+1 heads)
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
70 1 new obsolescence markers
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
71
c6cb21ddf74a checkheads: upgrade the obsolescence postprocessing logic (issue4354)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
72 $ cd ../..