comparison tests/test-evolve-obshistory-prune.t @ 3914:96945ea908df stable

branching: merge default into stable The stable branch of Mercurial core now contains Mercurial 4.7 so evolve branch policy requires this merge. The @ bookmark is in the right location, so people doing clone will get to the latest release.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 31 Jul 2018 12:52:06 +0200
parents 8c368720f010
children f7afd3a158e3 30a544904238
comparison
equal deleted inserted replaced
3901:f2b8429db565 3914:96945ea908df
1 This test file test the various messages when accessing obsolete
2 revisions.
3
4 Global setup
5 ============
6
7 $ . $TESTDIR/testlib/obshistory_setup.sh
8
9 Test output with pruned commit
10 ==============================
11
12 Check output on the client side
13 -------------------------------
14
15 $ hg init $TESTTMP/local-prune
16 $ hg init $TESTTMP/server
17 $ cd $TESTTMP/local-prune
18 $ mkcommit ROOT
19 $ mkcommit A0 # 0
20 $ mkcommit B0 # 1
21 $ sync
22 $ hg log --hidden -G
23 @ changeset: 2:0dec01379d3b
24 | tag: tip
25 | user: test
26 | date: Thu Jan 01 00:00:00 1970 +0000
27 | summary: B0
28 |
29 o changeset: 1:471f378eab4c
30 | user: test
31 | date: Thu Jan 01 00:00:00 1970 +0000
32 | summary: A0
33 |
34 o changeset: 0:ea207398892e
35 user: test
36 date: Thu Jan 01 00:00:00 1970 +0000
37 summary: ROOT
38
39 $ hg prune -r 'desc(B0)'
40 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
41 working directory now at 471f378eab4c
42 1 changesets pruned
43 $ sync
44 $ hg log --hidden -G
45 x changeset: 2:0dec01379d3b
46 | tag: tip
47 | user: test
48 | date: Thu Jan 01 00:00:00 1970 +0000
49 | obsolete: pruned using prune
50 | summary: B0
51 |
52 @ changeset: 1:471f378eab4c
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: A0
56 |
57 o changeset: 0:ea207398892e
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: ROOT
61
62
63 Actual test
64 -----------
65
66 $ hg obslog 'desc(B0)' --hidden --patch
67 x 0dec01379d3b (2) B0
68 pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000)
69 (No patch available, no successors)
70
71 $ hg obslog 'desc(B0)' --hidden --no-graph -Tjson | python -m json.tool
72 [
73 {
74 "markers": [
75 {
76 "date": [
77 *, (glob)
78 0 (glob)
79 ],
80 "operation": "prune",
81 "user": "test",
82 "verb": "pruned"
83 }
84 ],
85 "node": "0dec01379d3b",
86 "rev": 2,
87 "shortdescription": "B0"
88 }
89 ]
90 $ hg obslog 'desc(A0)' --patch
91 @ 471f378eab4c (1) A0
92
93 $ hg obslog 'desc(A0)' --no-graph -Tjson | python -m json.tool
94 [
95 {
96 "markers": [],
97 "node": "471f378eab4c",
98 "rev": 1,
99 "shortdescription": "A0"
100 }
101 ]
102 $ hg up 1
103 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 $ hg up 0dec01379d3b
105 abort: hidden revision '0dec01379d3b' is pruned!
106 (use --hidden to access hidden revisions)
107 [255]
108 $ hg up --hidden -r 'desc(B0)'
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 updated to hidden changeset 0dec01379d3b
111 (hidden revision '0dec01379d3b' is pruned)
112 working directory parent is obsolete! (0dec01379d3b)
113 (use 'hg evolve' to update to its parent successor)
114
115 Check output on the server side
116 -------------------------------
117
118 $ hg obslog -f -R $TESTTMP/server --patch 0dec01379d3b --hidden
119 x 0dec01379d3b (2) B0
120 pruned using prune by test (at Thu Jan 01 00:00:00 1970 +0000)
121 (No patch available, no successors)
122
123 # TODO ADD amend + prune