##// END OF EJS Templates
tests: conditionalize tests for various repo features...
Gregory Szorc -
r37434:7542e97c default
parent child Browse files
Show More
@@ -1,186 +1,188 b''
1 1 #require test-repo
2 2
3 3 Set vars:
4 4
5 5 $ . "$TESTDIR/helpers-testrepo.sh"
6 6 $ CONTRIBDIR="$TESTDIR/../contrib"
7 7
8 8 Prepare repo:
9 9
10 10 $ hg init
11 11
12 12 $ echo this is file a > a
13 13 $ hg add a
14 14 $ hg commit -m first
15 15
16 16 $ echo adding to file a >> a
17 17 $ hg commit -m second
18 18
19 19 $ echo adding more to file a >> a
20 20 $ hg commit -m third
21 21
22 22 $ hg up -r 0
23 23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 24 $ echo merge-this >> a
25 25 $ hg commit -m merge-able
26 26 created new head
27 27
28 28 $ hg up -r 2
29 29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 30
31 31 perfstatus
32 32
33 33 $ cat >> $HGRCPATH << EOF
34 34 > [extensions]
35 35 > perfstatusext=$CONTRIBDIR/perf.py
36 36 > [perf]
37 37 > presleep=0
38 38 > stub=on
39 39 > parentscount=1
40 40 > EOF
41 41 $ hg help perfstatusext
42 42 perfstatusext extension - helper extension to measure performance
43 43
44 44 list of commands:
45 45
46 46 perfaddremove
47 47 (no help text available)
48 48 perfancestors
49 49 (no help text available)
50 50 perfancestorset
51 51 (no help text available)
52 52 perfannotate (no help text available)
53 53 perfbdiff benchmark a bdiff between revisions
54 54 perfbookmarks
55 55 benchmark parsing bookmarks from disk to memory
56 56 perfbranchmap
57 57 benchmark the update of a branchmap
58 58 perfbundleread
59 59 Benchmark reading of bundle files.
60 60 perfcca (no help text available)
61 61 perfchangegroupchangelog
62 62 Benchmark producing a changelog group for a changegroup.
63 63 perfchangeset
64 64 (no help text available)
65 65 perfctxfiles (no help text available)
66 66 perfdiffwd Profile diff of working directory changes
67 67 perfdirfoldmap
68 68 (no help text available)
69 69 perfdirs (no help text available)
70 70 perfdirstate (no help text available)
71 71 perfdirstatedirs
72 72 (no help text available)
73 73 perfdirstatefoldmap
74 74 (no help text available)
75 75 perfdirstatewrite
76 76 (no help text available)
77 77 perffncacheencode
78 78 (no help text available)
79 79 perffncacheload
80 80 (no help text available)
81 81 perffncachewrite
82 82 (no help text available)
83 83 perfheads (no help text available)
84 84 perfindex (no help text available)
85 85 perfloadmarkers
86 86 benchmark the time to parse the on-disk markers for a repo
87 87 perflog (no help text available)
88 88 perflookup (no help text available)
89 89 perflrucachedict
90 90 (no help text available)
91 91 perfmanifest (no help text available)
92 92 perfmergecalculate
93 93 (no help text available)
94 94 perfmoonwalk benchmark walking the changelog backwards
95 95 perfnodelookup
96 96 (no help text available)
97 97 perfparents (no help text available)
98 98 perfpathcopies
99 99 (no help text available)
100 100 perfphases benchmark phasesets computation
101 101 perfrawfiles (no help text available)
102 102 perfrevlogchunks
103 103 Benchmark operations on revlog chunks.
104 104 perfrevlogindex
105 105 Benchmark operations against a revlog index.
106 106 perfrevlogrevision
107 107 Benchmark obtaining a revlog revision.
108 108 perfrevlogrevisions
109 109 Benchmark reading a series of revisions from a revlog.
110 110 perfrevrange (no help text available)
111 111 perfrevset benchmark the execution time of a revset
112 112 perfstartup (no help text available)
113 113 perfstatus (no help text available)
114 114 perftags (no help text available)
115 115 perftemplating
116 116 (no help text available)
117 117 perfunidiff benchmark a unified diff between revisions
118 118 perfvolatilesets
119 119 benchmark the computation of various volatile set
120 120 perfwalk (no help text available)
121 121 perfwrite microbenchmark ui.write
122 122
123 123 (use 'hg help -v perfstatusext' to show built-in aliases and global options)
124 124 $ hg perfaddremove
125 125 $ hg perfancestors
126 126 $ hg perfancestorset 2
127 127 $ hg perfannotate a
128 128 $ hg perfbdiff -c 1
129 129 $ hg perfbdiff --alldata 1
130 130 $ hg perfunidiff -c 1
131 131 $ hg perfunidiff --alldata 1
132 132 $ hg perfbookmarks
133 133 $ hg perfbranchmap
134 134 $ hg perfcca
135 135 $ hg perfchangegroupchangelog
136 136 $ hg perfchangeset 2
137 137 $ hg perfctxfiles 2
138 138 $ hg perfdiffwd
139 139 $ hg perfdirfoldmap
140 140 $ hg perfdirs
141 141 $ hg perfdirstate
142 142 $ hg perfdirstatedirs
143 143 $ hg perfdirstatefoldmap
144 144 $ hg perfdirstatewrite
145 #if repofncache
145 146 $ hg perffncacheencode
146 147 $ hg perffncacheload
147 148 $ hg perffncachewrite
149 #endif
148 150 $ hg perfheads
149 151 $ hg perfindex
150 152 $ hg perfloadmarkers
151 153 $ hg perflog
152 154 $ hg perflookup 2
153 155 $ hg perflrucache
154 156 $ hg perfmanifest 2
155 157 $ hg perfmergecalculate -r 3
156 158 $ hg perfmoonwalk
157 159 $ hg perfnodelookup 2
158 160 $ hg perfpathcopies 1 2
159 161 $ hg perfrawfiles 2
160 162 $ hg perfrevlogindex -c
161 163 #if reporevlogstore
162 164 $ hg perfrevlogrevisions .hg/store/data/a.i
163 165 #endif
164 166 $ hg perfrevlogrevision -m 0
165 167 $ hg perfrevlogchunks -c
166 168 $ hg perfrevrange
167 169 $ hg perfrevset 'all()'
168 170 $ hg perfstartup
169 171 $ hg perfstatus
170 172 $ hg perftags
171 173 $ hg perftemplating
172 174 $ hg perfvolatilesets
173 175 $ hg perfwalk
174 176 $ hg perfparents
175 177
176 178 Check perf.py for historical portability
177 179
178 180 $ cd "$TESTDIR/.."
179 181
180 182 $ (testrepohg files -r 1.2 glob:mercurial/*.c glob:mercurial/*.py;
181 183 > testrepohg files -r tip glob:mercurial/*.c glob:mercurial/*.py) |
182 184 > "$TESTDIR"/check-perf-code.py contrib/perf.py
183 185 contrib/perf.py:\d+: (re)
184 186 > from mercurial import (
185 187 import newer module separately in try clause for early Mercurial
186 188 [1]
@@ -1,207 +1,208 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extensions]
3 3 > convert=
4 4 > [convert]
5 5 > hg.saverev=False
6 6 > EOF
7 7 $ hg init orig
8 8 $ cd orig
9 9 $ echo foo > foo
10 10 $ echo bar > bar
11 11 $ hg ci -qAm 'add foo bar' -d '0 0'
12 12 $ echo >> foo
13 13 $ hg ci -m 'change foo' -d '1 0'
14 14 $ hg up -qC 0
15 15 $ hg copy --after --force foo bar
16 16 $ hg copy foo baz
17 17 $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
18 18 created new head
19 19
20 20 Test that template can print all file copies (issue4362)
21 21 $ hg log -r . --template "{file_copies % ' File: {file_copy}\n'}"
22 22 File: bar (foo)
23 23 File: baz (foo)
24 24
25 25 $ hg bookmark premerge1
26 26 $ hg merge -r 1
27 27 merging baz and foo to baz
28 28 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
29 29 (branch merge, don't forget to commit)
30 30 $ hg ci -m 'merge local copy' -d '3 0'
31 31 $ hg up -C 1
32 32 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
33 33 (leaving bookmark premerge1)
34 34 $ hg bookmark premerge2
35 35 $ hg merge 2
36 36 merging foo and baz to baz
37 37 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
38 38 (branch merge, don't forget to commit)
39 39 $ hg ci -m 'merge remote copy' -d '4 0'
40 40 created new head
41 41
42 42 Make and delete some tags
43 43
44 44 $ hg tag that
45 45 $ hg tag --remove that
46 46 $ hg tag this
47 47
48 48 #if execbit
49 49 $ chmod +x baz
50 50 #else
51 51 $ echo some other change to make sure we get a rev 5 > baz
52 52 #endif
53 53 $ hg ci -m 'mark baz executable' -d '5 0'
54 54 $ cd ..
55 55 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
56 56 initializing destination new repository
57 57 scanning source...
58 58 sorting...
59 59 converting...
60 60 8 add foo bar
61 61 7 change foo
62 62 6 make bar and baz copies of foo
63 63 5 merge local copy
64 64 4 merge remote copy
65 65 3 Added tag that for changeset 88586c4e9f02
66 66 2 Removed tag that
67 67 1 Added tag this for changeset c56a7f387039
68 68 0 mark baz executable
69 69 updating bookmarks
70 70 $ cd new
71 71 $ hg out ../orig
72 72 comparing with ../orig
73 73 searching for changes
74 74 no changes found
75 75 [1]
76 76 #if execbit
77 77 $ hg bookmarks
78 78 premerge1 3:973ef48a98a4
79 79 premerge2 8:91d107c423ba
80 80 #else
81 81 Different hash because no x bit
82 82 $ hg bookmarks
83 83 premerge1 3:973ef48a98a4
84 84 premerge2 8:3537b15eaaca
85 85 #endif
86 86
87 87 Test that redoing a convert results in an identical graph
88 88 $ cd ../
89 89 $ rm new/.hg/shamap
90 90 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
91 91 scanning source...
92 92 sorting...
93 93 converting...
94 94 8 add foo bar
95 95 7 change foo
96 96 6 make bar and baz copies of foo
97 97 5 merge local copy
98 98 4 merge remote copy
99 99 3 Added tag that for changeset 88586c4e9f02
100 100 2 Removed tag that
101 101 1 Added tag this for changeset c56a7f387039
102 102 0 mark baz executable
103 103 updating bookmarks
104 104 $ hg -R new log -G -T '{rev} {desc}'
105 105 o 8 mark baz executable
106 106 |
107 107 o 7 Added tag this for changeset c56a7f387039
108 108 |
109 109 o 6 Removed tag that
110 110 |
111 111 o 5 Added tag that for changeset 88586c4e9f02
112 112 |
113 113 o 4 merge remote copy
114 114 |\
115 115 +---o 3 merge local copy
116 116 | |/
117 117 | o 2 make bar and baz copies of foo
118 118 | |
119 119 o | 1 change foo
120 120 |/
121 121 o 0 add foo bar
122 122
123 123
124 124 check shamap LF and CRLF handling
125 125
126 126 $ cat > rewrite.py <<EOF
127 127 > import sys
128 128 > # Interlace LF and CRLF
129 129 > lines = [(l.rstrip() + ((i % 2) and b'\n' or b'\r\n'))
130 130 > for i, l in enumerate(open(sys.argv[1], 'rb'))]
131 131 > open(sys.argv[1], 'wb').write(b''.join(lines))
132 132 > EOF
133 133 $ $PYTHON rewrite.py new/.hg/shamap
134 134 $ cd orig
135 135 $ hg up -qC 1
136 136 $ echo foo >> foo
137 137 $ hg ci -qm 'change foo again'
138 138 $ hg up -qC 2
139 139 $ echo foo >> foo
140 140 $ hg ci -qm 'change foo again again'
141 141 $ cd ..
142 142 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
143 143 scanning source...
144 144 sorting...
145 145 converting...
146 146 1 change foo again again
147 147 0 change foo again
148 148 updating bookmarks
149 149
150 150 init broken repository
151 151
152 152 $ hg init broken
153 153 $ cd broken
154 154 $ echo a >> a
155 155 $ echo b >> b
156 156 $ hg ci -qAm init
157 157 $ echo a >> a
158 158 $ echo b >> b
159 159 $ hg copy b c
160 160 $ hg ci -qAm changeall
161 161 $ hg up -qC 0
162 162 $ echo bc >> b
163 163 $ hg ci -m changebagain
164 164 created new head
165 165 $ HGMERGE=internal:local hg -q merge
166 166 $ hg ci -m merge
167 167 $ hg mv b d
168 168 $ hg ci -m moveb
169 169
170 170 break it
171 171
172 172 #if reporevlogstore
173 173 $ rm .hg/store/data/b.*
174 174 #endif
175 175 #if reposimplestore
176 176 $ rm .hg/store/data/b/*
177 177 #endif
178 178 $ cd ..
179 179 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
180 180 initializing destination fixed repository
181 181 scanning source...
182 182 sorting...
183 183 converting...
184 184 4 init
185 ignoring: data/b.i@1e88685f5dde: no match found
185 ignoring: data/b.i@1e88685f5dde: no match found (reporevlogstore !)
186 ignoring: data/b/index@1e88685f5dde: no node (reposimplestore !)
186 187 3 changeall
187 188 2 changebagain
188 189 1 merge
189 190 0 moveb
190 191 $ hg -R fixed verify
191 192 checking changesets
192 193 checking manifests
193 194 crosschecking files in changesets and manifests
194 195 checking files
195 196 3 files, 5 changesets, 5 total revisions
196 197
197 198 manifest -r 0
198 199
199 200 $ hg -R fixed manifest -r 0
200 201 a
201 202
202 203 manifest -r tip
203 204
204 205 $ hg -R fixed manifest -r tip
205 206 a
206 207 c
207 208 d
@@ -1,418 +1,427 b''
1 1 $ cat << EOF >> $HGRCPATH
2 2 > [ui]
3 3 > interactive=yes
4 4 > EOF
5 5
6 6 $ hg init debugrevlog
7 7 $ cd debugrevlog
8 8 $ echo a > a
9 9 $ hg ci -Am adda
10 10 adding a
11 #if reporevlogstore
11 12 $ hg debugrevlog -m
12 13 format : 1
13 14 flags : inline, generaldelta
14 15
15 16 revisions : 1
16 17 merges : 0 ( 0.00%)
17 18 normal : 1 (100.00%)
18 19 revisions : 1
19 20 full : 1 (100.00%)
20 21 deltas : 0 ( 0.00%)
21 22 revision size : 44
22 23 full : 44 (100.00%)
23 24 deltas : 0 ( 0.00%)
24 25
25 26 chunks : 1
26 27 0x75 (u) : 1 (100.00%)
27 28 chunks size : 44
28 29 0x75 (u) : 44 (100.00%)
29 30
30 31 avg chain length : 0
31 32 max chain length : 0
32 33 max chain reach : 44
33 34 compression ratio : 0
34 35
35 36 uncompressed data size (min/max/avg) : 43 / 43 / 43
36 37 full revision size (min/max/avg) : 44 / 44 / 44
37 38 delta size (min/max/avg) : 0 / 0 / 0
39 #endif
38 40
39 41 Test debugindex, with and without the --verbose/--debug flag
40 42 $ hg debugindex a
41 43 rev linkrev nodeid p1 p2
42 44 0 0 b789fdd96dc2 000000000000 000000000000
43 45
46 #if no-reposimplestore
44 47 $ hg --verbose debugindex a
45 48 rev offset length linkrev nodeid p1 p2
46 49 0 0 3 0 b789fdd96dc2 000000000000 000000000000
47 50
48 51 $ hg --debug debugindex a
49 52 rev offset length linkrev nodeid p1 p2
50 53 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
54 #endif
51 55
52 56 $ hg debugindex -f 1 a
53 57 rev flag size link p1 p2 nodeid
54 58 0 0000 2 0 -1 -1 b789fdd96dc2
55 59
60 #if no-reposimplestore
56 61 $ hg --verbose debugindex -f 1 a
57 62 rev flag offset length size link p1 p2 nodeid
58 63 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
59 64
60 65 $ hg --debug debugindex -f 1 a
61 66 rev flag offset length size link p1 p2 nodeid
62 67 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
68 #endif
63 69
64 70 debugdelta chain basic output
65 71
72 #if reporevlogstore
66 73 $ hg debugdeltachain -m
67 74 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
68 75 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000
69 76
70 77 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
71 78 0 1 1
72 79
73 80 $ hg debugdeltachain -m -Tjson
74 81 [
75 82 {
76 83 "chainid": 1,
77 84 "chainlen": 1,
78 85 "chainratio": 1.02325581395,
79 86 "chainsize": 44,
80 87 "compsize": 44,
81 88 "deltatype": "base",
82 89 "extradist": 0,
83 90 "extraratio": 0.0,
84 91 "lindist": 44,
85 92 "prevrev": -1,
86 93 "rev": 0,
87 94 "uncompsize": 43
88 95 }
89 96 ]
90 97
91 98 debugdelta chain with sparse read enabled
92 99
93 100 $ cat >> $HGRCPATH <<EOF
94 101 > [experimental]
95 102 > sparse-read = True
96 103 > EOF
97 104 $ hg debugdeltachain -m
98 105 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
99 106 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
100 107
101 108 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
102 109 0 1 1 44 44 1.0
103 110
104 111 $ hg debugdeltachain -m -Tjson
105 112 [
106 113 {
107 114 "chainid": 1,
108 115 "chainlen": 1,
109 116 "chainratio": 1.02325581395,
110 117 "chainsize": 44,
111 118 "compsize": 44,
112 119 "deltatype": "base",
113 120 "extradist": 0,
114 121 "extraratio": 0.0,
115 122 "largestblock": 44,
116 123 "lindist": 44,
117 124 "prevrev": -1,
118 125 "readdensity": 1.0,
119 126 "readsize": 44,
120 127 "rev": 0,
121 128 "srchunks": 1,
122 129 "uncompsize": 43
123 130 }
124 131 ]
125 132
126 133 $ printf "This test checks things.\n" >> a
127 134 $ hg ci -m a
128 135 $ hg branch other
129 136 marked working directory as branch other
130 137 (branches are permanent and global, did you want a bookmark?)
131 138 $ for i in `$TESTDIR/seq.py 5`; do
132 139 > printf "shorter ${i}" >> a
133 140 > hg ci -m "a other:$i"
134 141 > hg up -q default
135 142 > printf "for the branch default we want longer chains: ${i}" >> a
136 143 > hg ci -m "a default:$i"
137 144 > hg up -q other
138 145 > done
139 146 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
140 147 > --config experimental.sparse-read.density-threshold=0.50 \
141 148 > --config experimental.sparse-read.min-gap-size=0
142 149 0 1
143 150 1 1
144 151 2 1
145 152 3 1
146 153 4 1
147 154 5 1
148 155 6 1
149 156 7 1
150 157 8 1
151 158 9 1
152 159 10 2
153 160 11 1
154 161 $ hg --config extensions.strip= strip --no-backup -r 1
155 162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 163
157 164 Test max chain len
158 165 $ cat >> $HGRCPATH << EOF
159 166 > [format]
160 167 > maxchainlen=4
161 168 > EOF
162 169
163 170 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
164 171 $ hg ci -m a
165 172 $ printf "b\n" >> a
166 173 $ hg ci -m a
167 174 $ printf "c\n" >> a
168 175 $ hg ci -m a
169 176 $ printf "d\n" >> a
170 177 $ hg ci -m a
171 178 $ printf "e\n" >> a
172 179 $ hg ci -m a
173 180 $ printf "f\n" >> a
174 181 $ hg ci -m a
175 182 $ printf 'g\n' >> a
176 183 $ hg ci -m a
177 184 $ printf 'h\n' >> a
178 185 $ hg ci -m a
186
179 187 $ hg debugrevlog -d a
180 188 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
181 189 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
182 190 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
183 191 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
184 192 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
185 193 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
186 194 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
187 195 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
188 196 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
189 197 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
198 #endif
190 199
191 200 Test debuglocks command:
192 201
193 202 $ hg debuglocks
194 203 lock: free
195 204 wlock: free
196 205
197 206 * Test setting the lock
198 207
199 208 waitlock <file> will wait for file to be created. If it isn't in a reasonable
200 209 amount of time, displays error message and returns 1
201 210 $ waitlock() {
202 211 > start=`date +%s`
203 212 > timeout=5
204 213 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
205 214 > now=`date +%s`
206 215 > if [ "`expr $now - $start`" -gt $timeout ]; then
207 216 > echo "timeout: $1 was not created in $timeout seconds"
208 217 > return 1
209 218 > fi
210 219 > sleep 0.1
211 220 > done
212 221 > }
213 222 $ dolock() {
214 223 > {
215 224 > waitlock .hg/unlock
216 225 > rm -f .hg/unlock
217 226 > echo y
218 227 > } | hg debuglocks "$@" > /dev/null
219 228 > }
220 229 $ dolock -s &
221 230 $ waitlock .hg/store/lock
222 231
223 232 $ hg debuglocks
224 233 lock: user *, process * (*s) (glob)
225 234 wlock: free
226 235 [1]
227 236 $ touch .hg/unlock
228 237 $ wait
229 238 $ [ -f .hg/store/lock ] || echo "There is no lock"
230 239 There is no lock
231 240
232 241 * Test setting the wlock
233 242
234 243 $ dolock -S &
235 244 $ waitlock .hg/wlock
236 245
237 246 $ hg debuglocks
238 247 lock: free
239 248 wlock: user *, process * (*s) (glob)
240 249 [1]
241 250 $ touch .hg/unlock
242 251 $ wait
243 252 $ [ -f .hg/wlock ] || echo "There is no wlock"
244 253 There is no wlock
245 254
246 255 * Test setting both locks
247 256
248 257 $ dolock -Ss &
249 258 $ waitlock .hg/wlock && waitlock .hg/store/lock
250 259
251 260 $ hg debuglocks
252 261 lock: user *, process * (*s) (glob)
253 262 wlock: user *, process * (*s) (glob)
254 263 [2]
255 264
256 265 * Test failing to set a lock
257 266
258 267 $ hg debuglocks -s
259 268 abort: lock is already held
260 269 [255]
261 270
262 271 $ hg debuglocks -S
263 272 abort: wlock is already held
264 273 [255]
265 274
266 275 $ touch .hg/unlock
267 276 $ wait
268 277
269 278 $ hg debuglocks
270 279 lock: free
271 280 wlock: free
272 281
273 282 * Test forcing the lock
274 283
275 284 $ dolock -s &
276 285 $ waitlock .hg/store/lock
277 286
278 287 $ hg debuglocks
279 288 lock: user *, process * (*s) (glob)
280 289 wlock: free
281 290 [1]
282 291
283 292 $ hg debuglocks -L
284 293
285 294 $ hg debuglocks
286 295 lock: free
287 296 wlock: free
288 297
289 298 $ touch .hg/unlock
290 299 $ wait
291 300
292 301 * Test forcing the wlock
293 302
294 303 $ dolock -S &
295 304 $ waitlock .hg/wlock
296 305
297 306 $ hg debuglocks
298 307 lock: free
299 308 wlock: user *, process * (*s) (glob)
300 309 [1]
301 310
302 311 $ hg debuglocks -W
303 312
304 313 $ hg debuglocks
305 314 lock: free
306 315 wlock: free
307 316
308 317 $ touch .hg/unlock
309 318 $ wait
310 319
311 320 Test WdirUnsupported exception
312 321
313 322 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
314 323 abort: working directory revision cannot be specified
315 324 [255]
316 325
317 326 Test cache warming command
318 327
319 328 $ rm -rf .hg/cache/
320 329 $ hg debugupdatecaches --debug
321 330 updating the branch cache
322 331 $ ls -r .hg/cache/*
323 332 .hg/cache/rbc-revs-v1
324 333 .hg/cache/rbc-names-v1
325 334 .hg/cache/branch2-served
326 335
327 336 $ cd ..
328 337
329 338 Test internal debugstacktrace command
330 339
331 340 $ cat > debugstacktrace.py << EOF
332 341 > from __future__ import absolute_import
333 342 > import sys
334 343 > from mercurial import util
335 344 > def f():
336 345 > util.debugstacktrace(f=sys.stdout)
337 346 > g()
338 347 > def g():
339 348 > util.dst('hello from g\\n', skip=1)
340 349 > h()
341 350 > def h():
342 351 > util.dst('hi ...\\nfrom h hidden in g', 1, depth=2)
343 352 > f()
344 353 > EOF
345 354 $ $PYTHON debugstacktrace.py
346 355 stacktrace at:
347 356 debugstacktrace.py:12 in * (glob)
348 357 debugstacktrace.py:5 in f
349 358 hello from g at:
350 359 debugstacktrace.py:12 in * (glob)
351 360 debugstacktrace.py:6 in f
352 361 hi ...
353 362 from h hidden in g at:
354 363 debugstacktrace.py:6 in f
355 364 debugstacktrace.py:9 in g
356 365
357 366 Test debugcapabilities command:
358 367
359 368 $ hg debugcapabilities ./debugrevlog/
360 369 Main capabilities:
361 370 branchmap
362 371 $USUAL_BUNDLE2_CAPS$
363 372 getbundle
364 373 known
365 374 lookup
366 375 pushkey
367 376 unbundle
368 377 Bundle2 capabilities:
369 378 HG20
370 379 bookmarks
371 380 changegroup
372 381 01
373 382 02
374 383 digests
375 384 md5
376 385 sha1
377 386 sha512
378 387 error
379 388 abort
380 389 unsupportedcontent
381 390 pushraced
382 391 pushkey
383 392 hgtagsfnodes
384 393 listkeys
385 394 phases
386 395 heads
387 396 pushkey
388 397 remote-changegroup
389 398 http
390 399 https
391 400 rev-branch-cache
392 401 stream
393 402 v2
394 403
395 404 Test debugpeer
396 405
397 406 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
398 407 url: ssh://user@dummy/debugrevlog
399 408 local: no
400 409 pushable: yes
401 410
402 411 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
403 412 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
404 413 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
405 414 devel-peer-request: hello
406 415 sending hello command
407 416 devel-peer-request: between
408 417 devel-peer-request: pairs: 81 bytes
409 418 sending between command
410 419 remote: 413
411 420 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
412 421 remote: 1
413 422 devel-peer-request: protocaps
414 423 devel-peer-request: caps: * bytes (glob)
415 424 sending protocaps command
416 425 url: ssh://user@dummy/debugrevlog
417 426 local: no
418 427 pushable: yes
@@ -1,561 +1,563 b''
1 1 #require killdaemons serve
2 2
3 3 $ hg init test
4 4 $ cd test
5 5 $ echo foo>foo
6 6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
7 7 $ echo foo>foo.d/foo
8 8 $ echo bar>foo.d/bAr.hg.d/BaR
9 9 $ echo bar>foo.d/baR.d.hg/bAR
10 10 $ hg commit -A -m 1
11 11 adding foo
12 12 adding foo.d/bAr.hg.d/BaR
13 13 adding foo.d/baR.d.hg/bAR
14 14 adding foo.d/foo
15 15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
16 16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
17 17
18 18 Test server address cannot be reused
19 19
20 20 $ hg serve -p $HGPORT1 2>&1
21 21 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
22 22 [255]
23 23
24 24 $ cd ..
25 25 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
26 26
27 27 clone via stream
28 28
29 29 #if no-reposimplestore
30 30 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
31 31 streaming all changes
32 32 6 files to transfer, 606 bytes of data
33 33 transferred * bytes in * seconds (*/sec) (glob)
34 34 searching for changes
35 35 no changes found
36 36 updating to branch default
37 37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 38 $ hg verify -R copy
39 39 checking changesets
40 40 checking manifests
41 41 crosschecking files in changesets and manifests
42 42 checking files
43 43 4 files, 1 changesets, 4 total revisions
44 44 #endif
45 45
46 46 try to clone via stream, should use pull instead
47 47
48 48 $ hg clone --stream http://localhost:$HGPORT1/ copy2
49 49 warning: stream clone requested but server has them disabled
50 50 requesting all changes
51 51 adding changesets
52 52 adding manifests
53 53 adding file changes
54 54 added 1 changesets with 4 changes to 4 files
55 55 new changesets 8b6053c928fe
56 56 updating to branch default
57 57 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 58
59 59 try to clone via stream but missing requirements, so should use pull instead
60 60
61 61 $ cat > $TESTTMP/removesupportedformat.py << EOF
62 62 > from mercurial import localrepo
63 63 > def extsetup(ui):
64 64 > localrepo.localrepository.supportedformats.remove('generaldelta')
65 65 > EOF
66 66
67 67 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
68 68 warning: stream clone requested but client is missing requirements: generaldelta
69 69 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
70 70 requesting all changes
71 71 adding changesets
72 72 adding manifests
73 73 adding file changes
74 74 added 1 changesets with 4 changes to 4 files
75 75 new changesets 8b6053c928fe
76 76 updating to branch default
77 77 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 78
79 79 clone via pull
80 80
81 81 $ hg clone http://localhost:$HGPORT1/ copy-pull
82 82 requesting all changes
83 83 adding changesets
84 84 adding manifests
85 85 adding file changes
86 86 added 1 changesets with 4 changes to 4 files
87 87 new changesets 8b6053c928fe
88 88 updating to branch default
89 89 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 90 $ hg verify -R copy-pull
91 91 checking changesets
92 92 checking manifests
93 93 crosschecking files in changesets and manifests
94 94 checking files
95 95 4 files, 1 changesets, 4 total revisions
96 96 $ cd test
97 97 $ echo bar > bar
98 98 $ hg commit -A -d '1 0' -m 2
99 99 adding bar
100 100 $ cd ..
101 101
102 102 clone over http with --update
103 103
104 104 $ hg clone http://localhost:$HGPORT1/ updated --update 0
105 105 requesting all changes
106 106 adding changesets
107 107 adding manifests
108 108 adding file changes
109 109 added 2 changesets with 5 changes to 5 files
110 110 new changesets 8b6053c928fe:5fed3813f7f5
111 111 updating to branch default
112 112 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 113 $ hg log -r . -R updated
114 114 changeset: 0:8b6053c928fe
115 115 user: test
116 116 date: Thu Jan 01 00:00:00 1970 +0000
117 117 summary: 1
118 118
119 119 $ rm -rf updated
120 120
121 121 incoming via HTTP
122 122
123 123 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
124 124 adding changesets
125 125 adding manifests
126 126 adding file changes
127 127 added 1 changesets with 4 changes to 4 files
128 128 new changesets 8b6053c928fe
129 129 updating to branch default
130 130 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 131 $ cd partial
132 132 $ touch LOCAL
133 133 $ hg ci -qAm LOCAL
134 134 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
135 135 comparing with http://localhost:$HGPORT1/
136 136 searching for changes
137 137 2
138 138 $ cd ..
139 139
140 140 pull
141 141
142 142 $ cd copy-pull
143 143 $ cat >> .hg/hgrc <<EOF
144 144 > [hooks]
145 145 > changegroup = sh -c "printenv.py changegroup"
146 146 > EOF
147 147 $ hg pull
148 148 pulling from http://localhost:$HGPORT1/
149 149 searching for changes
150 150 adding changesets
151 151 adding manifests
152 152 adding file changes
153 153 added 1 changesets with 1 changes to 1 files
154 154 new changesets 5fed3813f7f5
155 155 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/
156 156 (run 'hg update' to get a working copy)
157 157 $ cd ..
158 158
159 159 clone from invalid URL
160 160
161 161 $ hg clone http://localhost:$HGPORT/bad
162 162 abort: HTTP Error 404: Not Found
163 163 [255]
164 164
165 165 test http authentication
166 166 + use the same server to test server side streaming preference
167 167
168 168 $ cd test
169 169 $ cat << EOT > userpass.py
170 170 > import base64
171 171 > from mercurial.hgweb import common
172 172 > def perform_authentication(hgweb, req, op):
173 173 > auth = req.headers.get('Authorization')
174 174 > if not auth:
175 175 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
176 176 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
177 177 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
178 178 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
179 179 > def extsetup():
180 180 > common.permhooks.insert(0, perform_authentication)
181 181 > EOT
182 182 $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \
183 183 > --config server.preferuncompressed=True \
184 184 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
185 185 $ cat pid >> $DAEMON_PIDS
186 186
187 187 $ cat << EOF > get_pass.py
188 188 > import getpass
189 189 > def newgetpass(arg):
190 190 > return "pass"
191 191 > getpass.getpass = newgetpass
192 192 > EOF
193 193
194 194 $ hg id http://localhost:$HGPORT2/
195 195 abort: http authorization required for http://localhost:$HGPORT2/
196 196 [255]
197 197 $ hg id http://localhost:$HGPORT2/
198 198 abort: http authorization required for http://localhost:$HGPORT2/
199 199 [255]
200 200 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
201 201 http authorization required for http://localhost:$HGPORT2/
202 202 realm: mercurial
203 203 user: user
204 204 password: 5fed3813f7f5
205 205 $ hg id http://user:pass@localhost:$HGPORT2/
206 206 5fed3813f7f5
207 207 $ echo '[auth]' >> .hg/hgrc
208 208 $ echo 'l.schemes=http' >> .hg/hgrc
209 209 $ echo 'l.prefix=lo' >> .hg/hgrc
210 210 $ echo 'l.username=user' >> .hg/hgrc
211 211 $ echo 'l.password=pass' >> .hg/hgrc
212 212 $ hg id http://localhost:$HGPORT2/
213 213 5fed3813f7f5
214 214 $ hg id http://localhost:$HGPORT2/
215 215 5fed3813f7f5
216 216 $ hg id http://user@localhost:$HGPORT2/
217 217 5fed3813f7f5
218 218
219 219 #if no-reposimplestore
220 220 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
221 221 streaming all changes
222 222 7 files to transfer, 916 bytes of data
223 223 transferred * bytes in * seconds (*/sec) (glob)
224 224 searching for changes
225 225 no changes found
226 226 updating to branch default
227 227 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 228 #endif
229 229
230 230 --pull should override server's preferuncompressed
231 231 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
232 232 requesting all changes
233 233 adding changesets
234 234 adding manifests
235 235 adding file changes
236 236 added 2 changesets with 5 changes to 5 files
237 237 new changesets 8b6053c928fe:5fed3813f7f5
238 238 updating to branch default
239 239 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 240
241 241 $ hg id http://user2@localhost:$HGPORT2/
242 242 abort: http authorization required for http://localhost:$HGPORT2/
243 243 [255]
244 244 $ hg id http://user:pass2@localhost:$HGPORT2/
245 245 abort: HTTP Error 403: no
246 246 [255]
247 247
248 248 $ hg -R dest-pull tag -r tip top
249 249 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
250 250 pushing to http://user:***@localhost:$HGPORT2/
251 251 searching for changes
252 252 remote: adding changesets
253 253 remote: adding manifests
254 254 remote: adding file changes
255 255 remote: added 1 changesets with 1 changes to 1 files
256 256 $ hg rollback -q
257 257 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
258 258 pushing to http://user:***@localhost:$HGPORT2/
259 259 using http://localhost:$HGPORT2/
260 260 http auth: user user, password ****
261 261 sending capabilities command
262 262 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
263 263 http auth: user user, password ****
264 264 devel-peer-request: finished in *.???? seconds (200) (glob)
265 265 query 1; heads
266 266 devel-peer-request: batched-content
267 267 devel-peer-request: - heads (0 arguments)
268 268 devel-peer-request: - known (1 arguments)
269 269 sending batch command
270 270 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
271 271 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
272 272 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
273 273 devel-peer-request: 68 bytes of commands arguments in headers
274 274 devel-peer-request: finished in *.???? seconds (200) (glob)
275 275 searching for changes
276 276 all remote heads known locally
277 277 preparing listkeys for "phases"
278 278 sending listkeys command
279 279 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
280 280 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
281 281 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
282 282 devel-peer-request: 16 bytes of commands arguments in headers
283 283 devel-peer-request: finished in *.???? seconds (200) (glob)
284 284 received listkey for "phases": 58 bytes
285 285 checking for updated bookmarks
286 286 preparing listkeys for "bookmarks"
287 287 sending listkeys command
288 288 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
289 289 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
290 290 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
291 291 devel-peer-request: 19 bytes of commands arguments in headers
292 292 devel-peer-request: finished in *.???? seconds (200) (glob)
293 293 received listkey for "bookmarks": 0 bytes
294 294 sending branchmap command
295 295 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
296 296 devel-peer-request: Vary X-HgProto-1
297 297 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
298 298 devel-peer-request: finished in *.???? seconds (200) (glob)
299 299 sending branchmap command
300 300 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
301 301 devel-peer-request: Vary X-HgProto-1
302 302 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
303 303 devel-peer-request: finished in *.???? seconds (200) (glob)
304 304 preparing listkeys for "bookmarks"
305 305 sending listkeys command
306 306 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
307 307 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
308 308 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
309 309 devel-peer-request: 19 bytes of commands arguments in headers
310 310 devel-peer-request: finished in *.???? seconds (200) (glob)
311 311 received listkey for "bookmarks": 0 bytes
312 312 1 changesets found
313 313 list of changesets:
314 314 7f4e523d01f2cc3765ac8934da3d14db775ff872
315 315 bundle2-output-bundle: "HG20", 5 parts total
316 316 bundle2-output-part: "replycaps" 205 bytes payload
317 317 bundle2-output-part: "check:phases" 24 bytes payload
318 318 bundle2-output-part: "check:heads" streamed payload
319 319 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
320 320 bundle2-output-part: "phase-heads" 24 bytes payload
321 321 sending unbundle command
322 322 sending 1013 bytes
323 323 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
324 324 devel-peer-request: Content-length 1013
325 325 devel-peer-request: Content-type application/mercurial-0.1
326 326 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
327 327 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
328 328 devel-peer-request: 16 bytes of commands arguments in headers
329 329 devel-peer-request: 1013 bytes of data
330 330 devel-peer-request: finished in *.???? seconds (200) (glob)
331 331 bundle2-input-bundle: no-transaction
332 332 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
333 333 bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
334 334 bundle2-input-part: total payload size 100
335 335 remote: adding changesets
336 336 remote: adding manifests
337 337 remote: adding file changes
338 338 remote: added 1 changesets with 1 changes to 1 files
339 339 bundle2-input-part: "output" (advisory) supported
340 340 bundle2-input-bundle: 2 parts total
341 341 preparing listkeys for "phases"
342 342 sending listkeys command
343 343 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
344 344 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
345 345 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
346 346 devel-peer-request: 16 bytes of commands arguments in headers
347 347 devel-peer-request: finished in *.???? seconds (200) (glob)
348 348 received listkey for "phases": 15 bytes
349 349 $ hg rollback -q
350 350
351 351 $ sed 's/.*] "/"/' < ../access.log
352 352 "GET /?cmd=capabilities HTTP/1.1" 401 -
353 353 "GET /?cmd=capabilities HTTP/1.1" 401 -
354 354 "GET /?cmd=capabilities HTTP/1.1" 401 -
355 355 "GET /?cmd=capabilities HTTP/1.1" 200 -
356 356 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
357 357 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
358 358 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
359 359 "GET /?cmd=capabilities HTTP/1.1" 401 -
360 360 "GET /?cmd=capabilities HTTP/1.1" 200 -
361 361 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
362 362 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
363 363 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
364 364 "GET /?cmd=capabilities HTTP/1.1" 401 -
365 365 "GET /?cmd=capabilities HTTP/1.1" 200 -
366 366 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
367 367 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
368 368 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
369 369 "GET /?cmd=capabilities HTTP/1.1" 401 -
370 370 "GET /?cmd=capabilities HTTP/1.1" 200 -
371 371 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
372 372 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
373 373 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
374 374 "GET /?cmd=capabilities HTTP/1.1" 401 -
375 375 "GET /?cmd=capabilities HTTP/1.1" 200 -
376 376 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
377 377 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
378 378 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
379 379 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
380 380 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
381 381 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (no-reposimplestore !)
382 382 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (no-reposimplestore !)
383 383 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (no-reposimplestore !)
384 384 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (no-reposimplestore !)
385 385 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
386 386 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
387 387 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
388 388 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
389 389 "GET /?cmd=capabilities HTTP/1.1" 401 -
390 390 "GET /?cmd=capabilities HTTP/1.1" 401 -
391 391 "GET /?cmd=capabilities HTTP/1.1" 403 -
392 392 "GET /?cmd=capabilities HTTP/1.1" 401 -
393 393 "GET /?cmd=capabilities HTTP/1.1" 200 -
394 394 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
395 395 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
396 396 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
397 397 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
398 398 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
399 399 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
400 400 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
401 401 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
402 402 "GET /?cmd=capabilities HTTP/1.1" 401 -
403 403 "GET /?cmd=capabilities HTTP/1.1" 200 -
404 404 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
405 405 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
406 406 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
407 407 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
408 408 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
409 409 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
410 410 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
411 411 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
412 412
413 413 $ cd ..
414 414
415 415 clone of serve with repo in root and unserved subrepo (issue2970)
416 416
417 417 $ hg --cwd test init sub
418 418 $ echo empty > test/sub/empty
419 419 $ hg --cwd test/sub add empty
420 420 $ hg --cwd test/sub commit -qm 'add empty'
421 421 $ hg --cwd test/sub tag -r 0 something
422 422 $ echo sub = sub > test/.hgsub
423 423 $ hg --cwd test add .hgsub
424 424 $ hg --cwd test commit -qm 'add subrepo'
425 425 $ hg clone http://localhost:$HGPORT noslash-clone
426 426 requesting all changes
427 427 adding changesets
428 428 adding manifests
429 429 adding file changes
430 430 added 3 changesets with 7 changes to 7 files
431 431 new changesets 8b6053c928fe:56f9bc90cce6
432 432 updating to branch default
433 433 abort: HTTP Error 404: Not Found
434 434 [255]
435 435 $ hg clone http://localhost:$HGPORT/ slash-clone
436 436 requesting all changes
437 437 adding changesets
438 438 adding manifests
439 439 adding file changes
440 440 added 3 changesets with 7 changes to 7 files
441 441 new changesets 8b6053c928fe:56f9bc90cce6
442 442 updating to branch default
443 443 abort: HTTP Error 404: Not Found
444 444 [255]
445 445
446 446 check error log
447 447
448 448 $ cat error.log
449 449
450 450 check abort error reporting while pulling/cloning
451 451
452 452 $ $RUNTESTDIR/killdaemons.py
453 453 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
454 454 $ cat hg3.pid >> $DAEMON_PIDS
455 455 $ hg clone http://localhost:$HGPORT/ abort-clone
456 456 requesting all changes
457 457 remote: abort: this is an exercise
458 458 abort: pull failed on remote
459 459 [255]
460 460 $ cat error.log
461 461
462 462 disable pull-based clones
463 463
464 464 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
465 465 $ cat hg4.pid >> $DAEMON_PIDS
466 466 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
467 467 requesting all changes
468 468 remote: abort: server has pull-based clones disabled
469 469 abort: pull failed on remote
470 470 (remove --pull if specified or upgrade Mercurial)
471 471 [255]
472 472
473 #if no-reposimplestore
473 474 ... but keep stream clones working
474 475
475 476 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
476 477 streaming all changes
477 478 * files to transfer, * of data (glob)
478 479 transferred * in * seconds (*/sec) (glob)
479 480 searching for changes
480 481 no changes found
481 482 $ cat error.log
483 #endif
482 484
483 485 ... and also keep partial clones and pulls working
484 486 $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone
485 487 adding changesets
486 488 adding manifests
487 489 adding file changes
488 490 added 1 changesets with 4 changes to 4 files
489 491 new changesets 8b6053c928fe
490 492 updating to branch default
491 493 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
492 494 $ hg pull -R test-partial-clone
493 495 pulling from http://localhost:$HGPORT1/
494 496 searching for changes
495 497 adding changesets
496 498 adding manifests
497 499 adding file changes
498 500 added 2 changesets with 3 changes to 3 files
499 501 new changesets 5fed3813f7f5:56f9bc90cce6
500 502 (run 'hg update' to get a working copy)
501 503
502 504 corrupt cookies file should yield a warning
503 505
504 506 $ cat > $TESTTMP/cookies.txt << EOF
505 507 > bad format
506 508 > EOF
507 509
508 510 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
509 511 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
510 512 56f9bc90cce6
511 513
512 514 $ killdaemons.py
513 515
514 516 Create dummy authentication handler that looks for cookies. It doesn't do anything
515 517 useful. It just raises an HTTP 500 with details about the Cookie request header.
516 518 We raise HTTP 500 because its message is printed in the abort message.
517 519
518 520 $ cat > cookieauth.py << EOF
519 521 > from mercurial import util
520 522 > from mercurial.hgweb import common
521 523 > def perform_authentication(hgweb, req, op):
522 524 > cookie = req.headers.get('Cookie')
523 525 > if not cookie:
524 526 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie')
525 527 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie)
526 528 > def extsetup():
527 529 > common.permhooks.insert(0, perform_authentication)
528 530 > EOF
529 531
530 532 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
531 533 $ cat pid > $DAEMON_PIDS
532 534
533 535 Request without cookie sent should fail due to lack of cookie
534 536
535 537 $ hg id http://localhost:$HGPORT
536 538 abort: HTTP Error 500: no-cookie
537 539 [255]
538 540
539 541 Populate a cookies file
540 542
541 543 $ cat > cookies.txt << EOF
542 544 > # HTTP Cookie File
543 545 > # Expiration is 2030-01-01 at midnight
544 546 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
545 547 > EOF
546 548
547 549 Should not send a cookie for another domain
548 550
549 551 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
550 552 abort: HTTP Error 500: no-cookie
551 553 [255]
552 554
553 555 Add a cookie entry for our test server and verify it is sent
554 556
555 557 $ cat >> cookies.txt << EOF
556 558 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
557 559 > EOF
558 560
559 561 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
560 562 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
561 563 [255]
@@ -1,160 +1,172 b''
1 1 #require unix-permissions
2 2
3 3 test that new files created in .hg inherit the permissions from .hg/store
4 4
5 5 $ mkdir dir
6 6
7 7 just in case somebody has a strange $TMPDIR
8 8
9 9 $ chmod g-s dir
10 10 $ cd dir
11 11
12 12 $ cat >printmodes.py <<EOF
13 13 > from __future__ import absolute_import, print_function
14 14 > import os
15 15 > import sys
16 16 >
17 17 > allnames = []
18 18 > isdir = {}
19 19 > for root, dirs, files in os.walk(sys.argv[1]):
20 20 > for d in dirs:
21 21 > name = os.path.join(root, d)
22 22 > isdir[name] = 1
23 23 > allnames.append(name)
24 24 > for f in files:
25 25 > name = os.path.join(root, f)
26 26 > allnames.append(name)
27 27 > allnames.sort()
28 28 > for name in allnames:
29 29 > suffix = name in isdir and '/' or ''
30 30 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
31 31 > EOF
32 32
33 33 $ cat >mode.py <<EOF
34 34 > from __future__ import absolute_import, print_function
35 35 > import os
36 36 > import sys
37 37 > print('%05o' % os.lstat(sys.argv[1]).st_mode)
38 38 > EOF
39 39
40 40 $ umask 077
41 41
42 42 $ hg init repo
43 43 $ cd repo
44 44
45 45 $ chmod 0770 .hg/store
46 46
47 47 before commit
48 48 store can be written by the group, other files cannot
49 49 store is setgid
50 50
51 51 $ $PYTHON ../printmodes.py .
52 52 00700 ./.hg/
53 53 00600 ./.hg/00changelog.i
54 54 00600 ./.hg/requires
55 55 00770 ./.hg/store/
56 56
57 57 $ mkdir dir
58 58 $ touch foo dir/bar
59 59 $ hg ci -qAm 'add files'
60 60
61 61 after commit
62 62 working dir files can only be written by the owner
63 63 files created in .hg can be written by the group
64 64 (in particular, store/**, dirstate, branch cache file, undo files)
65 65 new directories are setgid
66 66
67 67 $ $PYTHON ../printmodes.py .
68 68 00700 ./.hg/
69 69 00600 ./.hg/00changelog.i
70 70 00770 ./.hg/cache/
71 71 00660 ./.hg/cache/branch2-served
72 72 00660 ./.hg/cache/rbc-names-v1
73 73 00660 ./.hg/cache/rbc-revs-v1
74 74 00660 ./.hg/dirstate
75 75 00660 ./.hg/fsmonitor.state (fsmonitor !)
76 76 00660 ./.hg/last-message.txt
77 77 00600 ./.hg/requires
78 78 00770 ./.hg/store/
79 79 00660 ./.hg/store/00changelog.i
80 80 00660 ./.hg/store/00manifest.i
81 81 00770 ./.hg/store/data/
82 82 00770 ./.hg/store/data/dir/
83 00660 ./.hg/store/data/dir/bar.i
84 00660 ./.hg/store/data/foo.i
83 00660 ./.hg/store/data/dir/bar.i (reporevlogstore !)
84 00660 ./.hg/store/data/foo.i (reporevlogstore !)
85 00770 ./.hg/store/data/dir/bar/ (reposimplestore !)
86 00660 ./.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
87 00660 ./.hg/store/data/dir/bar/index (reposimplestore !)
88 00770 ./.hg/store/data/foo/ (reposimplestore !)
89 00660 ./.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
90 00660 ./.hg/store/data/foo/index (reposimplestore !)
85 91 00660 ./.hg/store/fncache (repofncache !)
86 92 00660 ./.hg/store/phaseroots
87 93 00660 ./.hg/store/undo
88 94 00660 ./.hg/store/undo.backupfiles
89 95 00660 ./.hg/store/undo.phaseroots
90 96 00660 ./.hg/undo.backup.dirstate
91 97 00660 ./.hg/undo.bookmarks
92 98 00660 ./.hg/undo.branch
93 99 00660 ./.hg/undo.desc
94 100 00660 ./.hg/undo.dirstate
95 101 00700 ./dir/
96 102 00600 ./dir/bar
97 103 00600 ./foo
98 104
99 105 $ umask 007
100 106 $ hg init ../push
101 107
102 108 before push
103 109 group can write everything
104 110
105 111 $ $PYTHON ../printmodes.py ../push
106 112 00770 ../push/.hg/
107 113 00660 ../push/.hg/00changelog.i
108 114 00660 ../push/.hg/requires
109 115 00770 ../push/.hg/store/
110 116
111 117 $ umask 077
112 118 $ hg -q push ../push
113 119
114 120 after push
115 121 group can still write everything
116 122
117 123 $ $PYTHON ../printmodes.py ../push
118 124 00770 ../push/.hg/
119 125 00660 ../push/.hg/00changelog.i
120 126 00770 ../push/.hg/cache/
121 127 00660 ../push/.hg/cache/branch2-base
122 128 00660 ../push/.hg/dirstate
123 129 00660 ../push/.hg/requires
124 130 00770 ../push/.hg/store/
125 131 00660 ../push/.hg/store/00changelog.i
126 132 00660 ../push/.hg/store/00manifest.i
127 133 00770 ../push/.hg/store/data/
128 134 00770 ../push/.hg/store/data/dir/
129 00660 ../push/.hg/store/data/dir/bar.i
130 00660 ../push/.hg/store/data/foo.i
135 00660 ../push/.hg/store/data/dir/bar.i (reporevlogstore !)
136 00660 ../push/.hg/store/data/foo.i (reporevlogstore !)
137 00770 ../push/.hg/store/data/dir/bar/ (reposimplestore !)
138 00660 ../push/.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
139 00660 ../push/.hg/store/data/dir/bar/index (reposimplestore !)
140 00770 ../push/.hg/store/data/foo/ (reposimplestore !)
141 00660 ../push/.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
142 00660 ../push/.hg/store/data/foo/index (reposimplestore !)
131 143 00660 ../push/.hg/store/fncache (repofncache !)
132 144 00660 ../push/.hg/store/undo
133 145 00660 ../push/.hg/store/undo.backupfiles
134 146 00660 ../push/.hg/store/undo.phaseroots
135 147 00660 ../push/.hg/undo.bookmarks
136 148 00660 ../push/.hg/undo.branch
137 149 00660 ../push/.hg/undo.desc
138 150 00660 ../push/.hg/undo.dirstate
139 151
140 152
141 153 Test that we don't lose the setgid bit when we call chmod.
142 154 Not all systems support setgid directories (e.g. HFS+), so
143 155 just check that directories have the same mode.
144 156
145 157 $ cd ..
146 158 $ hg init setgid
147 159 $ cd setgid
148 160 $ chmod g+rwx .hg/store
149 161 $ chmod g+s .hg/store 2> /dev/null || true
150 162 $ mkdir dir
151 163 $ touch dir/file
152 164 $ hg ci -qAm 'add dir/file'
153 165 $ storemode=`$PYTHON ../mode.py .hg/store`
154 166 $ dirmode=`$PYTHON ../mode.py .hg/store/data/dir`
155 167 $ if [ "$storemode" != "$dirmode" ]; then
156 168 > echo "$storemode != $dirmode"
157 169 > fi
158 170 $ cd ..
159 171
160 172 $ cd .. # g-s dir
@@ -1,209 +1,210 b''
1 1
2 2 $ . "$TESTDIR/narrow-library.sh"
3 3
4 4 create full repo
5 5
6 6 $ hg init master
7 7 $ cd master
8 8 $ cat >> .hg/hgrc <<EOF
9 9 > [narrow]
10 10 > serveellipses=True
11 11 > EOF
12 12
13 13 $ mkdir inside
14 14 $ echo 1 > inside/f
15 15 $ mkdir inside2
16 16 $ echo 1 > inside2/f
17 17 $ mkdir outside
18 18 $ echo 1 > outside/f
19 19 $ hg ci -Aqm 'initial'
20 20
21 21 $ echo 2 > inside/f
22 22 $ hg ci -qm 'inside 2'
23 23
24 24 $ echo 2 > inside2/f
25 25 $ hg ci -qm 'inside2 2'
26 26
27 27 $ echo 2 > outside/f
28 28 $ hg ci -qm 'outside 2'
29 29
30 30 $ cd ..
31 31
32 32 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
33 33 requesting all changes
34 34 adding changesets
35 35 adding manifests
36 36 adding file changes
37 37 added 3 changesets with 2 changes to 1 files
38 38 new changesets *:* (glob)
39 39 updating to branch default
40 40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41 41
42 42 $ hg clone --narrow ssh://user@dummy/master narrow2 --include inside --include inside2
43 43 requesting all changes
44 44 adding changesets
45 45 adding manifests
46 46 adding file changes
47 47 added 4 changesets with 4 changes to 2 files
48 48 new changesets *:* (glob)
49 49 updating to branch default
50 50 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 51
52 52 Can push to wider repo if change does not affect paths in wider repo that are
53 53 not also in narrower repo
54 54
55 55 $ cd narrow
56 56 $ echo 3 > inside/f
57 57 $ hg ci -m 'inside 3'
58 58 $ hg push ssh://user@dummy/narrow2
59 59 pushing to ssh://user@dummy/narrow2
60 60 searching for changes
61 61 remote: adding changesets
62 62 remote: adding manifests
63 63 remote: adding file changes
64 64 remote: added 1 changesets with 1 changes to 1 files
65 65
66 66 Can push to narrower repo if change affects only paths within remote's
67 67 narrow spec
68 68
69 69 $ cd ../narrow2
70 70 $ cat >> .hg/hgrc <<EOF
71 71 > [narrow]
72 72 > serveellipses=True
73 73 > EOF
74 74 $ hg co -r 'desc("inside 3")'
75 75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 76 $ echo 4 > inside/f
77 77 $ hg ci -m 'inside 4'
78 78 $ hg push ssh://user@dummy/narrow
79 79 pushing to ssh://user@dummy/narrow
80 80 searching for changes
81 81 remote: adding changesets
82 82 remote: adding manifests
83 83 remote: adding file changes
84 84 remote: added 1 changesets with 1 changes to 1 files
85 85
86 86 Can push to narrow repo if change affects only paths outside remote's
87 87 narrow spec
88 88
89 89 $ echo 3 > inside2/f
90 90 $ hg ci -m 'inside2 3'
91 91 TODO: this should be successful
92 92 $ hg push ssh://user@dummy/narrow
93 93 pushing to ssh://user@dummy/narrow
94 94 searching for changes
95 95 remote: adding changesets
96 96 remote: adding manifests
97 97 remote: adding file changes
98 98 remote: transaction abort!
99 99 remote: rollback completed
100 remote: abort: data/inside2/f.i@4a1aa07735e6: unknown parent!
100 remote: abort: data/inside2/f.i@4a1aa07735e6: unknown parent! (reporevlogstore !)
101 remote: abort: data/inside2/f/index@4a1aa07735e6: no node! (reposimplestore !)
101 102 abort: stream ended unexpectedly (got 0 bytes, expected 4)
102 103 [255]
103 104
104 105 Can pull from wider repo if change affects only paths outside remote's
105 106 narrow spec
106 107 $ echo 4 > inside2/f
107 108 $ hg ci -m 'inside2 4'
108 109 $ hg log -G -T '{rev} {node|short} {files}\n'
109 110 @ 7 d78a96df731d inside2/f
110 111 |
111 112 o 6 8c26f5218962 inside2/f
112 113 |
113 114 o 5 ba3480e2f9de inside/f
114 115 |
115 116 o 4 4e5edd526618 inside/f
116 117 |
117 118 o 3 81e7e07b7ab0 outside/f
118 119 |
119 120 o 2 f3993b8c0c2b inside2/f
120 121 |
121 122 o 1 8cd66ca966b4 inside/f
122 123 |
123 124 o 0 c8057d6f53ab inside/f inside2/f outside/f
124 125
125 126 $ cd ../narrow
126 127 $ hg log -G -T '{rev} {node|short} {files}\n'
127 128 o 4 ba3480e2f9de inside/f
128 129 |
129 130 @ 3 4e5edd526618 inside/f
130 131 |
131 132 o 2 81e7e07b7ab0 outside/f
132 133 |
133 134 o 1 8cd66ca966b4 inside/f
134 135 |
135 136 o 0 c8057d6f53ab inside/f inside2/f outside/f
136 137
137 138 $ hg pull ssh://user@dummy/narrow2
138 139 pulling from ssh://user@dummy/narrow2
139 140 searching for changes
140 141 adding changesets
141 142 adding manifests
142 143 adding file changes
143 144 added 1 changesets with 0 changes to 0 files
144 145 new changesets d78a96df731d
145 146 (run 'hg update' to get a working copy)
146 147
147 148 Check that the resulting history is valid in the full repo
148 149
149 150 $ cd ../narrow2
150 151 $ hg push ssh://user@dummy/master
151 152 pushing to ssh://user@dummy/master
152 153 searching for changes
153 154 remote: adding changesets
154 155 remote: adding manifests
155 156 remote: adding file changes
156 157 remote: added 4 changesets with 4 changes to 2 files
157 158 $ cd ../master
158 159 $ hg verify
159 160 checking changesets
160 161 checking manifests
161 162 crosschecking files in changesets and manifests
162 163 checking files
163 164 3 files, 8 changesets, 10 total revisions
164 165
165 166 Can not push to wider repo if change affects paths in wider repo that are
166 167 not also in narrower repo
167 168 $ cd ../master
168 169 $ hg co -r 'desc("inside2 4")'
169 170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 171 $ echo 5 > inside2/f
171 172 $ hg ci -m 'inside2 5'
172 173 $ hg log -G -T '{rev} {node|short} {files}\n'
173 174 @ 8 5970befb64ba inside2/f
174 175 |
175 176 o 7 d78a96df731d inside2/f
176 177 |
177 178 o 6 8c26f5218962 inside2/f
178 179 |
179 180 o 5 ba3480e2f9de inside/f
180 181 |
181 182 o 4 4e5edd526618 inside/f
182 183 |
183 184 o 3 81e7e07b7ab0 outside/f
184 185 |
185 186 o 2 f3993b8c0c2b inside2/f
186 187 |
187 188 o 1 8cd66ca966b4 inside/f
188 189 |
189 190 o 0 c8057d6f53ab inside/f inside2/f outside/f
190 191
191 192 $ cd ../narrow
192 193 $ hg pull
193 194 pulling from ssh://user@dummy/master
194 195 searching for changes
195 196 adding changesets
196 197 adding manifests
197 198 adding file changes
198 199 added 1 changesets with 0 changes to 0 files
199 200 new changesets * (glob)
200 201 (run 'hg update' to get a working copy)
201 202 TODO: this should tell the user that their narrow clone does not have the
202 203 necessary content to be able to push to the target
203 204 $ hg push ssh://user@dummy/narrow2
204 205 pushing to ssh://user@dummy/narrow2
205 206 searching for changes
206 207 remote: adding changesets
207 208 remote: adding manifests
208 209 remote: adding file changes
209 210 remote: added 1 changesets with 0 changes to 0 files
@@ -1,435 +1,439 b''
1 1 $ . "$TESTDIR/narrow-library.sh"
2 2
3 3 initialize nested directories to validate complex include/exclude patterns
4 4
5 5 $ hg init master
6 6 $ cd master
7 7 $ cat >> .hg/hgrc <<EOF
8 8 > [narrow]
9 9 > serveellipses=True
10 10 > EOF
11 11
12 12 $ echo root > root
13 13 $ hg add root
14 14 $ hg commit -m 'add root'
15 15
16 16 $ for d in dir1 dir2 dir1/dirA dir1/dirB dir2/dirA dir2/dirB
17 17 > do
18 18 > mkdir -p $d
19 19 > echo $d/foo > $d/foo
20 20 > hg add $d/foo
21 21 > hg commit -m "add $d/foo"
22 22 > echo $d/bar > $d/bar
23 23 > hg add $d/bar
24 24 > hg commit -m "add $d/bar"
25 25 > done
26 26 #if execbit
27 27 $ chmod +x dir1/dirA/foo
28 28 $ hg commit -m "make dir1/dirA/foo executable"
29 29 #else
30 30 $ hg import --bypass - <<EOF
31 31 > # HG changeset patch
32 32 > make dir1/dirA/foo executable
33 33 >
34 34 > diff --git a/dir1/dirA/foo b/dir1/dirA/foo
35 35 > old mode 100644
36 36 > new mode 100755
37 37 > EOF
38 38 applying patch from stdin
39 39 $ hg update -qr tip
40 40 #endif
41 41 $ hg log -G -T '{rev} {node|short} {files}\n'
42 42 @ 13 c87ca422d521 dir1/dirA/foo
43 43 |
44 44 o 12 951b8a83924e dir2/dirB/bar
45 45 |
46 46 o 11 01ae5a51b563 dir2/dirB/foo
47 47 |
48 48 o 10 5eababdf0ac5 dir2/dirA/bar
49 49 |
50 50 o 9 99d690663739 dir2/dirA/foo
51 51 |
52 52 o 8 8e80155d5445 dir1/dirB/bar
53 53 |
54 54 o 7 406760310428 dir1/dirB/foo
55 55 |
56 56 o 6 623466a5f475 dir1/dirA/bar
57 57 |
58 58 o 5 06ff3a5be997 dir1/dirA/foo
59 59 |
60 60 o 4 33227af02764 dir2/bar
61 61 |
62 62 o 3 5e1f9d8d7c69 dir2/foo
63 63 |
64 64 o 2 594bc4b13d4a dir1/bar
65 65 |
66 66 o 1 47f480a08324 dir1/foo
67 67 |
68 68 o 0 2a4f0c3b67da root
69 69
70 70 $ cd ..
71 71
72 72 clone a narrow portion of the master, such that we can widen it later
73 73
74 74 $ hg clone --narrow ssh://user@dummy/master narrow \
75 75 > --include dir1 \
76 76 > --include dir2 \
77 77 > --exclude dir1/dirA \
78 78 > --exclude dir1/dirB \
79 79 > --exclude dir2/dirA \
80 80 > --exclude dir2/dirB
81 81 requesting all changes
82 82 adding changesets
83 83 adding manifests
84 84 adding file changes
85 85 added 6 changesets with 4 changes to 4 files
86 86 new changesets *:* (glob)
87 87 updating to branch default
88 88 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 89
90 90 $ cd narrow
91 91 $ cat .hg/narrowspec
92 92 [includes]
93 93 path:dir1
94 94 path:dir2
95 95 [excludes]
96 96 path:dir1/dirA
97 97 path:dir1/dirB
98 98 path:dir2/dirA
99 99 path:dir2/dirB
100 100 $ hg manifest -r tip
101 101 dir1/bar
102 102 dir1/dirA/bar
103 103 dir1/dirA/foo
104 104 dir1/dirB/bar
105 105 dir1/dirB/foo
106 106 dir1/foo
107 107 dir2/bar
108 108 dir2/dirA/bar
109 109 dir2/dirA/foo
110 110 dir2/dirB/bar
111 111 dir2/dirB/foo
112 112 dir2/foo
113 113 root
114 114 $ find * | sort
115 115 dir1
116 116 dir1/bar
117 117 dir1/foo
118 118 dir2
119 119 dir2/bar
120 120 dir2/foo
121 121 $ hg log -G -T '{rev} {node|short}{if(ellipsis, "...")} {files}\n'
122 122 @ 5 c87ca422d521... dir1/dirA/foo
123 123 |
124 124 o 4 33227af02764 dir2/bar
125 125 |
126 126 o 3 5e1f9d8d7c69 dir2/foo
127 127 |
128 128 o 2 594bc4b13d4a dir1/bar
129 129 |
130 130 o 1 47f480a08324 dir1/foo
131 131 |
132 132 o 0 2a4f0c3b67da... root
133 133
134 134
135 135 widen the narrow checkout
136 136
137 137 $ hg tracked --removeexclude dir1/dirA
138 138 comparing with ssh://user@dummy/master
139 139 searching for changes
140 140 no changes found
141 141 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
142 142 adding changesets
143 143 adding manifests
144 144 adding file changes
145 145 added 9 changesets with 6 changes to 6 files
146 146 new changesets *:* (glob)
147 147 $ cat .hg/narrowspec
148 148 [includes]
149 149 path:dir1
150 150 path:dir2
151 151 [excludes]
152 152 path:dir1/dirB
153 153 path:dir2/dirA
154 154 path:dir2/dirB
155 155 $ find * | sort
156 156 dir1
157 157 dir1/bar
158 158 dir1/dirA
159 159 dir1/dirA/bar
160 160 dir1/dirA/foo
161 161 dir1/foo
162 162 dir2
163 163 dir2/bar
164 164 dir2/foo
165 165
166 166 #if execbit
167 167 $ test -x dir1/dirA/foo && echo executable
168 168 executable
169 169 $ test -x dir1/dirA/bar || echo not executable
170 170 not executable
171 171 #endif
172 172
173 173 $ hg log -G -T '{rev} {node|short}{if(ellipsis, "...")} {files}\n'
174 174 @ 8 c87ca422d521 dir1/dirA/foo
175 175 |
176 176 o 7 951b8a83924e... dir2/dirB/bar
177 177 |
178 178 o 6 623466a5f475 dir1/dirA/bar
179 179 |
180 180 o 5 06ff3a5be997 dir1/dirA/foo
181 181 |
182 182 o 4 33227af02764 dir2/bar
183 183 |
184 184 o 3 5e1f9d8d7c69 dir2/foo
185 185 |
186 186 o 2 594bc4b13d4a dir1/bar
187 187 |
188 188 o 1 47f480a08324 dir1/foo
189 189 |
190 190 o 0 2a4f0c3b67da... root
191 191
192 192
193 193 widen narrow spec again, but exclude a file in previously included spec
194 194
195 195 $ hg tracked --removeexclude dir2/dirB --addexclude dir1/dirA/bar
196 196 comparing with ssh://user@dummy/master
197 197 searching for changes
198 198 looking for local changes to affected paths
199 deleting data/dir1/dirA/bar.i
199 deleting data/dir1/dirA/bar.i (reporevlogstore !)
200 deleting data/dir1/dirA/bar/0eca1d0cbdaea4651d1d04d71976a6d2d9bfaae5 (reposimplestore !)
201 deleting data/dir1/dirA/bar/index (reposimplestore !)
200 202 no changes found
201 203 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
202 204 adding changesets
203 205 adding manifests
204 206 adding file changes
205 207 added 11 changesets with 7 changes to 7 files
206 208 new changesets *:* (glob)
207 209 $ cat .hg/narrowspec
208 210 [includes]
209 211 path:dir1
210 212 path:dir2
211 213 [excludes]
212 214 path:dir1/dirA/bar
213 215 path:dir1/dirB
214 216 path:dir2/dirA
215 217 $ find * | sort
216 218 dir1
217 219 dir1/bar
218 220 dir1/dirA
219 221 dir1/dirA/foo
220 222 dir1/foo
221 223 dir2
222 224 dir2/bar
223 225 dir2/dirB
224 226 dir2/dirB/bar
225 227 dir2/dirB/foo
226 228 dir2/foo
227 229 $ hg log -G -T '{rev} {node|short}{if(ellipsis, "...")} {files}\n'
228 230 @ 10 c87ca422d521 dir1/dirA/foo
229 231 |
230 232 o 9 951b8a83924e dir2/dirB/bar
231 233 |
232 234 o 8 01ae5a51b563 dir2/dirB/foo
233 235 |
234 236 o 7 5eababdf0ac5... dir2/dirA/bar
235 237 |
236 238 o 6 623466a5f475... dir1/dirA/bar
237 239 |
238 240 o 5 06ff3a5be997 dir1/dirA/foo
239 241 |
240 242 o 4 33227af02764 dir2/bar
241 243 |
242 244 o 3 5e1f9d8d7c69 dir2/foo
243 245 |
244 246 o 2 594bc4b13d4a dir1/bar
245 247 |
246 248 o 1 47f480a08324 dir1/foo
247 249 |
248 250 o 0 2a4f0c3b67da... root
249 251
250 252
251 253 widen narrow spec yet again, excluding a directory in previous spec
252 254
253 255 $ hg tracked --removeexclude dir2/dirA --addexclude dir1/dirA
254 256 comparing with ssh://user@dummy/master
255 257 searching for changes
256 258 looking for local changes to affected paths
257 deleting data/dir1/dirA/foo.i
259 deleting data/dir1/dirA/foo.i (reporevlogstore !)
260 deleting data/dir1/dirA/foo/162caeb3d55dceb1fee793aa631ac8c73fcb8b5e (reposimplestore !)
261 deleting data/dir1/dirA/foo/index (reposimplestore !)
258 262 no changes found
259 263 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
260 264 adding changesets
261 265 adding manifests
262 266 adding file changes
263 267 added 13 changesets with 8 changes to 8 files
264 268 new changesets *:* (glob)
265 269 $ cat .hg/narrowspec
266 270 [includes]
267 271 path:dir1
268 272 path:dir2
269 273 [excludes]
270 274 path:dir1/dirA
271 275 path:dir1/dirA/bar
272 276 path:dir1/dirB
273 277 $ find * | sort
274 278 dir1
275 279 dir1/bar
276 280 dir1/foo
277 281 dir2
278 282 dir2/bar
279 283 dir2/dirA
280 284 dir2/dirA/bar
281 285 dir2/dirA/foo
282 286 dir2/dirB
283 287 dir2/dirB/bar
284 288 dir2/dirB/foo
285 289 dir2/foo
286 290 $ hg log -G -T '{rev} {node|short}{if(ellipsis, "...")} {files}\n'
287 291 @ 12 c87ca422d521... dir1/dirA/foo
288 292 |
289 293 o 11 951b8a83924e dir2/dirB/bar
290 294 |
291 295 o 10 01ae5a51b563 dir2/dirB/foo
292 296 |
293 297 o 9 5eababdf0ac5 dir2/dirA/bar
294 298 |
295 299 o 8 99d690663739 dir2/dirA/foo
296 300 |
297 301 o 7 8e80155d5445... dir1/dirB/bar
298 302 |
299 303 o 6 623466a5f475... dir1/dirA/bar
300 304 |
301 305 o 5 06ff3a5be997... dir1/dirA/foo
302 306 |
303 307 o 4 33227af02764 dir2/bar
304 308 |
305 309 o 3 5e1f9d8d7c69 dir2/foo
306 310 |
307 311 o 2 594bc4b13d4a dir1/bar
308 312 |
309 313 o 1 47f480a08324 dir1/foo
310 314 |
311 315 o 0 2a4f0c3b67da... root
312 316
313 317
314 318 include a directory that was previously explicitly excluded
315 319
316 320 $ hg tracked --removeexclude dir1/dirA
317 321 comparing with ssh://user@dummy/master
318 322 searching for changes
319 323 no changes found
320 324 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
321 325 adding changesets
322 326 adding manifests
323 327 adding file changes
324 328 added 13 changesets with 9 changes to 9 files
325 329 new changesets *:* (glob)
326 330 $ cat .hg/narrowspec
327 331 [includes]
328 332 path:dir1
329 333 path:dir2
330 334 [excludes]
331 335 path:dir1/dirA/bar
332 336 path:dir1/dirB
333 337 $ find * | sort
334 338 dir1
335 339 dir1/bar
336 340 dir1/dirA
337 341 dir1/dirA/foo
338 342 dir1/foo
339 343 dir2
340 344 dir2/bar
341 345 dir2/dirA
342 346 dir2/dirA/bar
343 347 dir2/dirA/foo
344 348 dir2/dirB
345 349 dir2/dirB/bar
346 350 dir2/dirB/foo
347 351 dir2/foo
348 352 $ hg log -G -T '{rev} {node|short}{if(ellipsis, "...")} {files}\n'
349 353 @ 12 c87ca422d521 dir1/dirA/foo
350 354 |
351 355 o 11 951b8a83924e dir2/dirB/bar
352 356 |
353 357 o 10 01ae5a51b563 dir2/dirB/foo
354 358 |
355 359 o 9 5eababdf0ac5 dir2/dirA/bar
356 360 |
357 361 o 8 99d690663739 dir2/dirA/foo
358 362 |
359 363 o 7 8e80155d5445... dir1/dirB/bar
360 364 |
361 365 o 6 623466a5f475... dir1/dirA/bar
362 366 |
363 367 o 5 06ff3a5be997 dir1/dirA/foo
364 368 |
365 369 o 4 33227af02764 dir2/bar
366 370 |
367 371 o 3 5e1f9d8d7c69 dir2/foo
368 372 |
369 373 o 2 594bc4b13d4a dir1/bar
370 374 |
371 375 o 1 47f480a08324 dir1/foo
372 376 |
373 377 o 0 2a4f0c3b67da... root
374 378
375 379
376 380 $ cd ..
377 381
378 382 clone a narrow portion of the master, such that we can widen it later
379 383
380 384 $ hg clone --narrow ssh://user@dummy/master narrow2 --include dir1/dirA
381 385 requesting all changes
382 386 adding changesets
383 387 adding manifests
384 388 adding file changes
385 389 added 5 changesets with 2 changes to 2 files
386 390 new changesets *:* (glob)
387 391 updating to branch default
388 392 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 393 $ cd narrow2
390 394 $ find * | sort
391 395 dir1
392 396 dir1/dirA
393 397 dir1/dirA/bar
394 398 dir1/dirA/foo
395 399 $ hg tracked --addinclude dir1
396 400 comparing with ssh://user@dummy/master
397 401 searching for changes
398 402 no changes found
399 403 saved backup bundle to $TESTTMP/narrow2/.hg/strip-backup/*-widen.hg (glob)
400 404 adding changesets
401 405 adding manifests
402 406 adding file changes
403 407 added 10 changesets with 6 changes to 6 files
404 408 new changesets *:* (glob)
405 409 $ find * | sort
406 410 dir1
407 411 dir1/bar
408 412 dir1/dirA
409 413 dir1/dirA/bar
410 414 dir1/dirA/foo
411 415 dir1/dirB
412 416 dir1/dirB/bar
413 417 dir1/dirB/foo
414 418 dir1/foo
415 419 $ hg log -G -T '{rev} {node|short}{if(ellipsis, "...")} {files}\n'
416 420 @ 9 c87ca422d521 dir1/dirA/foo
417 421 |
418 422 o 8 951b8a83924e... dir2/dirB/bar
419 423 |
420 424 o 7 8e80155d5445 dir1/dirB/bar
421 425 |
422 426 o 6 406760310428 dir1/dirB/foo
423 427 |
424 428 o 5 623466a5f475 dir1/dirA/bar
425 429 |
426 430 o 4 06ff3a5be997 dir1/dirA/foo
427 431 |
428 432 o 3 33227af02764... dir2/bar
429 433 |
430 434 o 2 594bc4b13d4a dir1/bar
431 435 |
432 436 o 1 47f480a08324 dir1/foo
433 437 |
434 438 o 0 2a4f0c3b67da... root
435 439
@@ -1,166 +1,166 b''
1 1 #testcases flat tree
2 2
3 3 $ . "$TESTDIR/narrow-library.sh"
4 4
5 5 #if tree
6 6 $ cat << EOF >> $HGRCPATH
7 7 > [experimental]
8 8 > treemanifest = 1
9 9 > EOF
10 10 #endif
11 11
12 12 create full repo
13 13
14 14 $ hg init master
15 15 $ cd master
16 16 $ cat >> .hg/hgrc <<EOF
17 17 > [narrow]
18 18 > serveellipses=True
19 19 > EOF
20 20
21 21 $ mkdir inside
22 22 $ echo inside > inside/f1
23 23 $ mkdir outside
24 24 $ echo outside > outside/f1
25 25 $ hg ci -Aqm 'initial'
26 26
27 27 $ echo modified > inside/f1
28 28 $ hg ci -qm 'modify inside'
29 29
30 30 $ hg co -q 0
31 31 $ echo modified > outside/f1
32 32 $ hg ci -qm 'modify outside'
33 33
34 34 $ echo modified again >> outside/f1
35 35 $ hg ci -qm 'modify outside again'
36 36
37 37 $ cd ..
38 38
39 39 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
40 40 requesting all changes
41 41 adding changesets
42 42 adding manifests
43 43 adding file changes
44 44 added 3 changesets with 2 changes to 1 files (+1 heads)
45 45 new changesets *:* (glob)
46 46 updating to branch default
47 47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 48 $ cd narrow
49 49 $ cat >> $HGRCPATH <<EOF
50 50 > [extensions]
51 51 > strip=
52 52 > EOF
53 53
54 54 Can strip and recover changesets affecting only files within narrow spec
55 55
56 56 $ hg co -r 'desc("modify inside")'
57 57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 58 $ rm -f .hg/strip-backup/*-backup.hg
59 59 $ hg strip .
60 60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 61 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob)
62 62 $ hg unbundle .hg/strip-backup/*-backup.hg
63 63 adding changesets
64 64 adding manifests
65 65 adding file changes
66 66 added 1 changesets with 1 changes to 1 files (+1 heads)
67 67 new changesets * (glob)
68 68 (run 'hg heads' to see heads, 'hg merge' to merge)
69 69
70 70 Can strip and recover changesets affecting files outside of narrow spec
71 71
72 72 $ hg co -r 'desc("modify outside")'
73 73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 74 $ hg log -G -T '{rev} {desc}\n'
75 75 o 2 modify inside
76 76 |
77 77 | @ 1 modify outside again
78 78 |/
79 79 o 0 initial
80 80
81 81 $ hg debugdata -m 1
82 82 inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !)
83 83 outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !)
84 84 inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !)
85 85 outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !)
86 86
87 87 $ rm -f .hg/strip-backup/*-backup.hg
88 88 $ hg strip .
89 89 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 90 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob)
91 91 $ hg unbundle .hg/strip-backup/*-backup.hg
92 92 adding changesets
93 93 adding manifests
94 94 adding file changes
95 95 added 1 changesets with 0 changes to 0 files (+1 heads)
96 96 new changesets * (glob)
97 97 (run 'hg heads' to see heads, 'hg merge' to merge)
98 98 $ hg log -G -T '{rev} {desc}\n'
99 99 o 2 modify outside again
100 100 |
101 101 | o 1 modify inside
102 102 |/
103 103 @ 0 initial
104 104
105 105 Check that hash of file outside narrow spec got restored
106 106 $ hg debugdata -m 2
107 107 inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !)
108 108 outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !)
109 109 inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !)
110 110 outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !)
111 111
112 112 Also verify we can apply the bundle with 'hg pull':
113 113 $ hg co -r 'desc("modify inside")'
114 114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 115 $ rm .hg/strip-backup/*-backup.hg
116 116 $ hg strip .
117 117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 118 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob)
119 #if repobundlerepo
119 120 $ hg pull .hg/strip-backup/*-backup.hg
120 121 pulling from .hg/strip-backup/*-backup.hg (glob)
121 122 searching for changes
122 123 adding changesets
123 124 adding manifests
124 125 adding file changes
125 126 added 1 changesets with 1 changes to 1 files (+1 heads)
126 127 new changesets * (glob)
127 128 (run 'hg heads' to see heads, 'hg merge' to merge)
128 129
129 130 $ rm .hg/strip-backup/*-backup.hg
130 131 $ hg strip 0
131 132 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
132 133 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob)
133 134
134 #if repobundlerepo
135 135 $ hg incoming .hg/strip-backup/*-backup.hg
136 136 comparing with .hg/strip-backup/*-backup.hg (glob)
137 137 changeset: 0:* (glob)
138 138 user: test
139 139 date: Thu Jan 01 00:00:00 1970 +0000
140 140 summary: initial
141 141
142 142 changeset: 1:9e48d953700d (flat !)
143 143 changeset: 1:3888164bccf0 (tree !)
144 144 user: test
145 145 date: Thu Jan 01 00:00:00 1970 +0000
146 146 summary: modify outside again
147 147
148 148 changeset: 2:f505d5e96aa8 (flat !)
149 149 changeset: 2:40b66f95a209 (tree !)
150 150 tag: tip
151 151 parent: 0:a99f4d53924d (flat !)
152 152 parent: 0:c2a5fabcca3c (tree !)
153 153 user: test
154 154 date: Thu Jan 01 00:00:00 1970 +0000
155 155 summary: modify inside
156 156
157 157 $ hg pull .hg/strip-backup/*-backup.hg
158 158 pulling from .hg/strip-backup/*-backup.hg (glob)
159 159 requesting all changes
160 160 adding changesets
161 161 adding manifests
162 162 adding file changes
163 163 added 3 changesets with 2 changes to 1 files (+1 heads)
164 164 new changesets *:* (glob)
165 165 (run 'hg heads' to see heads, 'hg merge' to merge)
166 166 #endif
@@ -1,1607 +1,1609 b''
1 1 $ cat >> $HGRCPATH << EOF
2 2 > [phases]
3 3 > # public changeset are not obsolete
4 4 > publish=false
5 5 > [ui]
6 6 > logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if(instabilities, ' {instabilities}')}) [{tags} {bookmarks}] {desc|firstline}{if(obsfate, " [{join(obsfate, "; ")}]")}\n"
7 7 > EOF
8 8 $ mkcommit() {
9 9 > echo "$1" > "$1"
10 10 > hg add "$1"
11 11 > hg ci -m "add $1"
12 12 > }
13 13 $ getid() {
14 14 > hg log -T "{node}\n" --hidden -r "desc('$1')"
15 15 > }
16 16
17 17 $ cat > debugkeys.py <<EOF
18 18 > def reposetup(ui, repo):
19 19 > class debugkeysrepo(repo.__class__):
20 20 > def listkeys(self, namespace):
21 21 > ui.write(b'listkeys %s\n' % (namespace,))
22 22 > return super(debugkeysrepo, self).listkeys(namespace)
23 23 >
24 24 > if repo.local():
25 25 > repo.__class__ = debugkeysrepo
26 26 > EOF
27 27
28 28 $ hg init tmpa
29 29 $ cd tmpa
30 30 $ mkcommit kill_me
31 31
32 32 Checking that the feature is properly disabled
33 33
34 34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
35 35 abort: creating obsolete markers is not enabled on this repo
36 36 [255]
37 37
38 38 Enabling it
39 39
40 40 $ cat >> $HGRCPATH << EOF
41 41 > [experimental]
42 42 > evolution=exchange
43 43 > evolution.createmarkers=True
44 44 > EOF
45 45
46 46 Killing a single changeset without replacement
47 47
48 48 $ hg debugobsolete 0
49 49 abort: changeset references must be full hexadecimal node identifiers
50 50 [255]
51 51 $ hg debugobsolete '00'
52 52 abort: changeset references must be full hexadecimal node identifiers
53 53 [255]
54 54 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
55 55 obsoleted 1 changesets
56 56 $ hg debugobsolete
57 57 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'}
58 58
59 59 (test that mercurial is not confused)
60 60
61 61 $ hg up null --quiet # having 0 as parent prevents it to be hidden
62 62 $ hg tip
63 63 -1:000000000000 (public) [tip ]
64 64 $ hg up --hidden tip --quiet
65 65 updating to a hidden changeset 97b7c2d76b18
66 66 (hidden revision '97b7c2d76b18' is pruned)
67 67
68 68 Killing a single changeset with itself should fail
69 69 (simple local safeguard)
70 70
71 71 $ hg debugobsolete `getid kill_me` `getid kill_me`
72 72 abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0
73 73 [255]
74 74
75 75 $ cd ..
76 76
77 77 Killing a single changeset with replacement
78 78 (and testing the format option)
79 79
80 80 $ hg init tmpb
81 81 $ cd tmpb
82 82 $ mkcommit a
83 83 $ mkcommit b
84 84 $ mkcommit original_c
85 85 $ hg up "desc('b')"
86 86 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
87 87 $ mkcommit new_c
88 88 created new head
89 89 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
90 90 $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120'
91 91 obsoleted 1 changesets
92 92 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
93 93 2:245bde4270cd add original_c
94 94 $ hg debugrevlog -cd
95 95 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
96 96 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
97 97 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
98 98 2 1 -1 118 193 118 118 59 0 76 192 0 1 0
99 99 3 1 -1 193 260 193 193 59 0 66 258 0 2 0
100 100 $ hg debugobsolete
101 101 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
102 102
103 103 (check for version number of the obsstore)
104 104
105 105 $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
106 106 \x00 (no-eol) (esc)
107 107
108 108 do it again (it read the obsstore before adding new changeset)
109 109
110 110 $ hg up '.^'
111 111 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
112 112 $ mkcommit new_2_c
113 113 created new head
114 114 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
115 115 obsoleted 1 changesets
116 116 $ hg debugobsolete
117 117 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
118 118 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
119 119
120 120 Register two markers with a missing node
121 121
122 122 $ hg up '.^'
123 123 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
124 124 $ mkcommit new_3_c
125 125 created new head
126 126 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
127 127 obsoleted 1 changesets
128 128 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
129 129 $ hg debugobsolete
130 130 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
131 131 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
132 132 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
133 133 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
134 134
135 135 Test the --index option of debugobsolete command
136 136 $ hg debugobsolete --index
137 137 0 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
138 138 1 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
139 139 2 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
140 140 3 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
141 141
142 142 Refuse pathological nullid successors
143 143 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
144 144 transaction abort!
145 145 rollback completed
146 146 abort: bad obsolescence marker detected: invalid successors nullid
147 147 [255]
148 148
149 149 Check that graphlog detect that a changeset is obsolete:
150 150
151 151 $ hg log -G
152 152 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
153 153 |
154 154 o 1:7c3bad9141dc (draft) [ ] add b
155 155 |
156 156 o 0:1f0dee641bb7 (draft) [ ] add a
157 157
158 158
159 159 check that heads does not report them
160 160
161 161 $ hg heads
162 162 5:5601fb93a350 (draft) [tip ] add new_3_c
163 163 $ hg heads --hidden
164 164 5:5601fb93a350 (draft) [tip ] add new_3_c
165 165 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c [rewritten as 5:5601fb93a350]
166 166 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c [rewritten as 4:ca819180edb9]
167 167 2:245bde4270cd (draft *obsolete*) [ ] add original_c [rewritten as 3:cdbce2fbb163]
168 168
169 169
170 170 check that summary does not report them
171 171
172 172 $ hg init ../sink
173 173 $ echo '[paths]' >> .hg/hgrc
174 174 $ echo 'default=../sink' >> .hg/hgrc
175 175 $ hg summary --remote
176 176 parent: 5:5601fb93a350 tip
177 177 add new_3_c
178 178 branch: default
179 179 commit: (clean)
180 180 update: (current)
181 181 phases: 3 draft
182 182 remote: 3 outgoing
183 183
184 184 $ hg summary --remote --hidden
185 185 parent: 5:5601fb93a350 tip
186 186 add new_3_c
187 187 branch: default
188 188 commit: (clean)
189 189 update: 3 new changesets, 4 branch heads (merge)
190 190 phases: 6 draft
191 191 remote: 3 outgoing
192 192
193 193 check that various commands work well with filtering
194 194
195 195 $ hg tip
196 196 5:5601fb93a350 (draft) [tip ] add new_3_c
197 197 $ hg log -r 6
198 198 abort: unknown revision '6'!
199 199 [255]
200 200 $ hg log -r 4
201 201 abort: hidden revision '4' was rewritten as: 5601fb93a350!
202 202 (use --hidden to access hidden revisions)
203 203 [255]
204 204 $ hg debugrevspec 'rev(6)'
205 205 $ hg debugrevspec 'rev(4)'
206 206 $ hg debugrevspec 'null'
207 207 -1
208 208
209 209 Check that public changeset are not accounted as obsolete:
210 210
211 211 $ hg --hidden phase --public 2
212 212 1 new phase-divergent changesets
213 213 $ hg log -G
214 214 @ 5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c
215 215 |
216 216 | o 2:245bde4270cd (public) [ ] add original_c
217 217 |/
218 218 o 1:7c3bad9141dc (public) [ ] add b
219 219 |
220 220 o 0:1f0dee641bb7 (public) [ ] add a
221 221
222 222
223 223 And that bumped changeset are detected
224 224 --------------------------------------
225 225
226 226 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
227 227 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
228 228 the public changeset
229 229
230 230 $ hg log --hidden -r 'phasedivergent()'
231 231 5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c
232 232
233 233 And that we can't push bumped changeset
234 234
235 235 $ hg push ../tmpa -r 0 --force #(make repo related)
236 236 pushing to ../tmpa
237 237 searching for changes
238 238 warning: repository is unrelated
239 239 adding changesets
240 240 adding manifests
241 241 adding file changes
242 242 added 1 changesets with 1 changes to 1 files (+1 heads)
243 243 $ hg push ../tmpa
244 244 pushing to ../tmpa
245 245 searching for changes
246 246 abort: push includes phase-divergent changeset: 5601fb93a350!
247 247 [255]
248 248
249 249 Fixing "bumped" situation
250 250 We need to create a clone of 5 and add a special marker with a flag
251 251
252 252 $ hg summary
253 253 parent: 5:5601fb93a350 tip (phase-divergent)
254 254 add new_3_c
255 255 branch: default
256 256 commit: (clean)
257 257 update: 1 new changesets, 2 branch heads (merge)
258 258 phases: 1 draft
259 259 phase-divergent: 1 changesets
260 260 $ hg up '5^'
261 261 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
262 262 $ hg revert -ar 5
263 263 adding new_3_c
264 264 $ hg ci -m 'add n3w_3_c'
265 265 created new head
266 266 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
267 267 obsoleted 1 changesets
268 268 $ hg log -r 'phasedivergent()'
269 269 $ hg log -G
270 270 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
271 271 |
272 272 | o 2:245bde4270cd (public) [ ] add original_c
273 273 |/
274 274 o 1:7c3bad9141dc (public) [ ] add b
275 275 |
276 276 o 0:1f0dee641bb7 (public) [ ] add a
277 277
278 278
279 279 Basic exclusive testing
280 280
281 281 $ hg log -G --hidden
282 282 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
283 283 |
284 284 | x 5:5601fb93a350 (draft *obsolete*) [ ] add new_3_c [rewritten as 6:6f9641995072]
285 285 |/
286 286 | x 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c [rewritten as 5:5601fb93a350]
287 287 |/
288 288 | x 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c [rewritten as 4:ca819180edb9]
289 289 |/
290 290 | o 2:245bde4270cd (public) [ ] add original_c
291 291 |/
292 292 o 1:7c3bad9141dc (public) [ ] add b
293 293 |
294 294 o 0:1f0dee641bb7 (public) [ ] add a
295 295
296 296 $ hg debugobsolete --rev 6f9641995072
297 297 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
298 298 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
299 299 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
300 300 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
301 301 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
302 302 $ hg debugobsolete --rev 6f9641995072 --exclusive
303 303 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
304 304 $ hg debugobsolete --rev 5601fb93a350 --hidden
305 305 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
306 306 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
307 307 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
308 308 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
309 309 $ hg debugobsolete --rev 5601fb93a350 --hidden --exclusive
310 310 $ hg debugobsolete --rev 5601fb93a350+6f9641995072 --hidden --exclusive
311 311 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
312 312 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
313 313 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
314 314
315 315 $ cd ..
316 316
317 317 Revision 0 is hidden
318 318 --------------------
319 319
320 320 $ hg init rev0hidden
321 321 $ cd rev0hidden
322 322
323 323 $ mkcommit kill0
324 324 $ hg up -q null
325 325 $ hg debugobsolete `getid kill0`
326 326 obsoleted 1 changesets
327 327 $ mkcommit a
328 328 $ mkcommit b
329 329
330 330 Should pick the first visible revision as "repo" node
331 331
332 332 $ hg archive ../archive-null
333 333 $ cat ../archive-null/.hg_archival.txt
334 334 repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e
335 335 node: 7c3bad9141dcb46ff89abf5f61856facd56e476c
336 336 branch: default
337 337 latesttag: null
338 338 latesttagdistance: 2
339 339 changessincelatesttag: 2
340 340
341 341
342 342 $ cd ..
343 343
344 344 Can disable transaction summary report
345 345
346 346 $ hg init transaction-summary
347 347 $ cd transaction-summary
348 348 $ mkcommit a
349 349 $ mkcommit b
350 350 $ hg up -q null
351 351 $ hg --config experimental.evolution.report-instabilities=false debugobsolete `getid a`
352 352 obsoleted 1 changesets
353 353 $ cd ..
354 354
355 355 Exchange Test
356 356 ============================
357 357
358 358 Destination repo does not have any data
359 359 ---------------------------------------
360 360
361 361 Simple incoming test
362 362
363 363 $ hg init tmpc
364 364 $ cd tmpc
365 365 $ hg incoming ../tmpb
366 366 comparing with ../tmpb
367 367 0:1f0dee641bb7 (public) [ ] add a
368 368 1:7c3bad9141dc (public) [ ] add b
369 369 2:245bde4270cd (public) [ ] add original_c
370 370 6:6f9641995072 (draft) [tip ] add n3w_3_c
371 371
372 372 Try to pull markers
373 373 (extinct changeset are excluded but marker are pushed)
374 374
375 375 $ hg pull ../tmpb
376 376 pulling from ../tmpb
377 377 requesting all changes
378 378 adding changesets
379 379 adding manifests
380 380 adding file changes
381 381 added 4 changesets with 4 changes to 4 files (+1 heads)
382 382 5 new obsolescence markers
383 383 new changesets 1f0dee641bb7:6f9641995072
384 384 (run 'hg heads' to see heads, 'hg merge' to merge)
385 385 $ hg debugobsolete
386 386 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
387 387 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
388 388 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
389 389 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
390 390 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
391 391
392 392 Rollback//Transaction support
393 393
394 394 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
395 395 $ hg debugobsolete
396 396 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
397 397 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
398 398 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
399 399 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
400 400 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
401 401 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'}
402 402 $ hg rollback -n
403 403 repository tip rolled back to revision 3 (undo debugobsolete)
404 404 $ hg rollback
405 405 repository tip rolled back to revision 3 (undo debugobsolete)
406 406 $ hg debugobsolete
407 407 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
408 408 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
409 409 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
410 410 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
411 411 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
412 412
413 413 $ cd ..
414 414
415 415 Try to push markers
416 416
417 417 $ hg init tmpd
418 418 $ hg -R tmpb push tmpd
419 419 pushing to tmpd
420 420 searching for changes
421 421 adding changesets
422 422 adding manifests
423 423 adding file changes
424 424 added 4 changesets with 4 changes to 4 files (+1 heads)
425 425 5 new obsolescence markers
426 426 $ hg -R tmpd debugobsolete | sort
427 427 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
428 428 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
429 429 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
430 430 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
431 431 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
432 432
433 433 Check obsolete keys are exchanged only if source has an obsolete store
434 434
435 435 $ hg init empty
436 436 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
437 437 pushing to tmpd
438 438 listkeys phases
439 439 listkeys bookmarks
440 440 no changes found
441 441 listkeys phases
442 442 [1]
443 443
444 444 clone support
445 445 (markers are copied and extinct changesets are included to allow hardlinks)
446 446
447 447 $ hg clone tmpb clone-dest
448 448 updating to branch default
449 449 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 450 $ hg -R clone-dest log -G --hidden
451 451 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
452 452 |
453 453 | x 5:5601fb93a350 (draft *obsolete*) [ ] add new_3_c [rewritten as 6:6f9641995072]
454 454 |/
455 455 | x 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c [rewritten as 5:5601fb93a350]
456 456 |/
457 457 | x 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c [rewritten as 4:ca819180edb9]
458 458 |/
459 459 | o 2:245bde4270cd (public) [ ] add original_c
460 460 |/
461 461 o 1:7c3bad9141dc (public) [ ] add b
462 462 |
463 463 o 0:1f0dee641bb7 (public) [ ] add a
464 464
465 465 $ hg -R clone-dest debugobsolete
466 466 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
467 467 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
468 468 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
469 469 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
470 470 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
471 471
472 472
473 473 Destination repo have existing data
474 474 ---------------------------------------
475 475
476 476 On pull
477 477
478 478 $ hg init tmpe
479 479 $ cd tmpe
480 480 $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00
481 481 $ hg pull ../tmpb
482 482 pulling from ../tmpb
483 483 requesting all changes
484 484 adding changesets
485 485 adding manifests
486 486 adding file changes
487 487 added 4 changesets with 4 changes to 4 files (+1 heads)
488 488 5 new obsolescence markers
489 489 new changesets 1f0dee641bb7:6f9641995072
490 490 (run 'hg heads' to see heads, 'hg merge' to merge)
491 491 $ hg debugobsolete
492 492 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
493 493 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
494 494 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
495 495 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
496 496 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
497 497 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
498 498
499 499
500 500 On push
501 501
502 502 $ hg push ../tmpc
503 503 pushing to ../tmpc
504 504 searching for changes
505 505 no changes found
506 506 1 new obsolescence markers
507 507 [1]
508 508 $ hg -R ../tmpc debugobsolete
509 509 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
510 510 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
511 511 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
512 512 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
513 513 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
514 514 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
515 515
516 516 detect outgoing obsolete and unstable
517 517 ---------------------------------------
518 518
519 519
520 520 $ hg log -G
521 521 o 3:6f9641995072 (draft) [tip ] add n3w_3_c
522 522 |
523 523 | o 2:245bde4270cd (public) [ ] add original_c
524 524 |/
525 525 o 1:7c3bad9141dc (public) [ ] add b
526 526 |
527 527 o 0:1f0dee641bb7 (public) [ ] add a
528 528
529 529 $ hg up 'desc("n3w_3_c")'
530 530 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
531 531 $ mkcommit original_d
532 532 $ mkcommit original_e
533 533 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
534 534 obsoleted 1 changesets
535 535 1 new orphan changesets
536 536 $ hg debugobsolete | grep `getid original_d`
537 537 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
538 538 $ hg log -r 'obsolete()'
539 539 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
540 540 $ hg summary
541 541 parent: 5:cda648ca50f5 tip (orphan)
542 542 add original_e
543 543 branch: default
544 544 commit: (clean)
545 545 update: 1 new changesets, 2 branch heads (merge)
546 546 phases: 3 draft
547 547 orphan: 1 changesets
548 548 $ hg log -G -r '::orphan()'
549 549 @ 5:cda648ca50f5 (draft orphan) [tip ] add original_e
550 550 |
551 551 x 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
552 552 |
553 553 o 3:6f9641995072 (draft) [ ] add n3w_3_c
554 554 |
555 555 o 1:7c3bad9141dc (public) [ ] add b
556 556 |
557 557 o 0:1f0dee641bb7 (public) [ ] add a
558 558
559 559
560 560 refuse to push obsolete changeset
561 561
562 562 $ hg push ../tmpc/ -r 'desc("original_d")'
563 563 pushing to ../tmpc/
564 564 searching for changes
565 565 abort: push includes obsolete changeset: 94b33453f93b!
566 566 [255]
567 567
568 568 refuse to push unstable changeset
569 569
570 570 $ hg push ../tmpc/
571 571 pushing to ../tmpc/
572 572 searching for changes
573 573 abort: push includes orphan changeset: cda648ca50f5!
574 574 [255]
575 575
576 576 Test that extinct changeset are properly detected
577 577
578 578 $ hg log -r 'extinct()'
579 579
580 580 Don't try to push extinct changeset
581 581
582 582 $ hg init ../tmpf
583 583 $ hg out ../tmpf
584 584 comparing with ../tmpf
585 585 searching for changes
586 586 0:1f0dee641bb7 (public) [ ] add a
587 587 1:7c3bad9141dc (public) [ ] add b
588 588 2:245bde4270cd (public) [ ] add original_c
589 589 3:6f9641995072 (draft) [ ] add n3w_3_c
590 590 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
591 591 5:cda648ca50f5 (draft orphan) [tip ] add original_e
592 592 $ hg push ../tmpf -f # -f because be push unstable too
593 593 pushing to ../tmpf
594 594 searching for changes
595 595 adding changesets
596 596 adding manifests
597 597 adding file changes
598 598 added 6 changesets with 6 changes to 6 files (+1 heads)
599 599 7 new obsolescence markers
600 600 1 new orphan changesets
601 601
602 602 no warning displayed
603 603
604 604 $ hg push ../tmpf
605 605 pushing to ../tmpf
606 606 searching for changes
607 607 no changes found
608 608 [1]
609 609
610 610 Do not warn about new head when the new head is a successors of a remote one
611 611
612 612 $ hg log -G
613 613 @ 5:cda648ca50f5 (draft orphan) [tip ] add original_e
614 614 |
615 615 x 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
616 616 |
617 617 o 3:6f9641995072 (draft) [ ] add n3w_3_c
618 618 |
619 619 | o 2:245bde4270cd (public) [ ] add original_c
620 620 |/
621 621 o 1:7c3bad9141dc (public) [ ] add b
622 622 |
623 623 o 0:1f0dee641bb7 (public) [ ] add a
624 624
625 625 $ hg up -q 'desc(n3w_3_c)'
626 626 $ mkcommit obsolete_e
627 627 created new head
628 628 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` \
629 629 > -u 'test <test@example.net>'
630 630 obsoleted 1 changesets
631 631 $ hg outgoing ../tmpf # parasite hg outgoing testin
632 632 comparing with ../tmpf
633 633 searching for changes
634 634 6:3de5eca88c00 (draft) [tip ] add obsolete_e
635 635 $ hg push ../tmpf
636 636 pushing to ../tmpf
637 637 searching for changes
638 638 adding changesets
639 639 adding manifests
640 640 adding file changes
641 641 added 1 changesets with 1 changes to 1 files (+1 heads)
642 642 1 new obsolescence markers
643 643 obsoleted 1 changesets
644 644
645 645 test relevance computation
646 646 ---------------------------------------
647 647
648 648 Checking simple case of "marker relevance".
649 649
650 650
651 651 Reminder of the repo situation
652 652
653 653 $ hg log --hidden --graph
654 654 @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e
655 655 |
656 656 | x 5:cda648ca50f5 (draft *obsolete*) [ ] add original_e [rewritten as 6:3de5eca88c00 by test <test@example.net>]
657 657 | |
658 658 | x 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
659 659 |/
660 660 o 3:6f9641995072 (draft) [ ] add n3w_3_c
661 661 |
662 662 | o 2:245bde4270cd (public) [ ] add original_c
663 663 |/
664 664 o 1:7c3bad9141dc (public) [ ] add b
665 665 |
666 666 o 0:1f0dee641bb7 (public) [ ] add a
667 667
668 668
669 669 List of all markers
670 670
671 671 $ hg debugobsolete
672 672 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
673 673 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
674 674 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
675 675 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
676 676 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
677 677 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
678 678 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
679 679 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob)
680 680
681 681 List of changesets with no chain
682 682
683 683 $ hg debugobsolete --hidden --rev ::2
684 684
685 685 List of changesets that are included on marker chain
686 686
687 687 $ hg debugobsolete --hidden --rev 6
688 688 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob)
689 689
690 690 List of changesets with a longer chain, (including a pruned children)
691 691
692 692 $ hg debugobsolete --hidden --rev 3
693 693 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
694 694 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
695 695 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
696 696 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
697 697 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
698 698 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
699 699 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
700 700
701 701 List of both
702 702
703 703 $ hg debugobsolete --hidden --rev 3::6
704 704 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
705 705 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
706 706 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
707 707 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
708 708 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
709 709 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
710 710 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob)
711 711 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
712 712
713 713 List of all markers in JSON
714 714
715 715 $ hg debugobsolete -Tjson
716 716 [
717 717 {
718 718 "date": [1339.0, 0],
719 719 "flag": 0,
720 720 "metadata": {"user": "test"},
721 721 "prednode": "1339133913391339133913391339133913391339",
722 722 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
723 723 },
724 724 {
725 725 "date": [1339.0, 0],
726 726 "flag": 0,
727 727 "metadata": {"user": "test"},
728 728 "prednode": "1337133713371337133713371337133713371337",
729 729 "succnodes": ["5601fb93a350734d935195fee37f4054c529ff39"]
730 730 },
731 731 {
732 732 "date": [121.0, 120],
733 733 "flag": 12,
734 734 "metadata": {"user": "test"},
735 735 "prednode": "245bde4270cd1072a27757984f9cda8ba26f08ca",
736 736 "succnodes": ["cdbce2fbb16313928851e97e0d85413f3f7eb77f"]
737 737 },
738 738 {
739 739 "date": [1338.0, 0],
740 740 "flag": 1,
741 741 "metadata": {"user": "test"},
742 742 "prednode": "5601fb93a350734d935195fee37f4054c529ff39",
743 743 "succnodes": ["6f96419950729f3671185b847352890f074f7557"]
744 744 },
745 745 {
746 746 "date": [1338.0, 0],
747 747 "flag": 0,
748 748 "metadata": {"user": "test"},
749 749 "prednode": "ca819180edb99ed25ceafb3e9584ac287e240b00",
750 750 "succnodes": ["1337133713371337133713371337133713371337"]
751 751 },
752 752 {
753 753 "date": [1337.0, 0],
754 754 "flag": 0,
755 755 "metadata": {"user": "test"},
756 756 "prednode": "cdbce2fbb16313928851e97e0d85413f3f7eb77f",
757 757 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
758 758 },
759 759 {
760 760 "date": [0.0, 0],
761 761 "flag": 0,
762 762 "metadata": {"user": "test"},
763 763 "parentnodes": ["6f96419950729f3671185b847352890f074f7557"],
764 764 "prednode": "94b33453f93bdb8d457ef9b770851a618bf413e1",
765 765 "succnodes": []
766 766 },
767 767 {
768 768 "date": *, (glob)
769 769 "flag": 0,
770 770 "metadata": {"user": "test <test@example.net>"},
771 771 "prednode": "cda648ca50f50482b7055c0b0c4c117bba6733d9",
772 772 "succnodes": ["3de5eca88c00aa039da7399a220f4a5221faa585"]
773 773 }
774 774 ]
775 775
776 776 Template keywords
777 777
778 778 $ hg debugobsolete -r6 -T '{succnodes % "{node|short}"} {date|shortdate}\n'
779 779 3de5eca88c00 ????-??-?? (glob)
780 780 $ hg debugobsolete -r6 -T '{join(metadata % "{key}={value}", " ")}\n'
781 781 user=test <test@example.net>
782 782 $ hg debugobsolete -r6 -T '{metadata}\n{metadata}\n'
783 783 'user': 'test <test@example.net>'
784 784 'user': 'test <test@example.net>'
785 785 $ hg debugobsolete -r6 -T '{succnodes}\n{succnodes}\n'
786 786 3de5eca88c00aa039da7399a220f4a5221faa585
787 787 3de5eca88c00aa039da7399a220f4a5221faa585
788 788 $ hg debugobsolete -r6 -T '{flag} {get(metadata, "user")}\n'
789 789 0 test <test@example.net>
790 790
791 791 Test the debug output for exchange
792 792 ----------------------------------
793 793
794 794 $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' # bundle2
795 795 pulling from ../tmpb
796 796 searching for changes
797 797 no changes found
798 798 obsmarker-exchange: 346 bytes received
799 799
800 800 check hgweb does not explode
801 801 ====================================
802 802
803 803 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
804 804 adding changesets
805 805 adding manifests
806 806 adding file changes
807 807 added 62 changesets with 63 changes to 9 files (+60 heads)
808 808 new changesets 50c51b361e60:c15e9edfca13
809 809 (run 'hg heads .' to see heads, 'hg merge' to merge)
810 810 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
811 811 > do
812 812 > hg debugobsolete $node
813 813 > done
814 814 obsoleted 1 changesets
815 815 obsoleted 1 changesets
816 816 obsoleted 1 changesets
817 817 obsoleted 1 changesets
818 818 obsoleted 1 changesets
819 819 obsoleted 1 changesets
820 820 obsoleted 1 changesets
821 821 obsoleted 1 changesets
822 822 obsoleted 1 changesets
823 823 obsoleted 1 changesets
824 824 obsoleted 1 changesets
825 825 obsoleted 1 changesets
826 826 obsoleted 1 changesets
827 827 obsoleted 1 changesets
828 828 obsoleted 1 changesets
829 829 obsoleted 1 changesets
830 830 obsoleted 1 changesets
831 831 obsoleted 1 changesets
832 832 obsoleted 1 changesets
833 833 obsoleted 1 changesets
834 834 obsoleted 1 changesets
835 835 obsoleted 1 changesets
836 836 obsoleted 1 changesets
837 837 obsoleted 1 changesets
838 838 obsoleted 1 changesets
839 839 obsoleted 1 changesets
840 840 obsoleted 1 changesets
841 841 obsoleted 1 changesets
842 842 obsoleted 1 changesets
843 843 obsoleted 1 changesets
844 844 obsoleted 1 changesets
845 845 obsoleted 1 changesets
846 846 obsoleted 1 changesets
847 847 obsoleted 1 changesets
848 848 obsoleted 1 changesets
849 849 obsoleted 1 changesets
850 850 obsoleted 1 changesets
851 851 obsoleted 1 changesets
852 852 obsoleted 1 changesets
853 853 obsoleted 1 changesets
854 854 obsoleted 1 changesets
855 855 obsoleted 1 changesets
856 856 obsoleted 1 changesets
857 857 obsoleted 1 changesets
858 858 obsoleted 1 changesets
859 859 obsoleted 1 changesets
860 860 obsoleted 1 changesets
861 861 obsoleted 1 changesets
862 862 obsoleted 1 changesets
863 863 obsoleted 1 changesets
864 864 obsoleted 1 changesets
865 865 obsoleted 1 changesets
866 866 obsoleted 1 changesets
867 867 obsoleted 1 changesets
868 868 obsoleted 1 changesets
869 869 obsoleted 1 changesets
870 870 obsoleted 1 changesets
871 871 obsoleted 1 changesets
872 872 obsoleted 1 changesets
873 873 obsoleted 1 changesets
874 874 $ hg up tip
875 875 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
876 876
877 877 #if serve
878 878
879 879 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
880 880 $ cat hg.pid >> $DAEMON_PIDS
881 881
882 882 check changelog view
883 883
884 884 $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/'
885 885 200 Script output follows
886 886
887 887 check graph view
888 888
889 889 $ get-with-headers.py --headeronly localhost:$HGPORT 'graph'
890 890 200 Script output follows
891 891
892 892 check filelog view
893 893
894 894 $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
895 895 200 Script output follows
896 896
897 897 check filelog view for hidden commits (obsolete ones are hidden here)
898 898
899 899 $ get-with-headers.py localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar' | grep obsolete
900 900 [1]
901 901
902 902 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
903 903 200 Script output follows
904 904 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
905 905 404 Not Found
906 906 [1]
907 907
908 908 check that web.view config option:
909 909
910 910 $ killdaemons.py hg.pid
911 911 $ cat >> .hg/hgrc << EOF
912 912 > [web]
913 913 > view=all
914 914 > EOF
915 915 $ wait
916 916 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
917 917 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
918 918 200 Script output follows
919 919 $ killdaemons.py hg.pid
920 920
921 921 Checking _enable=False warning if obsolete marker exists
922 922
923 923 $ echo '[experimental]' >> $HGRCPATH
924 924 $ echo "evolution=" >> $HGRCPATH
925 925 $ hg log -r tip
926 926 68:c15e9edfca13 (draft) [tip ] add celestine
927 927
928 928 reenable for later test
929 929
930 930 $ echo '[experimental]' >> $HGRCPATH
931 931 $ echo "evolution.exchange=True" >> $HGRCPATH
932 932 $ echo "evolution.createmarkers=True" >> $HGRCPATH
933 933
934 934 $ rm hg.pid access.log errors.log
935 935 #endif
936 936
937 937 Several troubles on the same changeset (create an unstable and bumped changeset)
938 938
939 939 $ hg debugobsolete `getid obsolete_e`
940 940 obsoleted 1 changesets
941 941 2 new orphan changesets
942 942 $ hg debugobsolete `getid original_c` `getid babar`
943 943 1 new phase-divergent changesets
944 944 $ hg log --config ui.logtemplate= -r 'phasedivergent() and orphan()'
945 945 changeset: 7:50c51b361e60
946 946 user: test
947 947 date: Thu Jan 01 00:00:00 1970 +0000
948 948 instability: orphan, phase-divergent
949 949 summary: add babar
950 950
951 951
952 952 test the "obsolete" templatekw
953 953
954 954 $ hg log -r 'obsolete()'
955 955 6:3de5eca88c00 (draft *obsolete*) [ ] add obsolete_e [pruned]
956 956
957 957 test the "troubles" templatekw
958 958
959 959 $ hg log -r 'phasedivergent() and orphan()'
960 960 7:50c51b361e60 (draft orphan phase-divergent) [ ] add babar
961 961
962 962 test the default cmdline template
963 963
964 964 $ hg log -T default -r 'phasedivergent()'
965 965 changeset: 7:50c51b361e60
966 966 user: test
967 967 date: Thu Jan 01 00:00:00 1970 +0000
968 968 instability: orphan, phase-divergent
969 969 summary: add babar
970 970
971 971 $ hg log -T default -r 'obsolete()'
972 972 changeset: 6:3de5eca88c00
973 973 parent: 3:6f9641995072
974 974 user: test
975 975 date: Thu Jan 01 00:00:00 1970 +0000
976 976 obsolete: pruned
977 977 summary: add obsolete_e
978 978
979 979
980 980 test the obsolete labels
981 981
982 982 $ hg log --config ui.logtemplate= --color=debug -r 'phasedivergent()'
983 983 [log.changeset changeset.draft changeset.unstable instability.orphan instability.phase-divergent|changeset: 7:50c51b361e60]
984 984 [log.user|user: test]
985 985 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
986 986 [log.instability|instability: orphan, phase-divergent]
987 987 [log.summary|summary: add babar]
988 988
989 989
990 990 $ hg log -T default -r 'phasedivergent()' --color=debug
991 991 [log.changeset changeset.draft changeset.unstable instability.orphan instability.phase-divergent|changeset: 7:50c51b361e60]
992 992 [log.user|user: test]
993 993 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
994 994 [log.instability|instability: orphan, phase-divergent]
995 995 [log.summary|summary: add babar]
996 996
997 997
998 998 $ hg log --config ui.logtemplate= --color=debug -r "obsolete()"
999 999 [log.changeset changeset.draft changeset.obsolete|changeset: 6:3de5eca88c00]
1000 1000 [log.parent changeset.draft|parent: 3:6f9641995072]
1001 1001 [log.user|user: test]
1002 1002 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1003 1003 [log.obsfate|obsolete: pruned]
1004 1004 [log.summary|summary: add obsolete_e]
1005 1005
1006 1006
1007 1007 $ hg log -T default -r 'obsolete()' --color=debug
1008 1008 [log.changeset changeset.draft changeset.obsolete|changeset: 6:3de5eca88c00]
1009 1009 [log.parent changeset.draft|parent: 3:6f9641995072]
1010 1010 [log.user|user: test]
1011 1011 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1012 1012 [log.obsfate|obsolete: pruned]
1013 1013 [log.summary|summary: add obsolete_e]
1014 1014
1015 1015
1016 1016 test summary output
1017 1017
1018 1018 $ hg up -r 'phasedivergent() and orphan()'
1019 1019 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1020 1020 $ hg summary
1021 1021 parent: 7:50c51b361e60 (orphan, phase-divergent)
1022 1022 add babar
1023 1023 branch: default
1024 1024 commit: (clean)
1025 1025 update: 2 new changesets (update)
1026 1026 phases: 4 draft
1027 1027 orphan: 2 changesets
1028 1028 phase-divergent: 1 changesets
1029 1029 $ hg up -r 'obsolete()'
1030 1030 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1031 1031 $ hg summary
1032 1032 parent: 6:3de5eca88c00 (obsolete)
1033 1033 add obsolete_e
1034 1034 branch: default
1035 1035 commit: (clean)
1036 1036 update: 3 new changesets (update)
1037 1037 phases: 4 draft
1038 1038 orphan: 2 changesets
1039 1039 phase-divergent: 1 changesets
1040 1040
1041 1041 test debugwhyunstable output
1042 1042
1043 1043 $ hg debugwhyunstable 50c51b361e60
1044 1044 orphan: obsolete parent 3de5eca88c00aa039da7399a220f4a5221faa585
1045 1045 phase-divergent: immutable predecessor 245bde4270cd1072a27757984f9cda8ba26f08ca
1046 1046
1047 1047 #if serve
1048 1048
1049 1049 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1050 1050 $ cat hg.pid >> $DAEMON_PIDS
1051 1051
1052 1052 check obsolete changeset
1053 1053
1054 1054 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=paper' | grep '<span class="obsolete">'
1055 1055 <span class="phase">draft</span> <span class="obsolete">obsolete</span>
1056 1056 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=coal' | grep '<span class="obsolete">'
1057 1057 <span class="phase">draft</span> <span class="obsolete">obsolete</span>
1058 1058 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=gitweb' | grep '<span class="logtags">'
1059 1059 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="obsoletetag" title="obsolete">obsolete</span> </span>
1060 1060 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=monoblue' | grep '<span class="logtags">'
1061 1061 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="obsoletetag" title="obsolete">obsolete</span> </span>
1062 1062 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=spartan' | grep 'class="obsolete"'
1063 1063 <th class="obsolete">obsolete:</th>
1064 1064 <td class="obsolete">pruned by &#116;&#101;&#115;&#116; <span class="age">Thu, 01 Jan 1970 00:00:00 +0000</span></td>
1065 1065
1066 1066 check changeset with instabilities
1067 1067
1068 1068 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=paper' | grep '<span class="instability">'
1069 1069 <span class="phase">draft</span> <span class="instability">orphan</span> <span class="instability">phase-divergent</span>
1070 1070 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=coal' | grep '<span class="instability">'
1071 1071 <span class="phase">draft</span> <span class="instability">orphan</span> <span class="instability">phase-divergent</span>
1072 1072 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=gitweb' | grep '<span class="logtags">'
1073 1073 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="instabilitytag" title="orphan">orphan</span> <span class="instabilitytag" title="phase-divergent">phase-divergent</span> </span>
1074 1074 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=monoblue' | grep '<span class="logtags">'
1075 1075 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="instabilitytag" title="orphan">orphan</span> <span class="instabilitytag" title="phase-divergent">phase-divergent</span> </span>
1076 1076 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=spartan' | grep 'class="unstable"'
1077 1077 <th class="unstable">unstable:</th>
1078 1078 <td class="unstable">orphan: obsolete parent <a href="/rev/3de5eca88c00?style=spartan">3de5eca88c00</a></td>
1079 1079 <th class="unstable">unstable:</th>
1080 1080 <td class="unstable">phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=spartan">245bde4270cd</a></td>
1081 1081
1082 1082 check explanation for an orphan and phase-divergent changeset
1083 1083
1084 1084 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=paper' | egrep '(orphan|phase-divergent):'
1085 1085 <td>orphan: obsolete parent <a href="/rev/3de5eca88c00?style=paper">3de5eca88c00</a><br>
1086 1086 phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=paper">245bde4270cd</a></td>
1087 1087 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=coal' | egrep '(orphan|phase-divergent):'
1088 1088 <td>orphan: obsolete parent <a href="/rev/3de5eca88c00?style=coal">3de5eca88c00</a><br>
1089 1089 phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=coal">245bde4270cd</a></td>
1090 1090 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=gitweb' | egrep '(orphan|phase-divergent):'
1091 1091 <td>orphan: obsolete parent <a class="list" href="/rev/3de5eca88c00?style=gitweb">3de5eca88c00</a></td>
1092 1092 <td>phase-divergent: immutable predecessor <a class="list" href="/rev/245bde4270cd?style=gitweb">245bde4270cd</a></td>
1093 1093 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=monoblue' | egrep '(orphan|phase-divergent):'
1094 1094 <dd>orphan: obsolete parent <a href="/rev/3de5eca88c00?style=monoblue">3de5eca88c00</a></dd>
1095 1095 <dd>phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=monoblue">245bde4270cd</a></dd>
1096 1096 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=spartan' | egrep '(orphan|phase-divergent):'
1097 1097 <td class="unstable">orphan: obsolete parent <a href="/rev/3de5eca88c00?style=spartan">3de5eca88c00</a></td>
1098 1098 <td class="unstable">phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=spartan">245bde4270cd</a></td>
1099 1099
1100 1100 $ killdaemons.py
1101 1101
1102 1102 $ rm hg.pid access.log errors.log
1103 1103
1104 1104 #endif
1105 1105
1106 1106 Test incoming/outcoming with changesets obsoleted remotely, known locally
1107 1107 ===============================================================================
1108 1108
1109 1109 This test issue 3805
1110 1110
1111 1111 $ hg init repo-issue3805
1112 1112 $ cd repo-issue3805
1113 1113 $ echo "base" > base
1114 1114 $ hg ci -Am "base"
1115 1115 adding base
1116 1116 $ echo "foo" > foo
1117 1117 $ hg ci -Am "A"
1118 1118 adding foo
1119 1119 $ hg clone . ../other-issue3805
1120 1120 updating to branch default
1121 1121 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1122 1122 $ echo "bar" >> foo
1123 1123 $ hg ci --amend
1124 1124 $ cd ../other-issue3805
1125 1125 $ hg log -G
1126 1126 @ 1:29f0c6921ddd (draft) [tip ] A
1127 1127 |
1128 1128 o 0:d20a80d4def3 (draft) [ ] base
1129 1129
1130 1130 $ hg log -G -R ../repo-issue3805
1131 1131 @ 2:323a9c3ddd91 (draft) [tip ] A
1132 1132 |
1133 1133 o 0:d20a80d4def3 (draft) [ ] base
1134 1134
1135 1135 $ hg incoming
1136 1136 comparing with $TESTTMP/tmpe/repo-issue3805
1137 1137 searching for changes
1138 1138 2:323a9c3ddd91 (draft) [tip ] A
1139 1139 $ hg incoming --bundle ../issue3805.hg
1140 1140 comparing with $TESTTMP/tmpe/repo-issue3805
1141 1141 searching for changes
1142 1142 2:323a9c3ddd91 (draft) [tip ] A
1143 1143 $ hg outgoing
1144 1144 comparing with $TESTTMP/tmpe/repo-issue3805
1145 1145 searching for changes
1146 1146 1:29f0c6921ddd (draft) [tip ] A
1147 1147
1148 1148 #if serve
1149 1149
1150 1150 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1151 1151 $ cat hg.pid >> $DAEMON_PIDS
1152 1152
1153 1153 $ hg incoming http://localhost:$HGPORT
1154 1154 comparing with http://localhost:$HGPORT/
1155 1155 searching for changes
1156 1156 2:323a9c3ddd91 (draft) [tip ] A
1157 1157 $ hg outgoing http://localhost:$HGPORT
1158 1158 comparing with http://localhost:$HGPORT/
1159 1159 searching for changes
1160 1160 1:29f0c6921ddd (draft) [tip ] A
1161 1161
1162 1162 $ killdaemons.py
1163 1163
1164 1164 #endif
1165 1165
1166 1166 This test issue 3814
1167 1167
1168 1168 (nothing to push but locally hidden changeset)
1169 1169
1170 1170 $ cd ..
1171 1171 $ hg init repo-issue3814
1172 1172 $ cd repo-issue3805
1173 1173 $ hg push -r 323a9c3ddd91 ../repo-issue3814
1174 1174 pushing to ../repo-issue3814
1175 1175 searching for changes
1176 1176 adding changesets
1177 1177 adding manifests
1178 1178 adding file changes
1179 1179 added 2 changesets with 2 changes to 2 files
1180 1180 1 new obsolescence markers
1181 1181 $ hg out ../repo-issue3814
1182 1182 comparing with ../repo-issue3814
1183 1183 searching for changes
1184 1184 no changes found
1185 1185 [1]
1186 1186
1187 1187 Test that a local tag blocks a changeset from being hidden
1188 1188
1189 1189 $ hg tag -l visible -r 1 --hidden
1190 1190 $ hg log -G
1191 1191 @ 2:323a9c3ddd91 (draft) [tip ] A
1192 1192 |
1193 1193 | x 1:29f0c6921ddd (draft *obsolete*) [visible ] A [rewritten using amend as 2:323a9c3ddd91]
1194 1194 |/
1195 1195 o 0:d20a80d4def3 (draft) [ ] base
1196 1196
1197 1197 Test that removing a local tag does not cause some commands to fail
1198 1198
1199 1199 $ hg tag -l -r tip tiptag
1200 1200 $ hg tags
1201 1201 tiptag 2:323a9c3ddd91
1202 1202 tip 2:323a9c3ddd91
1203 1203 visible 1:29f0c6921ddd
1204 1204 $ hg --config extensions.strip= strip -r tip --no-backup
1205 1205 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1206 1206 $ hg tags
1207 1207 visible 1:29f0c6921ddd
1208 1208 tip 1:29f0c6921ddd
1209 1209
1210 1210 Test bundle overlay onto hidden revision
1211 1211
1212 1212 $ cd ..
1213 1213 $ hg init repo-bundleoverlay
1214 1214 $ cd repo-bundleoverlay
1215 1215 $ echo "A" > foo
1216 1216 $ hg ci -Am "A"
1217 1217 adding foo
1218 1218 $ echo "B" >> foo
1219 1219 $ hg ci -m "B"
1220 1220 $ hg up 0
1221 1221 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1222 1222 $ echo "C" >> foo
1223 1223 $ hg ci -m "C"
1224 1224 created new head
1225 1225 $ hg log -G
1226 1226 @ 2:c186d7714947 (draft) [tip ] C
1227 1227 |
1228 1228 | o 1:44526ebb0f98 (draft) [ ] B
1229 1229 |/
1230 1230 o 0:4b34ecfb0d56 (draft) [ ] A
1231 1231
1232 1232
1233 1233 $ hg clone -r1 . ../other-bundleoverlay
1234 1234 adding changesets
1235 1235 adding manifests
1236 1236 adding file changes
1237 1237 added 2 changesets with 2 changes to 1 files
1238 1238 new changesets 4b34ecfb0d56:44526ebb0f98
1239 1239 updating to branch default
1240 1240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1241 1241 $ cd ../other-bundleoverlay
1242 1242 $ echo "B+" >> foo
1243 1243 $ hg ci --amend -m "B+"
1244 1244 $ hg log -G --hidden
1245 1245 @ 2:b7d587542d40 (draft) [tip ] B+
1246 1246 |
1247 1247 | x 1:44526ebb0f98 (draft *obsolete*) [ ] B [rewritten using amend as 2:b7d587542d40]
1248 1248 |/
1249 1249 o 0:4b34ecfb0d56 (draft) [ ] A
1250 1250
1251 1251
1252 1252 #if repobundlerepo
1253 1253 $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
1254 1254 comparing with ../repo-bundleoverlay
1255 1255 searching for changes
1256 1256 1:44526ebb0f98 (draft) [ ] B
1257 1257 2:c186d7714947 (draft) [tip ] C
1258 1258 $ hg log -G -R ../bundleoverlay.hg
1259 1259 o 3:c186d7714947 (draft) [tip ] C
1260 1260 |
1261 1261 | @ 2:b7d587542d40 (draft) [ ] B+
1262 1262 |/
1263 1263 o 0:4b34ecfb0d56 (draft) [ ] A
1264 1264
1265 1265 #endif
1266 1266
1267 1267 #if serve
1268 1268
1269 1269 Test issue 4506
1270 1270
1271 1271 $ cd ..
1272 1272 $ hg init repo-issue4506
1273 1273 $ cd repo-issue4506
1274 1274 $ echo "0" > foo
1275 1275 $ hg add foo
1276 1276 $ hg ci -m "content-0"
1277 1277
1278 1278 $ hg up null
1279 1279 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1280 1280 $ echo "1" > bar
1281 1281 $ hg add bar
1282 1282 $ hg ci -m "content-1"
1283 1283 created new head
1284 1284 $ hg up 0
1285 1285 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1286 1286 $ hg graft 1
1287 1287 grafting 1:1c9eddb02162 "content-1" (tip)
1288 1288
1289 1289 $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
1290 1290 obsoleted 1 changesets
1291 1291
1292 1292 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1293 1293 $ cat hg.pid >> $DAEMON_PIDS
1294 1294
1295 1295 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1'
1296 1296 404 Not Found
1297 1297 [1]
1298 1298 $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar'
1299 1299 200 Script output follows
1300 1300 $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar'
1301 1301 200 Script output follows
1302 1302
1303 1303 $ killdaemons.py
1304 1304
1305 1305 #endif
1306 1306
1307 1307 Test heads computation on pending index changes with obsolescence markers
1308 1308 $ cd ..
1309 1309 $ cat >$TESTTMP/test_extension.py << EOF
1310 1310 > from __future__ import absolute_import
1311 1311 > from mercurial.i18n import _
1312 1312 > from mercurial import cmdutil, registrar
1313 1313 >
1314 1314 > cmdtable = {}
1315 1315 > command = registrar.command(cmdtable)
1316 1316 > @command(b"amendtransient",[], _(b'hg amendtransient [rev]'))
1317 1317 > def amend(ui, repo, *pats, **opts):
1318 1318 > opts['message'] = 'Test'
1319 1319 > opts['logfile'] = None
1320 1320 > cmdutil.amend(ui, repo, repo['.'], {}, pats, opts)
1321 1321 > ui.write(b'%s\n' % repo.changelog.headrevs())
1322 1322 > EOF
1323 1323 $ cat >> $HGRCPATH << EOF
1324 1324 > [extensions]
1325 1325 > testextension=$TESTTMP/test_extension.py
1326 1326 > EOF
1327 1327 $ hg init repo-issue-nativerevs-pending-changes
1328 1328 $ cd repo-issue-nativerevs-pending-changes
1329 1329 $ mkcommit a
1330 1330 $ mkcommit b
1331 1331 $ hg up ".^"
1332 1332 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1333 1333 $ echo aa > a
1334 1334 $ hg amendtransient
1335 1335 1 new orphan changesets
1336 1336 [1, 2]
1337 1337
1338 1338 Test cache consistency for the visible filter
1339 1339 1) We want to make sure that the cached filtered revs are invalidated when
1340 1340 bookmarks change
1341 1341 $ cd ..
1342 1342 $ cat >$TESTTMP/test_extension.py << EOF
1343 1343 > from __future__ import absolute_import, print_function
1344 1344 > import weakref
1345 1345 > from mercurial import (
1346 1346 > bookmarks,
1347 1347 > cmdutil,
1348 1348 > extensions,
1349 1349 > repoview,
1350 1350 > )
1351 1351 > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs):
1352 1352 > reporef = weakref.ref(bkmstoreinst._repo)
1353 1353 > def trhook(tr):
1354 1354 > repo = reporef()
1355 1355 > hidden1 = repoview.computehidden(repo)
1356 1356 > hidden = repoview.filterrevs(repo, b'visible')
1357 1357 > if sorted(hidden1) != sorted(hidden):
1358 1358 > print("cache inconsistency")
1359 1359 > bkmstoreinst._repo.currenttransaction().addpostclose('test_extension', trhook)
1360 1360 > orig(bkmstoreinst, *args, **kwargs)
1361 1361 > def extsetup(ui):
1362 1362 > extensions.wrapfunction(bookmarks.bmstore, '_recordchange',
1363 1363 > _bookmarkchanged)
1364 1364 > EOF
1365 1365
1366 1366 $ hg init repo-cache-inconsistency
1367 1367 $ cd repo-issue-nativerevs-pending-changes
1368 1368 $ mkcommit a
1369 1369 a already tracked!
1370 1370 $ mkcommit b
1371 1371 $ hg id
1372 1372 13bedc178fce tip
1373 1373 $ echo "hello" > b
1374 1374 $ hg commit --amend -m "message"
1375 1375 $ hg book bookb -r 13bedc178fce --hidden
1376 1376 bookmarking hidden changeset 13bedc178fce
1377 1377 (hidden revision '13bedc178fce' was rewritten as: a9b1f8652753)
1378 1378 $ hg log -r 13bedc178fce
1379 1379 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753]
1380 1380 $ hg book -d bookb
1381 1381 $ hg log -r 13bedc178fce
1382 1382 abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753!
1383 1383 (use --hidden to access hidden revisions)
1384 1384 [255]
1385 1385
1386 1386 Empty out the test extension, as it isn't compatible with later parts
1387 1387 of the test.
1388 1388 $ echo > $TESTTMP/test_extension.py
1389 1389
1390 1390 Test ability to pull changeset with locally applying obsolescence markers
1391 1391 (issue4945)
1392 1392
1393 1393 $ cd ..
1394 1394 $ hg init issue4845
1395 1395 $ cd issue4845
1396 1396
1397 1397 $ echo foo > f0
1398 1398 $ hg add f0
1399 1399 $ hg ci -m '0'
1400 1400 $ echo foo > f1
1401 1401 $ hg add f1
1402 1402 $ hg ci -m '1'
1403 1403 $ echo foo > f2
1404 1404 $ hg add f2
1405 1405 $ hg ci -m '2'
1406 1406
1407 1407 $ echo bar > f2
1408 1408 $ hg commit --amend --config experimental.evolution.createmarkers=True
1409 1409 $ hg log -G
1410 1410 @ 3:b0551702f918 (draft) [tip ] 2
1411 1411 |
1412 1412 o 1:e016b03fd86f (draft) [ ] 1
1413 1413 |
1414 1414 o 0:a78f55e5508c (draft) [ ] 0
1415 1415
1416 1416 $ hg log -G --hidden
1417 1417 @ 3:b0551702f918 (draft) [tip ] 2
1418 1418 |
1419 1419 | x 2:e008cf283490 (draft *obsolete*) [ ] 2 [rewritten using amend as 3:b0551702f918]
1420 1420 |/
1421 1421 o 1:e016b03fd86f (draft) [ ] 1
1422 1422 |
1423 1423 o 0:a78f55e5508c (draft) [ ] 0
1424 1424
1425 1425
1426 1426 $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no
1427 1427 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-ede36964-backup.hg
1428 1428 $ hg debugobsolete
1429 1429 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1430 1430 $ hg log -G
1431 1431 @ 2:b0551702f918 (draft) [tip ] 2
1432 1432 |
1433 1433 o 1:e016b03fd86f (draft) [ ] 1
1434 1434 |
1435 1435 o 0:a78f55e5508c (draft) [ ] 0
1436 1436
1437 1437 $ hg log -G --hidden
1438 1438 @ 2:b0551702f918 (draft) [tip ] 2
1439 1439 |
1440 1440 o 1:e016b03fd86f (draft) [ ] 1
1441 1441 |
1442 1442 o 0:a78f55e5508c (draft) [ ] 0
1443 1443
1444 1444 $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg
1445 1445 Stream params: {Compression: BZ}
1446 1446 changegroup -- {nbchanges: 1, version: 02}
1447 1447 e008cf2834908e5d6b0f792a9d4b0e2272260fb8
1448 1448 cache:rev-branch-cache -- {}
1449 1449 phase-heads -- {}
1450 1450 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 draft
1451 1451
1452 #if repobundlerepo
1452 1453 $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg
1453 1454 pulling from .hg/strip-backup/e008cf283490-ede36964-backup.hg
1454 1455 searching for changes
1455 1456 no changes found
1457 #endif
1456 1458 $ hg debugobsolete
1457 1459 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1458 1460 $ hg log -G
1459 1461 @ 2:b0551702f918 (draft) [tip ] 2
1460 1462 |
1461 1463 o 1:e016b03fd86f (draft) [ ] 1
1462 1464 |
1463 1465 o 0:a78f55e5508c (draft) [ ] 0
1464 1466
1465 1467 $ hg log -G --hidden
1466 1468 @ 2:b0551702f918 (draft) [tip ] 2
1467 1469 |
1468 1470 o 1:e016b03fd86f (draft) [ ] 1
1469 1471 |
1470 1472 o 0:a78f55e5508c (draft) [ ] 0
1471 1473
1472 1474
1473 1475 Testing that strip remove markers:
1474 1476
1475 1477 $ hg strip -r 1 --config extensions.strip=
1476 1478 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1477 1479 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg
1478 1480 $ hg debugobsolete
1479 1481 $ hg log -G
1480 1482 @ 0:a78f55e5508c (draft) [tip ] 0
1481 1483
1482 1484 $ hg log -G --hidden
1483 1485 @ 0:a78f55e5508c (draft) [tip ] 0
1484 1486
1485 1487 $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
1486 1488 Stream params: {Compression: BZ}
1487 1489 changegroup -- {nbchanges: 2, version: 02}
1488 1490 e016b03fd86fcccc54817d120b90b751aaf367d6
1489 1491 b0551702f918510f01ae838ab03a463054c67b46
1490 1492 cache:rev-branch-cache -- {}
1491 1493 obsmarkers -- {}
1492 1494 version: 1 (92 bytes)
1493 1495 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1494 1496 phase-heads -- {}
1495 1497 b0551702f918510f01ae838ab03a463054c67b46 draft
1496 1498
1497 1499 $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
1498 1500 adding changesets
1499 1501 adding manifests
1500 1502 adding file changes
1501 1503 added 2 changesets with 2 changes to 2 files
1502 1504 1 new obsolescence markers
1503 1505 new changesets e016b03fd86f:b0551702f918
1504 1506 (run 'hg update' to get a working copy)
1505 1507 $ hg debugobsolete | sort
1506 1508 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1507 1509 $ hg log -G
1508 1510 o 2:b0551702f918 (draft) [tip ] 2
1509 1511 |
1510 1512 o 1:e016b03fd86f (draft) [ ] 1
1511 1513 |
1512 1514 @ 0:a78f55e5508c (draft) [ ] 0
1513 1515
1514 1516 $ hg log -G --hidden
1515 1517 o 2:b0551702f918 (draft) [tip ] 2
1516 1518 |
1517 1519 o 1:e016b03fd86f (draft) [ ] 1
1518 1520 |
1519 1521 @ 0:a78f55e5508c (draft) [ ] 0
1520 1522
1521 1523 Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when
1522 1524 only a subset of those are displayed (because of --rev option)
1523 1525 $ hg init doindexrev
1524 1526 $ cd doindexrev
1525 1527 $ echo a > a
1526 1528 $ hg ci -Am a
1527 1529 adding a
1528 1530 $ hg ci --amend -m aa
1529 1531 $ echo b > b
1530 1532 $ hg ci -Am b
1531 1533 adding b
1532 1534 $ hg ci --amend -m bb
1533 1535 $ echo c > c
1534 1536 $ hg ci -Am c
1535 1537 adding c
1536 1538 $ hg ci --amend -m cc
1537 1539 $ echo d > d
1538 1540 $ hg ci -Am d
1539 1541 adding d
1540 1542 $ hg ci --amend -m dd --config experimental.evolution.track-operation=1
1541 1543 $ hg debugobsolete --index --rev "3+7"
1542 1544 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1543 1545 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1544 1546 $ hg debugobsolete --index --rev "3+7" -Tjson
1545 1547 [
1546 1548 {
1547 1549 "date": [0.0, 0],
1548 1550 "flag": 0,
1549 1551 "index": 1,
1550 1552 "metadata": {"ef1": "1", "operation": "amend", "user": "test"},
1551 1553 "prednode": "6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1",
1552 1554 "succnodes": ["d27fb9b066076fd921277a4b9e8b9cb48c95bc6a"]
1553 1555 },
1554 1556 {
1555 1557 "date": [0.0, 0],
1556 1558 "flag": 0,
1557 1559 "index": 3,
1558 1560 "metadata": {"ef1": "1", "operation": "amend", "user": "test"},
1559 1561 "prednode": "4715cf767440ed891755448016c2b8cf70760c30",
1560 1562 "succnodes": ["7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d"]
1561 1563 }
1562 1564 ]
1563 1565
1564 1566 Test the --delete option of debugobsolete command
1565 1567 $ hg debugobsolete --index
1566 1568 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1567 1569 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1568 1570 2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1569 1571 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1570 1572 $ hg debugobsolete --delete 1 --delete 3
1571 1573 deleted 2 obsolescence markers
1572 1574 $ hg debugobsolete
1573 1575 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1574 1576 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1575 1577
1576 1578 Test adding changeset after obsmarkers affecting it
1577 1579 (eg: during pull, or unbundle)
1578 1580
1579 1581 $ mkcommit e
1580 1582 $ hg bundle -r . --base .~1 ../bundle-2.hg
1581 1583 1 changesets found
1582 1584 $ getid .
1583 1585 $ hg --config extensions.strip= strip -r .
1584 1586 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1585 1587 saved backup bundle to $TESTTMP/tmpe/issue4845/doindexrev/.hg/strip-backup/9bc153528424-ee80edd4-backup.hg
1586 1588 $ hg debugobsolete 9bc153528424ea266d13e57f9ff0d799dfe61e4b
1587 1589 $ hg unbundle ../bundle-2.hg
1588 1590 adding changesets
1589 1591 adding manifests
1590 1592 adding file changes
1591 1593 added 1 changesets with 1 changes to 1 files
1592 1594 (run 'hg update' to get a working copy)
1593 1595 $ hg log -G
1594 1596 @ 7:7ae79c5d60f0 (draft) [tip ] dd
1595 1597 |
1596 1598 | o 6:4715cf767440 (draft) [ ] d
1597 1599 |/
1598 1600 o 5:29346082e4a9 (draft) [ ] cc
1599 1601 |
1600 1602 o 3:d27fb9b06607 (draft) [ ] bb
1601 1603 |
1602 1604 | o 2:6fdef60fcbab (draft) [ ] b
1603 1605 |/
1604 1606 o 1:f9bd49731b0b (draft) [ ] aa
1605 1607
1606 1608
1607 1609 $ cd ..
@@ -1,79 +1,79 b''
1 #require unix-permissions no-root
1 #require unix-permissions no-root reporevlogstore
2 2
3 3 $ hg init t
4 4 $ cd t
5 5
6 6 $ echo foo > a
7 7 $ hg add a
8 8
9 9 $ hg commit -m "1"
10 10
11 11 $ hg verify
12 12 checking changesets
13 13 checking manifests
14 14 crosschecking files in changesets and manifests
15 15 checking files
16 16 1 files, 1 changesets, 1 total revisions
17 17
18 18 $ chmod -r .hg/store/data/a.i
19 19
20 20 $ hg verify
21 21 checking changesets
22 22 checking manifests
23 23 crosschecking files in changesets and manifests
24 24 checking files
25 25 abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i
26 26 [255]
27 27
28 28 $ chmod +r .hg/store/data/a.i
29 29
30 30 $ hg verify
31 31 checking changesets
32 32 checking manifests
33 33 crosschecking files in changesets and manifests
34 34 checking files
35 35 1 files, 1 changesets, 1 total revisions
36 36
37 37 $ chmod -w .hg/store/data/a.i
38 38
39 39 $ echo barber > a
40 40 $ hg commit -m "2"
41 41 trouble committing a!
42 42 abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i
43 43 [255]
44 44
45 45 $ chmod -w .
46 46
47 47 $ hg diff --nodates
48 48 diff -r 2a18120dc1c9 a
49 49 --- a/a
50 50 +++ b/a
51 51 @@ -1,1 +1,1 @@
52 52 -foo
53 53 +barber
54 54
55 55 $ chmod +w .
56 56
57 57 $ chmod +w .hg/store/data/a.i
58 58 $ mkdir dir
59 59 $ touch dir/a
60 60 $ hg status
61 61 M a
62 62 ? dir/a
63 63 $ chmod -rx dir
64 64
65 65 #if no-fsmonitor
66 66
67 67 (fsmonitor makes "hg status" avoid accessing to "dir")
68 68
69 69 $ hg status
70 70 dir: Permission denied
71 71 M a
72 72
73 73 #endif
74 74
75 75 Reenable perm to allow deletion:
76 76
77 77 $ chmod +rx dir
78 78
79 79 $ cd ..
@@ -1,1365 +1,1367 b''
1 1 #require killdaemons
2 2
3 3 $ cat >> $HGRCPATH << EOF
4 4 > [extensions]
5 5 > phasereport=$TESTDIR/testlib/ext-phase-report.py
6 6 > EOF
7 7
8 8 $ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; }
9 9
10 10 $ mkcommit() {
11 11 > echo "$1" > "$1"
12 12 > hg add "$1"
13 13 > message="$1"
14 14 > shift
15 15 > hg ci -m "$message" $*
16 16 > }
17 17
18 18 $ hg init alpha
19 19 $ cd alpha
20 20 $ mkcommit a-A
21 21 test-debug-phase: new rev 0: x -> 1
22 22 $ mkcommit a-B
23 23 test-debug-phase: new rev 1: x -> 1
24 24 $ mkcommit a-C
25 25 test-debug-phase: new rev 2: x -> 1
26 26 $ mkcommit a-D
27 27 test-debug-phase: new rev 3: x -> 1
28 28 $ hgph
29 29 @ 3 draft a-D - b555f63b6063
30 30 |
31 31 o 2 draft a-C - 54acac6f23ab
32 32 |
33 33 o 1 draft a-B - 548a3d25dbf0
34 34 |
35 35 o 0 draft a-A - 054250a37db4
36 36
37 37
38 38 $ hg init ../beta
39 39 $ hg push -r 1 ../beta
40 40 pushing to ../beta
41 41 searching for changes
42 42 adding changesets
43 43 adding manifests
44 44 adding file changes
45 45 added 2 changesets with 2 changes to 2 files
46 46 test-debug-phase: new rev 0: x -> 0
47 47 test-debug-phase: new rev 1: x -> 0
48 48 test-debug-phase: move rev 0: 1 -> 0
49 49 test-debug-phase: move rev 1: 1 -> 0
50 50 $ hgph
51 51 @ 3 draft a-D - b555f63b6063
52 52 |
53 53 o 2 draft a-C - 54acac6f23ab
54 54 |
55 55 o 1 public a-B - 548a3d25dbf0
56 56 |
57 57 o 0 public a-A - 054250a37db4
58 58
59 59
60 60 $ cd ../beta
61 61 $ hgph
62 62 o 1 public a-B - 548a3d25dbf0
63 63 |
64 64 o 0 public a-A - 054250a37db4
65 65
66 66 $ hg up -q
67 67 $ mkcommit b-A
68 68 test-debug-phase: new rev 2: x -> 1
69 69 $ hgph
70 70 @ 2 draft b-A - f54f1bb90ff3
71 71 |
72 72 o 1 public a-B - 548a3d25dbf0
73 73 |
74 74 o 0 public a-A - 054250a37db4
75 75
76 76 $ hg pull ../alpha
77 77 pulling from ../alpha
78 78 searching for changes
79 79 adding changesets
80 80 adding manifests
81 81 adding file changes
82 82 added 2 changesets with 2 changes to 2 files (+1 heads)
83 83 new changesets 54acac6f23ab:b555f63b6063
84 84 test-debug-phase: new rev 3: x -> 0
85 85 test-debug-phase: new rev 4: x -> 0
86 86 (run 'hg heads' to see heads, 'hg merge' to merge)
87 87 $ hgph
88 88 o 4 public a-D - b555f63b6063
89 89 |
90 90 o 3 public a-C - 54acac6f23ab
91 91 |
92 92 | @ 2 draft b-A - f54f1bb90ff3
93 93 |/
94 94 o 1 public a-B - 548a3d25dbf0
95 95 |
96 96 o 0 public a-A - 054250a37db4
97 97
98 98
99 99 pull did not updated ../alpha state.
100 100 push from alpha to beta should update phase even if nothing is transferred
101 101
102 102 $ cd ../alpha
103 103 $ hgph # not updated by remote pull
104 104 @ 3 draft a-D - b555f63b6063
105 105 |
106 106 o 2 draft a-C - 54acac6f23ab
107 107 |
108 108 o 1 public a-B - 548a3d25dbf0
109 109 |
110 110 o 0 public a-A - 054250a37db4
111 111
112 112 $ hg push -r 2 ../beta
113 113 pushing to ../beta
114 114 searching for changes
115 115 no changes found
116 116 test-debug-phase: move rev 2: 1 -> 0
117 117 [1]
118 118 $ hgph
119 119 @ 3 draft a-D - b555f63b6063
120 120 |
121 121 o 2 public a-C - 54acac6f23ab
122 122 |
123 123 o 1 public a-B - 548a3d25dbf0
124 124 |
125 125 o 0 public a-A - 054250a37db4
126 126
127 127 $ hg push ../beta
128 128 pushing to ../beta
129 129 searching for changes
130 130 no changes found
131 131 test-debug-phase: move rev 3: 1 -> 0
132 132 [1]
133 133 $ hgph
134 134 @ 3 public a-D - b555f63b6063
135 135 |
136 136 o 2 public a-C - 54acac6f23ab
137 137 |
138 138 o 1 public a-B - 548a3d25dbf0
139 139 |
140 140 o 0 public a-A - 054250a37db4
141 141
142 142
143 143 update must update phase of common changeset too
144 144
145 145 $ hg pull ../beta # getting b-A
146 146 pulling from ../beta
147 147 searching for changes
148 148 adding changesets
149 149 adding manifests
150 150 adding file changes
151 151 added 1 changesets with 1 changes to 1 files (+1 heads)
152 152 new changesets f54f1bb90ff3
153 153 test-debug-phase: new rev 4: x -> 0
154 154 (run 'hg heads' to see heads, 'hg merge' to merge)
155 155
156 156 $ cd ../beta
157 157 $ hgph # not updated by remote pull
158 158 o 4 public a-D - b555f63b6063
159 159 |
160 160 o 3 public a-C - 54acac6f23ab
161 161 |
162 162 | @ 2 draft b-A - f54f1bb90ff3
163 163 |/
164 164 o 1 public a-B - 548a3d25dbf0
165 165 |
166 166 o 0 public a-A - 054250a37db4
167 167
168 168 $ hg pull ../alpha
169 169 pulling from ../alpha
170 170 searching for changes
171 171 no changes found
172 172 test-debug-phase: move rev 2: 1 -> 0
173 173 $ hgph
174 174 o 4 public a-D - b555f63b6063
175 175 |
176 176 o 3 public a-C - 54acac6f23ab
177 177 |
178 178 | @ 2 public b-A - f54f1bb90ff3
179 179 |/
180 180 o 1 public a-B - 548a3d25dbf0
181 181 |
182 182 o 0 public a-A - 054250a37db4
183 183
184 184
185 185 Publish configuration option
186 186 ----------------------------
187 187
188 188 Pull
189 189 ````
190 190
191 191 changegroup are added without phase movement
192 192
193 193 $ hg bundle -a ../base.bundle
194 194 5 changesets found
195 195 $ cd ..
196 196 $ hg init mu
197 197 $ cd mu
198 198 $ cat > .hg/hgrc << EOF
199 199 > [phases]
200 200 > publish=0
201 201 > EOF
202 202 $ hg unbundle ../base.bundle
203 203 adding changesets
204 204 adding manifests
205 205 adding file changes
206 206 added 5 changesets with 5 changes to 5 files (+1 heads)
207 207 new changesets 054250a37db4:b555f63b6063
208 208 test-debug-phase: new rev 0: x -> 1
209 209 test-debug-phase: new rev 1: x -> 1
210 210 test-debug-phase: new rev 2: x -> 1
211 211 test-debug-phase: new rev 3: x -> 1
212 212 test-debug-phase: new rev 4: x -> 1
213 213 (run 'hg heads' to see heads, 'hg merge' to merge)
214 214 $ hgph
215 215 o 4 draft a-D - b555f63b6063
216 216 |
217 217 o 3 draft a-C - 54acac6f23ab
218 218 |
219 219 | o 2 draft b-A - f54f1bb90ff3
220 220 |/
221 221 o 1 draft a-B - 548a3d25dbf0
222 222 |
223 223 o 0 draft a-A - 054250a37db4
224 224
225 225 $ cd ..
226 226
227 227 Pulling from publish=False to publish=False does not move boundary.
228 228
229 229 $ hg init nu
230 230 $ cd nu
231 231 $ cat > .hg/hgrc << EOF
232 232 > [phases]
233 233 > publish=0
234 234 > EOF
235 235 $ hg pull ../mu -r 54acac6f23ab
236 236 pulling from ../mu
237 237 adding changesets
238 238 adding manifests
239 239 adding file changes
240 240 added 3 changesets with 3 changes to 3 files
241 241 new changesets 054250a37db4:54acac6f23ab
242 242 test-debug-phase: new rev 0: x -> 1
243 243 test-debug-phase: new rev 1: x -> 1
244 244 test-debug-phase: new rev 2: x -> 1
245 245 (run 'hg update' to get a working copy)
246 246 $ hgph
247 247 o 2 draft a-C - 54acac6f23ab
248 248 |
249 249 o 1 draft a-B - 548a3d25dbf0
250 250 |
251 251 o 0 draft a-A - 054250a37db4
252 252
253 253
254 254 Even for common
255 255
256 256 $ hg pull ../mu -r f54f1bb90ff3
257 257 pulling from ../mu
258 258 searching for changes
259 259 adding changesets
260 260 adding manifests
261 261 adding file changes
262 262 added 1 changesets with 1 changes to 1 files (+1 heads)
263 263 new changesets f54f1bb90ff3
264 264 test-debug-phase: new rev 3: x -> 1
265 265 (run 'hg heads' to see heads, 'hg merge' to merge)
266 266 $ hgph
267 267 o 3 draft b-A - f54f1bb90ff3
268 268 |
269 269 | o 2 draft a-C - 54acac6f23ab
270 270 |/
271 271 o 1 draft a-B - 548a3d25dbf0
272 272 |
273 273 o 0 draft a-A - 054250a37db4
274 274
275 275
276 276
277 277 Pulling from Publish=True to Publish=False move boundary in common set.
278 278 we are in nu
279 279
280 280 $ hg pull ../alpha -r b555f63b6063
281 281 pulling from ../alpha
282 282 searching for changes
283 283 adding changesets
284 284 adding manifests
285 285 adding file changes
286 286 added 1 changesets with 1 changes to 1 files
287 287 new changesets b555f63b6063
288 288 test-debug-phase: move rev 0: 1 -> 0
289 289 test-debug-phase: move rev 1: 1 -> 0
290 290 test-debug-phase: move rev 2: 1 -> 0
291 291 test-debug-phase: new rev 4: x -> 0
292 292 (run 'hg update' to get a working copy)
293 293 $ hgph # f54f1bb90ff3 stay draft, not ancestor of -r
294 294 o 4 public a-D - b555f63b6063
295 295 |
296 296 | o 3 draft b-A - f54f1bb90ff3
297 297 | |
298 298 o | 2 public a-C - 54acac6f23ab
299 299 |/
300 300 o 1 public a-B - 548a3d25dbf0
301 301 |
302 302 o 0 public a-A - 054250a37db4
303 303
304 304
305 305 pulling from Publish=False to publish=False with some public
306 306
307 307 $ hg up -q f54f1bb90ff3
308 308 $ mkcommit n-A
309 309 test-debug-phase: new rev 5: x -> 1
310 310 $ mkcommit n-B
311 311 test-debug-phase: new rev 6: x -> 1
312 312 $ hgph
313 313 @ 6 draft n-B - 145e75495359
314 314 |
315 315 o 5 draft n-A - d6bcb4f74035
316 316 |
317 317 | o 4 public a-D - b555f63b6063
318 318 | |
319 319 o | 3 draft b-A - f54f1bb90ff3
320 320 | |
321 321 | o 2 public a-C - 54acac6f23ab
322 322 |/
323 323 o 1 public a-B - 548a3d25dbf0
324 324 |
325 325 o 0 public a-A - 054250a37db4
326 326
327 327 $ cd ../mu
328 328 $ hg pull ../nu
329 329 pulling from ../nu
330 330 searching for changes
331 331 adding changesets
332 332 adding manifests
333 333 adding file changes
334 334 added 2 changesets with 2 changes to 2 files
335 335 new changesets d6bcb4f74035:145e75495359
336 336 test-debug-phase: move rev 0: 1 -> 0
337 337 test-debug-phase: move rev 1: 1 -> 0
338 338 test-debug-phase: move rev 3: 1 -> 0
339 339 test-debug-phase: move rev 4: 1 -> 0
340 340 test-debug-phase: new rev 5: x -> 1
341 341 test-debug-phase: new rev 6: x -> 1
342 342 (run 'hg update' to get a working copy)
343 343 $ hgph
344 344 o 6 draft n-B - 145e75495359
345 345 |
346 346 o 5 draft n-A - d6bcb4f74035
347 347 |
348 348 | o 4 public a-D - b555f63b6063
349 349 | |
350 350 | o 3 public a-C - 54acac6f23ab
351 351 | |
352 352 o | 2 draft b-A - f54f1bb90ff3
353 353 |/
354 354 o 1 public a-B - 548a3d25dbf0
355 355 |
356 356 o 0 public a-A - 054250a37db4
357 357
358 358 $ cd ..
359 359
360 360 pulling into publish=True
361 361
362 362 $ cd alpha
363 363 $ hgph
364 364 o 4 public b-A - f54f1bb90ff3
365 365 |
366 366 | @ 3 public a-D - b555f63b6063
367 367 | |
368 368 | o 2 public a-C - 54acac6f23ab
369 369 |/
370 370 o 1 public a-B - 548a3d25dbf0
371 371 |
372 372 o 0 public a-A - 054250a37db4
373 373
374 374 $ hg pull ../mu
375 375 pulling from ../mu
376 376 searching for changes
377 377 adding changesets
378 378 adding manifests
379 379 adding file changes
380 380 added 2 changesets with 2 changes to 2 files
381 381 new changesets d6bcb4f74035:145e75495359
382 382 test-debug-phase: new rev 5: x -> 1
383 383 test-debug-phase: new rev 6: x -> 1
384 384 (run 'hg update' to get a working copy)
385 385 $ hgph
386 386 o 6 draft n-B - 145e75495359
387 387 |
388 388 o 5 draft n-A - d6bcb4f74035
389 389 |
390 390 o 4 public b-A - f54f1bb90ff3
391 391 |
392 392 | @ 3 public a-D - b555f63b6063
393 393 | |
394 394 | o 2 public a-C - 54acac6f23ab
395 395 |/
396 396 o 1 public a-B - 548a3d25dbf0
397 397 |
398 398 o 0 public a-A - 054250a37db4
399 399
400 400 $ cd ..
401 401
402 402 pulling back into original repo
403 403
404 404 $ cd nu
405 405 $ hg pull ../alpha
406 406 pulling from ../alpha
407 407 searching for changes
408 408 no changes found
409 409 test-debug-phase: move rev 3: 1 -> 0
410 410 test-debug-phase: move rev 5: 1 -> 0
411 411 test-debug-phase: move rev 6: 1 -> 0
412 412 $ hgph
413 413 @ 6 public n-B - 145e75495359
414 414 |
415 415 o 5 public n-A - d6bcb4f74035
416 416 |
417 417 | o 4 public a-D - b555f63b6063
418 418 | |
419 419 o | 3 public b-A - f54f1bb90ff3
420 420 | |
421 421 | o 2 public a-C - 54acac6f23ab
422 422 |/
423 423 o 1 public a-B - 548a3d25dbf0
424 424 |
425 425 o 0 public a-A - 054250a37db4
426 426
427 427
428 428 Push
429 429 ````
430 430
431 431 (inserted)
432 432
433 433 Test that phase are pushed even when they are nothing to pus
434 434 (this might be tested later bu are very convenient to not alter too much test)
435 435
436 436 Push back to alpha
437 437
438 438 $ hg push ../alpha # from nu
439 439 pushing to ../alpha
440 440 searching for changes
441 441 no changes found
442 442 test-debug-phase: move rev 5: 1 -> 0
443 443 test-debug-phase: move rev 6: 1 -> 0
444 444 [1]
445 445 $ cd ..
446 446 $ cd alpha
447 447 $ hgph
448 448 o 6 public n-B - 145e75495359
449 449 |
450 450 o 5 public n-A - d6bcb4f74035
451 451 |
452 452 o 4 public b-A - f54f1bb90ff3
453 453 |
454 454 | @ 3 public a-D - b555f63b6063
455 455 | |
456 456 | o 2 public a-C - 54acac6f23ab
457 457 |/
458 458 o 1 public a-B - 548a3d25dbf0
459 459 |
460 460 o 0 public a-A - 054250a37db4
461 461
462 462
463 463 (end insertion)
464 464
465 465
466 466 initial setup
467 467
468 468 $ hg log -G # of alpha
469 469 o changeset: 6:145e75495359
470 470 | tag: tip
471 471 | user: test
472 472 | date: Thu Jan 01 00:00:00 1970 +0000
473 473 | summary: n-B
474 474 |
475 475 o changeset: 5:d6bcb4f74035
476 476 | user: test
477 477 | date: Thu Jan 01 00:00:00 1970 +0000
478 478 | summary: n-A
479 479 |
480 480 o changeset: 4:f54f1bb90ff3
481 481 | parent: 1:548a3d25dbf0
482 482 | user: test
483 483 | date: Thu Jan 01 00:00:00 1970 +0000
484 484 | summary: b-A
485 485 |
486 486 | @ changeset: 3:b555f63b6063
487 487 | | user: test
488 488 | | date: Thu Jan 01 00:00:00 1970 +0000
489 489 | | summary: a-D
490 490 | |
491 491 | o changeset: 2:54acac6f23ab
492 492 |/ user: test
493 493 | date: Thu Jan 01 00:00:00 1970 +0000
494 494 | summary: a-C
495 495 |
496 496 o changeset: 1:548a3d25dbf0
497 497 | user: test
498 498 | date: Thu Jan 01 00:00:00 1970 +0000
499 499 | summary: a-B
500 500 |
501 501 o changeset: 0:054250a37db4
502 502 user: test
503 503 date: Thu Jan 01 00:00:00 1970 +0000
504 504 summary: a-A
505 505
506 506 $ mkcommit a-E
507 507 test-debug-phase: new rev 7: x -> 1
508 508 $ mkcommit a-F
509 509 test-debug-phase: new rev 8: x -> 1
510 510 $ mkcommit a-G
511 511 test-debug-phase: new rev 9: x -> 1
512 512 $ hg up d6bcb4f74035 -q
513 513 $ mkcommit a-H
514 514 test-debug-phase: new rev 10: x -> 1
515 515 created new head
516 516 $ hgph
517 517 @ 10 draft a-H - 967b449fbc94
518 518 |
519 519 | o 9 draft a-G - 3e27b6f1eee1
520 520 | |
521 521 | o 8 draft a-F - b740e3e5c05d
522 522 | |
523 523 | o 7 draft a-E - e9f537e46dea
524 524 | |
525 525 +---o 6 public n-B - 145e75495359
526 526 | |
527 527 o | 5 public n-A - d6bcb4f74035
528 528 | |
529 529 o | 4 public b-A - f54f1bb90ff3
530 530 | |
531 531 | o 3 public a-D - b555f63b6063
532 532 | |
533 533 | o 2 public a-C - 54acac6f23ab
534 534 |/
535 535 o 1 public a-B - 548a3d25dbf0
536 536 |
537 537 o 0 public a-A - 054250a37db4
538 538
539 539
540 540 Pulling from bundle does not alter phases of changeset not present in the bundle
541 541
542 #if repobundlerepo
542 543 $ hg bundle --base 1 -r 6 -r 3 ../partial-bundle.hg
543 544 5 changesets found
544 545 $ hg pull ../partial-bundle.hg
545 546 pulling from ../partial-bundle.hg
546 547 searching for changes
547 548 no changes found
548 549 $ hgph
549 550 @ 10 draft a-H - 967b449fbc94
550 551 |
551 552 | o 9 draft a-G - 3e27b6f1eee1
552 553 | |
553 554 | o 8 draft a-F - b740e3e5c05d
554 555 | |
555 556 | o 7 draft a-E - e9f537e46dea
556 557 | |
557 558 +---o 6 public n-B - 145e75495359
558 559 | |
559 560 o | 5 public n-A - d6bcb4f74035
560 561 | |
561 562 o | 4 public b-A - f54f1bb90ff3
562 563 | |
563 564 | o 3 public a-D - b555f63b6063
564 565 | |
565 566 | o 2 public a-C - 54acac6f23ab
566 567 |/
567 568 o 1 public a-B - 548a3d25dbf0
568 569 |
569 570 o 0 public a-A - 054250a37db4
570 571
572 #endif
571 573
572 574 Pushing to Publish=False (unknown changeset)
573 575
574 576 $ hg push ../mu -r b740e3e5c05d # a-F
575 577 pushing to ../mu
576 578 searching for changes
577 579 adding changesets
578 580 adding manifests
579 581 adding file changes
580 582 added 2 changesets with 2 changes to 2 files
581 583 test-debug-phase: new rev 7: x -> 1
582 584 test-debug-phase: new rev 8: x -> 1
583 585 $ hgph
584 586 @ 10 draft a-H - 967b449fbc94
585 587 |
586 588 | o 9 draft a-G - 3e27b6f1eee1
587 589 | |
588 590 | o 8 draft a-F - b740e3e5c05d
589 591 | |
590 592 | o 7 draft a-E - e9f537e46dea
591 593 | |
592 594 +---o 6 public n-B - 145e75495359
593 595 | |
594 596 o | 5 public n-A - d6bcb4f74035
595 597 | |
596 598 o | 4 public b-A - f54f1bb90ff3
597 599 | |
598 600 | o 3 public a-D - b555f63b6063
599 601 | |
600 602 | o 2 public a-C - 54acac6f23ab
601 603 |/
602 604 o 1 public a-B - 548a3d25dbf0
603 605 |
604 606 o 0 public a-A - 054250a37db4
605 607
606 608
607 609 $ cd ../mu
608 610 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
609 611 > # not ancestor of -r
610 612 o 8 draft a-F - b740e3e5c05d
611 613 |
612 614 o 7 draft a-E - e9f537e46dea
613 615 |
614 616 | o 6 draft n-B - 145e75495359
615 617 | |
616 618 | o 5 draft n-A - d6bcb4f74035
617 619 | |
618 620 o | 4 public a-D - b555f63b6063
619 621 | |
620 622 o | 3 public a-C - 54acac6f23ab
621 623 | |
622 624 | o 2 draft b-A - f54f1bb90ff3
623 625 |/
624 626 o 1 public a-B - 548a3d25dbf0
625 627 |
626 628 o 0 public a-A - 054250a37db4
627 629
628 630
629 631 Pushing to Publish=True (unknown changeset)
630 632
631 633 $ hg push ../beta -r b740e3e5c05d
632 634 pushing to ../beta
633 635 searching for changes
634 636 adding changesets
635 637 adding manifests
636 638 adding file changes
637 639 added 2 changesets with 2 changes to 2 files
638 640 test-debug-phase: new rev 5: x -> 0
639 641 test-debug-phase: new rev 6: x -> 0
640 642 test-debug-phase: move rev 7: 1 -> 0
641 643 test-debug-phase: move rev 8: 1 -> 0
642 644 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
643 645 > # not ancestor of -r
644 646 o 8 public a-F - b740e3e5c05d
645 647 |
646 648 o 7 public a-E - e9f537e46dea
647 649 |
648 650 | o 6 draft n-B - 145e75495359
649 651 | |
650 652 | o 5 draft n-A - d6bcb4f74035
651 653 | |
652 654 o | 4 public a-D - b555f63b6063
653 655 | |
654 656 o | 3 public a-C - 54acac6f23ab
655 657 | |
656 658 | o 2 draft b-A - f54f1bb90ff3
657 659 |/
658 660 o 1 public a-B - 548a3d25dbf0
659 661 |
660 662 o 0 public a-A - 054250a37db4
661 663
662 664
663 665 Pushing to Publish=True (common changeset)
664 666
665 667 $ cd ../beta
666 668 $ hg push ../alpha
667 669 pushing to ../alpha
668 670 searching for changes
669 671 no changes found
670 672 test-debug-phase: move rev 7: 1 -> 0
671 673 test-debug-phase: move rev 8: 1 -> 0
672 674 [1]
673 675 $ hgph
674 676 o 6 public a-F - b740e3e5c05d
675 677 |
676 678 o 5 public a-E - e9f537e46dea
677 679 |
678 680 o 4 public a-D - b555f63b6063
679 681 |
680 682 o 3 public a-C - 54acac6f23ab
681 683 |
682 684 | @ 2 public b-A - f54f1bb90ff3
683 685 |/
684 686 o 1 public a-B - 548a3d25dbf0
685 687 |
686 688 o 0 public a-A - 054250a37db4
687 689
688 690 $ cd ../alpha
689 691 $ hgph
690 692 @ 10 draft a-H - 967b449fbc94
691 693 |
692 694 | o 9 draft a-G - 3e27b6f1eee1
693 695 | |
694 696 | o 8 public a-F - b740e3e5c05d
695 697 | |
696 698 | o 7 public a-E - e9f537e46dea
697 699 | |
698 700 +---o 6 public n-B - 145e75495359
699 701 | |
700 702 o | 5 public n-A - d6bcb4f74035
701 703 | |
702 704 o | 4 public b-A - f54f1bb90ff3
703 705 | |
704 706 | o 3 public a-D - b555f63b6063
705 707 | |
706 708 | o 2 public a-C - 54acac6f23ab
707 709 |/
708 710 o 1 public a-B - 548a3d25dbf0
709 711 |
710 712 o 0 public a-A - 054250a37db4
711 713
712 714
713 715 Pushing to Publish=False (common changeset that change phase + unknown one)
714 716
715 717 $ hg push ../mu -r 967b449fbc94 -f
716 718 pushing to ../mu
717 719 searching for changes
718 720 adding changesets
719 721 adding manifests
720 722 adding file changes
721 723 added 1 changesets with 1 changes to 1 files (+1 heads)
722 724 test-debug-phase: move rev 2: 1 -> 0
723 725 test-debug-phase: move rev 5: 1 -> 0
724 726 test-debug-phase: new rev 9: x -> 1
725 727 $ hgph
726 728 @ 10 draft a-H - 967b449fbc94
727 729 |
728 730 | o 9 draft a-G - 3e27b6f1eee1
729 731 | |
730 732 | o 8 public a-F - b740e3e5c05d
731 733 | |
732 734 | o 7 public a-E - e9f537e46dea
733 735 | |
734 736 +---o 6 public n-B - 145e75495359
735 737 | |
736 738 o | 5 public n-A - d6bcb4f74035
737 739 | |
738 740 o | 4 public b-A - f54f1bb90ff3
739 741 | |
740 742 | o 3 public a-D - b555f63b6063
741 743 | |
742 744 | o 2 public a-C - 54acac6f23ab
743 745 |/
744 746 o 1 public a-B - 548a3d25dbf0
745 747 |
746 748 o 0 public a-A - 054250a37db4
747 749
748 750 $ cd ../mu
749 751 $ hgph # d6bcb4f74035 should have changed phase
750 752 > # 145e75495359 is still draft. not ancestor of -r
751 753 o 9 draft a-H - 967b449fbc94
752 754 |
753 755 | o 8 public a-F - b740e3e5c05d
754 756 | |
755 757 | o 7 public a-E - e9f537e46dea
756 758 | |
757 759 +---o 6 draft n-B - 145e75495359
758 760 | |
759 761 o | 5 public n-A - d6bcb4f74035
760 762 | |
761 763 | o 4 public a-D - b555f63b6063
762 764 | |
763 765 | o 3 public a-C - 54acac6f23ab
764 766 | |
765 767 o | 2 public b-A - f54f1bb90ff3
766 768 |/
767 769 o 1 public a-B - 548a3d25dbf0
768 770 |
769 771 o 0 public a-A - 054250a37db4
770 772
771 773
772 774
773 775 Pushing to Publish=True (common changeset from publish=False)
774 776
775 777 (in mu)
776 778 $ hg push ../alpha
777 779 pushing to ../alpha
778 780 searching for changes
779 781 no changes found
780 782 test-debug-phase: move rev 10: 1 -> 0
781 783 test-debug-phase: move rev 6: 1 -> 0
782 784 test-debug-phase: move rev 9: 1 -> 0
783 785 [1]
784 786 $ hgph
785 787 o 9 public a-H - 967b449fbc94
786 788 |
787 789 | o 8 public a-F - b740e3e5c05d
788 790 | |
789 791 | o 7 public a-E - e9f537e46dea
790 792 | |
791 793 +---o 6 public n-B - 145e75495359
792 794 | |
793 795 o | 5 public n-A - d6bcb4f74035
794 796 | |
795 797 | o 4 public a-D - b555f63b6063
796 798 | |
797 799 | o 3 public a-C - 54acac6f23ab
798 800 | |
799 801 o | 2 public b-A - f54f1bb90ff3
800 802 |/
801 803 o 1 public a-B - 548a3d25dbf0
802 804 |
803 805 o 0 public a-A - 054250a37db4
804 806
805 807 $ hgph -R ../alpha # a-H should have been synced to 0
806 808 @ 10 public a-H - 967b449fbc94
807 809 |
808 810 | o 9 draft a-G - 3e27b6f1eee1
809 811 | |
810 812 | o 8 public a-F - b740e3e5c05d
811 813 | |
812 814 | o 7 public a-E - e9f537e46dea
813 815 | |
814 816 +---o 6 public n-B - 145e75495359
815 817 | |
816 818 o | 5 public n-A - d6bcb4f74035
817 819 | |
818 820 o | 4 public b-A - f54f1bb90ff3
819 821 | |
820 822 | o 3 public a-D - b555f63b6063
821 823 | |
822 824 | o 2 public a-C - 54acac6f23ab
823 825 |/
824 826 o 1 public a-B - 548a3d25dbf0
825 827 |
826 828 o 0 public a-A - 054250a37db4
827 829
828 830
829 831
830 832 Bare push with next changeset and common changeset needing sync (issue3575)
831 833
832 834 (reset some stat on remote repo to avoid confusing other tests)
833 835
834 836 $ hg -R ../alpha --config extensions.strip= strip --no-backup 967b449fbc94
835 837 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
836 838 $ hg phase --force --draft b740e3e5c05d 967b449fbc94
837 839 test-debug-phase: move rev 8: 0 -> 1
838 840 test-debug-phase: move rev 9: 0 -> 1
839 841 $ hg push -fv ../alpha
840 842 pushing to ../alpha
841 843 searching for changes
842 844 1 changesets found
843 845 uncompressed size of bundle content:
844 846 178 (changelog)
845 847 165 (manifests)
846 848 131 a-H
847 849 adding changesets
848 850 adding manifests
849 851 adding file changes
850 852 added 1 changesets with 1 changes to 1 files (+1 heads)
851 853 test-debug-phase: new rev 10: x -> 0
852 854 test-debug-phase: move rev 8: 1 -> 0
853 855 test-debug-phase: move rev 9: 1 -> 0
854 856 $ hgph
855 857 o 9 public a-H - 967b449fbc94
856 858 |
857 859 | o 8 public a-F - b740e3e5c05d
858 860 | |
859 861 | o 7 public a-E - e9f537e46dea
860 862 | |
861 863 +---o 6 public n-B - 145e75495359
862 864 | |
863 865 o | 5 public n-A - d6bcb4f74035
864 866 | |
865 867 | o 4 public a-D - b555f63b6063
866 868 | |
867 869 | o 3 public a-C - 54acac6f23ab
868 870 | |
869 871 o | 2 public b-A - f54f1bb90ff3
870 872 |/
871 873 o 1 public a-B - 548a3d25dbf0
872 874 |
873 875 o 0 public a-A - 054250a37db4
874 876
875 877
876 878 $ hg -R ../alpha update 967b449fbc94 #for latter test consistency
877 879 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
878 880 $ hgph -R ../alpha
879 881 @ 10 public a-H - 967b449fbc94
880 882 |
881 883 | o 9 draft a-G - 3e27b6f1eee1
882 884 | |
883 885 | o 8 public a-F - b740e3e5c05d
884 886 | |
885 887 | o 7 public a-E - e9f537e46dea
886 888 | |
887 889 +---o 6 public n-B - 145e75495359
888 890 | |
889 891 o | 5 public n-A - d6bcb4f74035
890 892 | |
891 893 o | 4 public b-A - f54f1bb90ff3
892 894 | |
893 895 | o 3 public a-D - b555f63b6063
894 896 | |
895 897 | o 2 public a-C - 54acac6f23ab
896 898 |/
897 899 o 1 public a-B - 548a3d25dbf0
898 900 |
899 901 o 0 public a-A - 054250a37db4
900 902
901 903
902 904 Discovery locally secret changeset on a remote repository:
903 905
904 906 - should make it non-secret
905 907
906 908 $ cd ../alpha
907 909 $ mkcommit A-secret --config phases.new-commit=2
908 910 test-debug-phase: new rev 11: x -> 2
909 911 $ hgph
910 912 @ 11 secret A-secret - 435b5d83910c
911 913 |
912 914 o 10 public a-H - 967b449fbc94
913 915 |
914 916 | o 9 draft a-G - 3e27b6f1eee1
915 917 | |
916 918 | o 8 public a-F - b740e3e5c05d
917 919 | |
918 920 | o 7 public a-E - e9f537e46dea
919 921 | |
920 922 +---o 6 public n-B - 145e75495359
921 923 | |
922 924 o | 5 public n-A - d6bcb4f74035
923 925 | |
924 926 o | 4 public b-A - f54f1bb90ff3
925 927 | |
926 928 | o 3 public a-D - b555f63b6063
927 929 | |
928 930 | o 2 public a-C - 54acac6f23ab
929 931 |/
930 932 o 1 public a-B - 548a3d25dbf0
931 933 |
932 934 o 0 public a-A - 054250a37db4
933 935
934 936 $ hg bundle --base 'parents(.)' -r . ../secret-bundle.hg
935 937 1 changesets found
936 938 $ hg -R ../mu unbundle ../secret-bundle.hg
937 939 adding changesets
938 940 adding manifests
939 941 adding file changes
940 942 added 1 changesets with 1 changes to 1 files
941 943 new changesets 435b5d83910c
942 944 test-debug-phase: new rev 10: x -> 1
943 945 (run 'hg update' to get a working copy)
944 946 $ hgph -R ../mu
945 947 o 10 draft A-secret - 435b5d83910c
946 948 |
947 949 o 9 public a-H - 967b449fbc94
948 950 |
949 951 | o 8 public a-F - b740e3e5c05d
950 952 | |
951 953 | o 7 public a-E - e9f537e46dea
952 954 | |
953 955 +---o 6 public n-B - 145e75495359
954 956 | |
955 957 o | 5 public n-A - d6bcb4f74035
956 958 | |
957 959 | o 4 public a-D - b555f63b6063
958 960 | |
959 961 | o 3 public a-C - 54acac6f23ab
960 962 | |
961 963 o | 2 public b-A - f54f1bb90ff3
962 964 |/
963 965 o 1 public a-B - 548a3d25dbf0
964 966 |
965 967 o 0 public a-A - 054250a37db4
966 968
967 969 $ hg pull ../mu
968 970 pulling from ../mu
969 971 searching for changes
970 972 no changes found
971 973 test-debug-phase: move rev 11: 2 -> 1
972 974 $ hgph
973 975 @ 11 draft A-secret - 435b5d83910c
974 976 |
975 977 o 10 public a-H - 967b449fbc94
976 978 |
977 979 | o 9 draft a-G - 3e27b6f1eee1
978 980 | |
979 981 | o 8 public a-F - b740e3e5c05d
980 982 | |
981 983 | o 7 public a-E - e9f537e46dea
982 984 | |
983 985 +---o 6 public n-B - 145e75495359
984 986 | |
985 987 o | 5 public n-A - d6bcb4f74035
986 988 | |
987 989 o | 4 public b-A - f54f1bb90ff3
988 990 | |
989 991 | o 3 public a-D - b555f63b6063
990 992 | |
991 993 | o 2 public a-C - 54acac6f23ab
992 994 |/
993 995 o 1 public a-B - 548a3d25dbf0
994 996 |
995 997 o 0 public a-A - 054250a37db4
996 998
997 999
998 1000 pushing a locally public and draft changesets remotely secret should make them
999 1001 appear on the remote side.
1000 1002
1001 1003 $ hg -R ../mu phase --secret --force 967b449fbc94
1002 1004 test-debug-phase: move rev 9: 0 -> 2
1003 1005 test-debug-phase: move rev 10: 1 -> 2
1004 1006 $ hg push -r 435b5d83910c ../mu
1005 1007 pushing to ../mu
1006 1008 searching for changes
1007 1009 abort: push creates new remote head 435b5d83910c!
1008 1010 (merge or see 'hg help push' for details about pushing new heads)
1009 1011 [255]
1010 1012 $ hg push -fr 435b5d83910c ../mu # because the push will create new visible head
1011 1013 pushing to ../mu
1012 1014 searching for changes
1013 1015 adding changesets
1014 1016 adding manifests
1015 1017 adding file changes
1016 1018 added 0 changesets with 0 changes to 2 files
1017 1019 test-debug-phase: move rev 9: 2 -> 0
1018 1020 test-debug-phase: move rev 10: 2 -> 1
1019 1021 $ hgph -R ../mu
1020 1022 o 10 draft A-secret - 435b5d83910c
1021 1023 |
1022 1024 o 9 public a-H - 967b449fbc94
1023 1025 |
1024 1026 | o 8 public a-F - b740e3e5c05d
1025 1027 | |
1026 1028 | o 7 public a-E - e9f537e46dea
1027 1029 | |
1028 1030 +---o 6 public n-B - 145e75495359
1029 1031 | |
1030 1032 o | 5 public n-A - d6bcb4f74035
1031 1033 | |
1032 1034 | o 4 public a-D - b555f63b6063
1033 1035 | |
1034 1036 | o 3 public a-C - 54acac6f23ab
1035 1037 | |
1036 1038 o | 2 public b-A - f54f1bb90ff3
1037 1039 |/
1038 1040 o 1 public a-B - 548a3d25dbf0
1039 1041 |
1040 1042 o 0 public a-A - 054250a37db4
1041 1043
1042 1044
1043 1045 pull new changeset with common draft locally
1044 1046
1045 1047 $ hg up -q 967b449fbc94 # create a new root for draft
1046 1048 $ mkcommit 'alpha-more'
1047 1049 test-debug-phase: new rev 12: x -> 1
1048 1050 created new head
1049 1051 $ hg push -fr . ../mu
1050 1052 pushing to ../mu
1051 1053 searching for changes
1052 1054 adding changesets
1053 1055 adding manifests
1054 1056 adding file changes
1055 1057 added 1 changesets with 1 changes to 1 files (+1 heads)
1056 1058 test-debug-phase: new rev 11: x -> 1
1057 1059 $ cd ../mu
1058 1060 $ hg phase --secret --force 1c5cfd894796
1059 1061 test-debug-phase: move rev 11: 1 -> 2
1060 1062 $ hg up -q 435b5d83910c
1061 1063 $ mkcommit 'mu-more'
1062 1064 test-debug-phase: new rev 12: x -> 1
1063 1065 $ cd ../alpha
1064 1066 $ hg pull ../mu
1065 1067 pulling from ../mu
1066 1068 searching for changes
1067 1069 adding changesets
1068 1070 adding manifests
1069 1071 adding file changes
1070 1072 added 1 changesets with 1 changes to 1 files
1071 1073 new changesets 5237fb433fc8
1072 1074 test-debug-phase: new rev 13: x -> 1
1073 1075 (run 'hg update' to get a working copy)
1074 1076 $ hgph
1075 1077 o 13 draft mu-more - 5237fb433fc8
1076 1078 |
1077 1079 | @ 12 draft alpha-more - 1c5cfd894796
1078 1080 | |
1079 1081 o | 11 draft A-secret - 435b5d83910c
1080 1082 |/
1081 1083 o 10 public a-H - 967b449fbc94
1082 1084 |
1083 1085 | o 9 draft a-G - 3e27b6f1eee1
1084 1086 | |
1085 1087 | o 8 public a-F - b740e3e5c05d
1086 1088 | |
1087 1089 | o 7 public a-E - e9f537e46dea
1088 1090 | |
1089 1091 +---o 6 public n-B - 145e75495359
1090 1092 | |
1091 1093 o | 5 public n-A - d6bcb4f74035
1092 1094 | |
1093 1095 o | 4 public b-A - f54f1bb90ff3
1094 1096 | |
1095 1097 | o 3 public a-D - b555f63b6063
1096 1098 | |
1097 1099 | o 2 public a-C - 54acac6f23ab
1098 1100 |/
1099 1101 o 1 public a-B - 548a3d25dbf0
1100 1102 |
1101 1103 o 0 public a-A - 054250a37db4
1102 1104
1103 1105
1104 1106 Test that test are properly ignored on remote event when existing locally
1105 1107
1106 1108 $ cd ..
1107 1109 $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma
1108 1110 test-debug-phase: new rev 0: x -> 0
1109 1111 test-debug-phase: new rev 1: x -> 0
1110 1112 test-debug-phase: new rev 2: x -> 0
1111 1113 test-debug-phase: new rev 3: x -> 0
1112 1114 test-debug-phase: new rev 4: x -> 0
1113 1115
1114 1116 # pathological case are
1115 1117 #
1116 1118 # * secret remotely
1117 1119 # * known locally
1118 1120 # * repo have uncommon changeset
1119 1121
1120 1122 $ hg -R beta phase --secret --force f54f1bb90ff3
1121 1123 test-debug-phase: move rev 2: 0 -> 2
1122 1124 $ hg -R gamma phase --draft --force f54f1bb90ff3
1123 1125 test-debug-phase: move rev 2: 0 -> 1
1124 1126
1125 1127 $ cd gamma
1126 1128 $ hg pull ../beta
1127 1129 pulling from ../beta
1128 1130 searching for changes
1129 1131 adding changesets
1130 1132 adding manifests
1131 1133 adding file changes
1132 1134 added 2 changesets with 2 changes to 2 files
1133 1135 new changesets e9f537e46dea:b740e3e5c05d
1134 1136 test-debug-phase: new rev 5: x -> 0
1135 1137 test-debug-phase: new rev 6: x -> 0
1136 1138 (run 'hg update' to get a working copy)
1137 1139 $ hg phase f54f1bb90ff3
1138 1140 2: draft
1139 1141
1140 1142 same over the wire
1141 1143
1142 1144 $ cd ../beta
1143 1145 $ hg serve -p $HGPORT -d --pid-file=../beta.pid -E ../beta-error.log
1144 1146 $ cat ../beta.pid >> $DAEMON_PIDS
1145 1147 $ cd ../gamma
1146 1148
1147 1149 $ hg pull http://localhost:$HGPORT/ # bundle2+
1148 1150 pulling from http://localhost:$HGPORT/
1149 1151 searching for changes
1150 1152 no changes found
1151 1153 $ hg phase f54f1bb90ff3
1152 1154 2: draft
1153 1155
1154 1156 enforce bundle1
1155 1157
1156 1158 $ hg pull http://localhost:$HGPORT/ --config devel.legacy.exchange=bundle1
1157 1159 pulling from http://localhost:$HGPORT/
1158 1160 searching for changes
1159 1161 no changes found
1160 1162 $ hg phase f54f1bb90ff3
1161 1163 2: draft
1162 1164
1163 1165 check that secret local on both side are not synced to public
1164 1166
1165 1167 $ hg push -r b555f63b6063 http://localhost:$HGPORT/
1166 1168 pushing to http://localhost:$HGPORT/
1167 1169 searching for changes
1168 1170 no changes found
1169 1171 [1]
1170 1172 $ hg phase f54f1bb90ff3
1171 1173 2: draft
1172 1174
1173 1175 put the changeset in the draft state again
1174 1176 (first test after this one expect to be able to copy)
1175 1177
1176 1178 $ cd ..
1177 1179
1178 1180
1179 1181 Test Clone behavior
1180 1182
1181 1183 A. Clone without secret changeset
1182 1184
1183 1185 1. cloning non-publishing repository
1184 1186 (Phase should be preserved)
1185 1187
1186 1188 # make sure there is no secret so we can use a copy clone
1187 1189
1188 1190 $ hg -R mu phase --draft 'secret()'
1189 1191 test-debug-phase: move rev 11: 2 -> 1
1190 1192
1191 1193 $ hg clone -U mu Tau
1192 1194 $ hgph -R Tau
1193 1195 o 12 draft mu-more - 5237fb433fc8
1194 1196 |
1195 1197 | o 11 draft alpha-more - 1c5cfd894796
1196 1198 | |
1197 1199 o | 10 draft A-secret - 435b5d83910c
1198 1200 |/
1199 1201 o 9 public a-H - 967b449fbc94
1200 1202 |
1201 1203 | o 8 public a-F - b740e3e5c05d
1202 1204 | |
1203 1205 | o 7 public a-E - e9f537e46dea
1204 1206 | |
1205 1207 +---o 6 public n-B - 145e75495359
1206 1208 | |
1207 1209 o | 5 public n-A - d6bcb4f74035
1208 1210 | |
1209 1211 | o 4 public a-D - b555f63b6063
1210 1212 | |
1211 1213 | o 3 public a-C - 54acac6f23ab
1212 1214 | |
1213 1215 o | 2 public b-A - f54f1bb90ff3
1214 1216 |/
1215 1217 o 1 public a-B - 548a3d25dbf0
1216 1218 |
1217 1219 o 0 public a-A - 054250a37db4
1218 1220
1219 1221
1220 1222 2. cloning publishing repository
1221 1223
1222 1224 (everything should be public)
1223 1225
1224 1226 $ hg clone -U alpha Upsilon
1225 1227 $ hgph -R Upsilon
1226 1228 o 13 public mu-more - 5237fb433fc8
1227 1229 |
1228 1230 | o 12 public alpha-more - 1c5cfd894796
1229 1231 | |
1230 1232 o | 11 public A-secret - 435b5d83910c
1231 1233 |/
1232 1234 o 10 public a-H - 967b449fbc94
1233 1235 |
1234 1236 | o 9 public a-G - 3e27b6f1eee1
1235 1237 | |
1236 1238 | o 8 public a-F - b740e3e5c05d
1237 1239 | |
1238 1240 | o 7 public a-E - e9f537e46dea
1239 1241 | |
1240 1242 +---o 6 public n-B - 145e75495359
1241 1243 | |
1242 1244 o | 5 public n-A - d6bcb4f74035
1243 1245 | |
1244 1246 o | 4 public b-A - f54f1bb90ff3
1245 1247 | |
1246 1248 | o 3 public a-D - b555f63b6063
1247 1249 | |
1248 1250 | o 2 public a-C - 54acac6f23ab
1249 1251 |/
1250 1252 o 1 public a-B - 548a3d25dbf0
1251 1253 |
1252 1254 o 0 public a-A - 054250a37db4
1253 1255
1254 1256 #if unix-permissions no-root
1255 1257
1256 1258 Pushing From an unlockable repo
1257 1259 --------------------------------
1258 1260 (issue3684)
1259 1261
1260 1262 Unability to lock the source repo should not prevent the push. It will prevent
1261 1263 the retrieval of remote phase during push. For example, pushing to a publishing
1262 1264 server won't turn changeset public.
1263 1265
1264 1266 1. Test that push is not prevented
1265 1267
1266 1268 $ hg init Phi
1267 1269 $ cd Upsilon
1268 1270 $ chmod -R -w .hg
1269 1271 $ hg push ../Phi
1270 1272 pushing to ../Phi
1271 1273 searching for changes
1272 1274 adding changesets
1273 1275 adding manifests
1274 1276 adding file changes
1275 1277 added 14 changesets with 14 changes to 14 files (+3 heads)
1276 1278 test-debug-phase: new rev 0: x -> 0
1277 1279 test-debug-phase: new rev 1: x -> 0
1278 1280 test-debug-phase: new rev 2: x -> 0
1279 1281 test-debug-phase: new rev 3: x -> 0
1280 1282 test-debug-phase: new rev 4: x -> 0
1281 1283 test-debug-phase: new rev 5: x -> 0
1282 1284 test-debug-phase: new rev 6: x -> 0
1283 1285 test-debug-phase: new rev 7: x -> 0
1284 1286 test-debug-phase: new rev 8: x -> 0
1285 1287 test-debug-phase: new rev 9: x -> 0
1286 1288 test-debug-phase: new rev 10: x -> 0
1287 1289 test-debug-phase: new rev 11: x -> 0
1288 1290 test-debug-phase: new rev 12: x -> 0
1289 1291 test-debug-phase: new rev 13: x -> 0
1290 1292 $ chmod -R +w .hg
1291 1293
1292 1294 2. Test that failed phases movement are reported
1293 1295
1294 1296 $ hg phase --force --draft 3
1295 1297 test-debug-phase: move rev 3: 0 -> 1
1296 1298 test-debug-phase: move rev 7: 0 -> 1
1297 1299 test-debug-phase: move rev 8: 0 -> 1
1298 1300 test-debug-phase: move rev 9: 0 -> 1
1299 1301 $ chmod -R -w .hg
1300 1302 $ hg push ../Phi
1301 1303 pushing to ../Phi
1302 1304 searching for changes
1303 1305 no changes found
1304 1306 cannot lock source repo, skipping local public phase update
1305 1307 [1]
1306 1308 $ chmod -R +w .hg
1307 1309
1308 1310 $ cd ..
1309 1311
1310 1312 #endif
1311 1313
1312 1314 Test that clone behaves like pull and doesn't publish changesets as plain push
1313 1315 does. The conditional output accounts for changes in the conditional block
1314 1316 above.
1315 1317
1316 1318 #if unix-permissions no-root
1317 1319 $ hg -R Upsilon phase -q --force --draft 2
1318 1320 test-debug-phase: move rev 2: 0 -> 1
1319 1321 #else
1320 1322 $ hg -R Upsilon phase -q --force --draft 2
1321 1323 test-debug-phase: move rev 2: 0 -> 1
1322 1324 test-debug-phase: move rev 3: 0 -> 1
1323 1325 test-debug-phase: move rev 7: 0 -> 1
1324 1326 test-debug-phase: move rev 8: 0 -> 1
1325 1327 test-debug-phase: move rev 9: 0 -> 1
1326 1328 #endif
1327 1329
1328 1330 $ hg clone -q Upsilon Pi -r 7
1329 1331 test-debug-phase: new rev 0: x -> 0
1330 1332 test-debug-phase: new rev 1: x -> 0
1331 1333 test-debug-phase: new rev 2: x -> 0
1332 1334 test-debug-phase: new rev 3: x -> 0
1333 1335 test-debug-phase: new rev 4: x -> 0
1334 1336 $ hgph Upsilon -r 'min(draft())'
1335 1337 o 2 draft a-C - 54acac6f23ab
1336 1338 |
1337 1339 ~
1338 1340
1339 1341 $ hg -R Upsilon push Pi -r 7
1340 1342 pushing to Pi
1341 1343 searching for changes
1342 1344 no changes found
1343 1345 test-debug-phase: move rev 2: 1 -> 0
1344 1346 test-debug-phase: move rev 3: 1 -> 0
1345 1347 test-debug-phase: move rev 7: 1 -> 0
1346 1348 [1]
1347 1349 $ hgph Upsilon -r 'min(draft())'
1348 1350 o 8 draft a-F - b740e3e5c05d
1349 1351 |
1350 1352 ~
1351 1353
1352 1354 $ hg -R Upsilon push Pi -r 8
1353 1355 pushing to Pi
1354 1356 searching for changes
1355 1357 adding changesets
1356 1358 adding manifests
1357 1359 adding file changes
1358 1360 added 1 changesets with 1 changes to 1 files
1359 1361 test-debug-phase: new rev 5: x -> 0
1360 1362 test-debug-phase: move rev 8: 1 -> 0
1361 1363
1362 1364 $ hgph Upsilon -r 'min(draft())'
1363 1365 o 9 draft a-G - 3e27b6f1eee1
1364 1366 |
1365 1367 ~
@@ -1,1340 +1,1348 b''
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "strip=" >> $HGRCPATH
3 3 $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH
4 4
5 5 $ restore() {
6 6 > hg unbundle -q .hg/strip-backup/*
7 7 > rm .hg/strip-backup/*
8 8 > }
9 9 $ teststrip() {
10 10 > hg up -C $1
11 11 > echo % before update $1, strip $2
12 12 > hg parents
13 13 > hg --traceback strip $2
14 14 > echo % after update $1, strip $2
15 15 > hg parents
16 16 > restore
17 17 > }
18 18
19 19 $ hg init test
20 20 $ cd test
21 21
22 22 $ echo foo > bar
23 23 $ hg ci -Ama
24 24 adding bar
25 25
26 26 $ echo more >> bar
27 27 $ hg ci -Amb
28 28
29 29 $ echo blah >> bar
30 30 $ hg ci -Amc
31 31
32 32 $ hg up 1
33 33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 34 $ echo blah >> bar
35 35 $ hg ci -Amd
36 36 created new head
37 37
38 38 $ echo final >> bar
39 39 $ hg ci -Ame
40 40
41 41 $ hg log
42 42 changeset: 4:443431ffac4f
43 43 tag: tip
44 44 user: test
45 45 date: Thu Jan 01 00:00:00 1970 +0000
46 46 summary: e
47 47
48 48 changeset: 3:65bd5f99a4a3
49 49 parent: 1:ef3a871183d7
50 50 user: test
51 51 date: Thu Jan 01 00:00:00 1970 +0000
52 52 summary: d
53 53
54 54 changeset: 2:264128213d29
55 55 user: test
56 56 date: Thu Jan 01 00:00:00 1970 +0000
57 57 summary: c
58 58
59 59 changeset: 1:ef3a871183d7
60 60 user: test
61 61 date: Thu Jan 01 00:00:00 1970 +0000
62 62 summary: b
63 63
64 64 changeset: 0:9ab35a2d17cb
65 65 user: test
66 66 date: Thu Jan 01 00:00:00 1970 +0000
67 67 summary: a
68 68
69 69
70 70 $ teststrip 4 4
71 71 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 72 % before update 4, strip 4
73 73 changeset: 4:443431ffac4f
74 74 tag: tip
75 75 user: test
76 76 date: Thu Jan 01 00:00:00 1970 +0000
77 77 summary: e
78 78
79 79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 80 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
81 81 % after update 4, strip 4
82 82 changeset: 3:65bd5f99a4a3
83 83 tag: tip
84 84 parent: 1:ef3a871183d7
85 85 user: test
86 86 date: Thu Jan 01 00:00:00 1970 +0000
87 87 summary: d
88 88
89 89 $ teststrip 4 3
90 90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 91 % before update 4, strip 3
92 92 changeset: 4:443431ffac4f
93 93 tag: tip
94 94 user: test
95 95 date: Thu Jan 01 00:00:00 1970 +0000
96 96 summary: e
97 97
98 98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 99 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
100 100 % after update 4, strip 3
101 101 changeset: 1:ef3a871183d7
102 102 user: test
103 103 date: Thu Jan 01 00:00:00 1970 +0000
104 104 summary: b
105 105
106 106 $ teststrip 1 4
107 107 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 108 % before update 1, strip 4
109 109 changeset: 1:ef3a871183d7
110 110 user: test
111 111 date: Thu Jan 01 00:00:00 1970 +0000
112 112 summary: b
113 113
114 114 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
115 115 % after update 1, strip 4
116 116 changeset: 1:ef3a871183d7
117 117 user: test
118 118 date: Thu Jan 01 00:00:00 1970 +0000
119 119 summary: b
120 120
121 121 $ teststrip 4 2
122 122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 123 % before update 4, strip 2
124 124 changeset: 4:443431ffac4f
125 125 tag: tip
126 126 user: test
127 127 date: Thu Jan 01 00:00:00 1970 +0000
128 128 summary: e
129 129
130 130 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
131 131 % after update 4, strip 2
132 132 changeset: 3:443431ffac4f
133 133 tag: tip
134 134 user: test
135 135 date: Thu Jan 01 00:00:00 1970 +0000
136 136 summary: e
137 137
138 138 $ teststrip 4 1
139 139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 140 % before update 4, strip 1
141 141 changeset: 4:264128213d29
142 142 tag: tip
143 143 parent: 1:ef3a871183d7
144 144 user: test
145 145 date: Thu Jan 01 00:00:00 1970 +0000
146 146 summary: c
147 147
148 148 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 149 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
150 150 % after update 4, strip 1
151 151 changeset: 0:9ab35a2d17cb
152 152 tag: tip
153 153 user: test
154 154 date: Thu Jan 01 00:00:00 1970 +0000
155 155 summary: a
156 156
157 157 $ teststrip null 4
158 158 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
159 159 % before update null, strip 4
160 160 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
161 161 % after update null, strip 4
162 162
163 163 $ hg log
164 164 changeset: 4:264128213d29
165 165 tag: tip
166 166 parent: 1:ef3a871183d7
167 167 user: test
168 168 date: Thu Jan 01 00:00:00 1970 +0000
169 169 summary: c
170 170
171 171 changeset: 3:443431ffac4f
172 172 user: test
173 173 date: Thu Jan 01 00:00:00 1970 +0000
174 174 summary: e
175 175
176 176 changeset: 2:65bd5f99a4a3
177 177 user: test
178 178 date: Thu Jan 01 00:00:00 1970 +0000
179 179 summary: d
180 180
181 181 changeset: 1:ef3a871183d7
182 182 user: test
183 183 date: Thu Jan 01 00:00:00 1970 +0000
184 184 summary: b
185 185
186 186 changeset: 0:9ab35a2d17cb
187 187 user: test
188 188 date: Thu Jan 01 00:00:00 1970 +0000
189 189 summary: a
190 190
191 191 $ hg up -C 4
192 192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 193 $ hg parents
194 194 changeset: 4:264128213d29
195 195 tag: tip
196 196 parent: 1:ef3a871183d7
197 197 user: test
198 198 date: Thu Jan 01 00:00:00 1970 +0000
199 199 summary: c
200 200
201 201
202 202 $ hg --traceback strip 4
203 203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 204 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg
205 205 $ hg parents
206 206 changeset: 1:ef3a871183d7
207 207 user: test
208 208 date: Thu Jan 01 00:00:00 1970 +0000
209 209 summary: b
210 210
211 211 $ hg debugbundle .hg/strip-backup/*
212 212 Stream params: {Compression: BZ}
213 213 changegroup -- {nbchanges: 1, version: 02}
214 214 264128213d290d868c54642d13aeaa3675551a78
215 215 cache:rev-branch-cache -- {}
216 216 phase-heads -- {}
217 217 264128213d290d868c54642d13aeaa3675551a78 draft
218 218 $ hg unbundle .hg/strip-backup/*
219 219 adding changesets
220 220 adding manifests
221 221 adding file changes
222 222 added 1 changesets with 0 changes to 1 files (+1 heads)
223 223 new changesets 264128213d29
224 224 (run 'hg heads' to see heads, 'hg merge' to merge)
225 225 $ rm .hg/strip-backup/*
226 226 $ hg log --graph
227 227 o changeset: 4:264128213d29
228 228 | tag: tip
229 229 | parent: 1:ef3a871183d7
230 230 | user: test
231 231 | date: Thu Jan 01 00:00:00 1970 +0000
232 232 | summary: c
233 233 |
234 234 | o changeset: 3:443431ffac4f
235 235 | | user: test
236 236 | | date: Thu Jan 01 00:00:00 1970 +0000
237 237 | | summary: e
238 238 | |
239 239 | o changeset: 2:65bd5f99a4a3
240 240 |/ user: test
241 241 | date: Thu Jan 01 00:00:00 1970 +0000
242 242 | summary: d
243 243 |
244 244 @ changeset: 1:ef3a871183d7
245 245 | user: test
246 246 | date: Thu Jan 01 00:00:00 1970 +0000
247 247 | summary: b
248 248 |
249 249 o changeset: 0:9ab35a2d17cb
250 250 user: test
251 251 date: Thu Jan 01 00:00:00 1970 +0000
252 252 summary: a
253 253
254 254 $ hg up -C 2
255 255 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 256 $ hg merge 4
257 257 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 258 (branch merge, don't forget to commit)
259 259
260 260 before strip of merge parent
261 261
262 262 $ hg parents
263 263 changeset: 2:65bd5f99a4a3
264 264 user: test
265 265 date: Thu Jan 01 00:00:00 1970 +0000
266 266 summary: d
267 267
268 268 changeset: 4:264128213d29
269 269 tag: tip
270 270 parent: 1:ef3a871183d7
271 271 user: test
272 272 date: Thu Jan 01 00:00:00 1970 +0000
273 273 summary: c
274 274
275 275 $ hg strip 4
276 276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 277 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
278 278
279 279 after strip of merge parent
280 280
281 281 $ hg parents
282 282 changeset: 1:ef3a871183d7
283 283 user: test
284 284 date: Thu Jan 01 00:00:00 1970 +0000
285 285 summary: b
286 286
287 287 $ restore
288 288
289 289 $ hg up
290 290 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
291 291 updated to "264128213d29: c"
292 292 1 other heads for branch "default"
293 293 $ hg log -G
294 294 @ changeset: 4:264128213d29
295 295 | tag: tip
296 296 | parent: 1:ef3a871183d7
297 297 | user: test
298 298 | date: Thu Jan 01 00:00:00 1970 +0000
299 299 | summary: c
300 300 |
301 301 | o changeset: 3:443431ffac4f
302 302 | | user: test
303 303 | | date: Thu Jan 01 00:00:00 1970 +0000
304 304 | | summary: e
305 305 | |
306 306 | o changeset: 2:65bd5f99a4a3
307 307 |/ user: test
308 308 | date: Thu Jan 01 00:00:00 1970 +0000
309 309 | summary: d
310 310 |
311 311 o changeset: 1:ef3a871183d7
312 312 | user: test
313 313 | date: Thu Jan 01 00:00:00 1970 +0000
314 314 | summary: b
315 315 |
316 316 o changeset: 0:9ab35a2d17cb
317 317 user: test
318 318 date: Thu Jan 01 00:00:00 1970 +0000
319 319 summary: a
320 320
321 321
322 322 2 is parent of 3, only one strip should happen
323 323
324 324 $ hg strip "roots(2)" 3
325 325 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
326 326 $ hg log -G
327 327 @ changeset: 2:264128213d29
328 328 | tag: tip
329 329 | user: test
330 330 | date: Thu Jan 01 00:00:00 1970 +0000
331 331 | summary: c
332 332 |
333 333 o changeset: 1:ef3a871183d7
334 334 | user: test
335 335 | date: Thu Jan 01 00:00:00 1970 +0000
336 336 | summary: b
337 337 |
338 338 o changeset: 0:9ab35a2d17cb
339 339 user: test
340 340 date: Thu Jan 01 00:00:00 1970 +0000
341 341 summary: a
342 342
343 343 $ restore
344 344 $ hg log -G
345 345 o changeset: 4:443431ffac4f
346 346 | tag: tip
347 347 | user: test
348 348 | date: Thu Jan 01 00:00:00 1970 +0000
349 349 | summary: e
350 350 |
351 351 o changeset: 3:65bd5f99a4a3
352 352 | parent: 1:ef3a871183d7
353 353 | user: test
354 354 | date: Thu Jan 01 00:00:00 1970 +0000
355 355 | summary: d
356 356 |
357 357 | @ changeset: 2:264128213d29
358 358 |/ user: test
359 359 | date: Thu Jan 01 00:00:00 1970 +0000
360 360 | summary: c
361 361 |
362 362 o changeset: 1:ef3a871183d7
363 363 | user: test
364 364 | date: Thu Jan 01 00:00:00 1970 +0000
365 365 | summary: b
366 366 |
367 367 o changeset: 0:9ab35a2d17cb
368 368 user: test
369 369 date: Thu Jan 01 00:00:00 1970 +0000
370 370 summary: a
371 371
372 372 Failed hook while applying "saveheads" bundle.
373 373
374 374 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
375 375 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 376 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
377 377 transaction abort!
378 378 rollback completed
379 379 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
380 380 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
381 381 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
382 382 abort: pretxnchangegroup.bad hook exited with status 1
383 383 [255]
384 384 $ restore
385 385 $ hg log -G
386 386 o changeset: 4:443431ffac4f
387 387 | tag: tip
388 388 | user: test
389 389 | date: Thu Jan 01 00:00:00 1970 +0000
390 390 | summary: e
391 391 |
392 392 o changeset: 3:65bd5f99a4a3
393 393 | parent: 1:ef3a871183d7
394 394 | user: test
395 395 | date: Thu Jan 01 00:00:00 1970 +0000
396 396 | summary: d
397 397 |
398 398 | o changeset: 2:264128213d29
399 399 |/ user: test
400 400 | date: Thu Jan 01 00:00:00 1970 +0000
401 401 | summary: c
402 402 |
403 403 @ changeset: 1:ef3a871183d7
404 404 | user: test
405 405 | date: Thu Jan 01 00:00:00 1970 +0000
406 406 | summary: b
407 407 |
408 408 o changeset: 0:9ab35a2d17cb
409 409 user: test
410 410 date: Thu Jan 01 00:00:00 1970 +0000
411 411 summary: a
412 412
413 413
414 414 2 different branches: 2 strips
415 415
416 416 $ hg strip 2 4
417 417 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
418 418 $ hg log -G
419 419 o changeset: 2:65bd5f99a4a3
420 420 | tag: tip
421 421 | user: test
422 422 | date: Thu Jan 01 00:00:00 1970 +0000
423 423 | summary: d
424 424 |
425 425 @ changeset: 1:ef3a871183d7
426 426 | user: test
427 427 | date: Thu Jan 01 00:00:00 1970 +0000
428 428 | summary: b
429 429 |
430 430 o changeset: 0:9ab35a2d17cb
431 431 user: test
432 432 date: Thu Jan 01 00:00:00 1970 +0000
433 433 summary: a
434 434
435 435 $ restore
436 436
437 437 2 different branches and a common ancestor: 1 strip
438 438
439 439 $ hg strip 1 "2|4"
440 440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 441 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
442 442 $ restore
443 443
444 444 verify fncache is kept up-to-date
445 445
446 446 $ touch a
447 447 $ hg ci -qAm a
448 448 #if repofncache
449 449 $ cat .hg/store/fncache | sort
450 450 data/a.i
451 451 data/bar.i
452 452 #endif
453 453
454 454 $ hg strip tip
455 455 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
456 456 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
457 457 #if repofncache
458 458 $ cat .hg/store/fncache
459 459 data/bar.i
460 460 #endif
461 461
462 462 stripping an empty revset
463 463
464 464 $ hg strip "1 and not 1"
465 465 abort: empty revision set
466 466 [255]
467 467
468 468 remove branchy history for qimport tests
469 469
470 470 $ hg strip 3
471 471 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
472 472
473 473
474 474 strip of applied mq should cleanup status file
475 475
476 476 $ echo "mq=" >> $HGRCPATH
477 477 $ hg up -C 3
478 478 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
479 479 $ echo fooagain >> bar
480 480 $ hg ci -mf
481 481 $ hg qimport -r tip:2
482 482
483 483 applied patches before strip
484 484
485 485 $ hg qapplied
486 486 d
487 487 e
488 488 f
489 489
490 490 stripping revision in queue
491 491
492 492 $ hg strip 3
493 493 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
494 494 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
495 495
496 496 applied patches after stripping rev in queue
497 497
498 498 $ hg qapplied
499 499 d
500 500
501 501 stripping ancestor of queue
502 502
503 503 $ hg strip 1
504 504 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
505 505 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
506 506
507 507 applied patches after stripping ancestor of queue
508 508
509 509 $ hg qapplied
510 510
511 511 Verify strip protects against stripping wc parent when there are uncommitted mods
512 512
513 513 $ echo b > b
514 514 $ echo bb > bar
515 515 $ hg add b
516 516 $ hg ci -m 'b'
517 517 $ hg log --graph
518 518 @ changeset: 1:76dcf9fab855
519 519 | tag: tip
520 520 | user: test
521 521 | date: Thu Jan 01 00:00:00 1970 +0000
522 522 | summary: b
523 523 |
524 524 o changeset: 0:9ab35a2d17cb
525 525 user: test
526 526 date: Thu Jan 01 00:00:00 1970 +0000
527 527 summary: a
528 528
529 529 $ hg up 0
530 530 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
531 531 $ echo c > bar
532 532 $ hg up -t false
533 533 merging bar
534 534 merging bar failed!
535 535 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
536 536 use 'hg resolve' to retry unresolved file merges
537 537 [1]
538 538 $ hg sum
539 539 parent: 1:76dcf9fab855 tip
540 540 b
541 541 branch: default
542 542 commit: 1 modified, 1 unknown, 1 unresolved
543 543 update: (current)
544 544 phases: 2 draft
545 545 mq: 3 unapplied
546 546
547 547 $ echo c > b
548 548 $ hg strip tip
549 549 abort: local changes found
550 550 [255]
551 551 $ hg strip tip --keep
552 552 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
553 553 $ hg log --graph
554 554 @ changeset: 0:9ab35a2d17cb
555 555 tag: tip
556 556 user: test
557 557 date: Thu Jan 01 00:00:00 1970 +0000
558 558 summary: a
559 559
560 560 $ hg status
561 561 M bar
562 562 ? b
563 563 ? bar.orig
564 564
565 565 $ rm bar.orig
566 566 $ hg sum
567 567 parent: 0:9ab35a2d17cb tip
568 568 a
569 569 branch: default
570 570 commit: 1 modified, 1 unknown
571 571 update: (current)
572 572 phases: 1 draft
573 573 mq: 3 unapplied
574 574
575 575 Strip adds, removes, modifies with --keep
576 576
577 577 $ touch b
578 578 $ hg add b
579 579 $ hg commit -mb
580 580 $ touch c
581 581
582 582 ... with a clean working dir
583 583
584 584 $ hg add c
585 585 $ hg rm bar
586 586 $ hg commit -mc
587 587 $ hg status
588 588 $ hg strip --keep tip
589 589 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
590 590 $ hg status
591 591 ! bar
592 592 ? c
593 593
594 594 ... with a dirty working dir
595 595
596 596 $ hg add c
597 597 $ hg rm bar
598 598 $ hg commit -mc
599 599 $ hg status
600 600 $ echo b > b
601 601 $ echo d > d
602 602 $ hg strip --keep tip
603 603 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
604 604 $ hg status
605 605 M b
606 606 ! bar
607 607 ? c
608 608 ? d
609 609
610 610 ... after updating the dirstate
611 611 $ hg add c
612 612 $ hg commit -mc
613 613 $ hg rm c
614 614 $ hg commit -mc
615 615 $ hg strip --keep '.^' -q
616 616 $ cd ..
617 617
618 618 stripping many nodes on a complex graph (issue3299)
619 619
620 620 $ hg init issue3299
621 621 $ cd issue3299
622 622 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
623 623 $ hg strip 'not ancestors(x)'
624 624 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
625 625
626 626 test hg strip -B bookmark
627 627
628 628 $ cd ..
629 629 $ hg init bookmarks
630 630 $ cd bookmarks
631 631 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
632 632 $ hg bookmark -r 'a' 'todelete'
633 633 $ hg bookmark -r 'b' 'B'
634 634 $ hg bookmark -r 'b' 'nostrip'
635 635 $ hg bookmark -r 'c' 'delete'
636 636 $ hg bookmark -r 'd' 'multipledelete1'
637 637 $ hg bookmark -r 'e' 'multipledelete2'
638 638 $ hg bookmark -r 'f' 'singlenode1'
639 639 $ hg bookmark -r 'f' 'singlenode2'
640 640 $ hg up -C todelete
641 641 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
642 642 (activating bookmark todelete)
643 643 $ hg strip -B nostrip
644 644 bookmark 'nostrip' deleted
645 645 abort: empty revision set
646 646 [255]
647 647 $ hg strip -B todelete
648 648 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
649 649 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
650 650 bookmark 'todelete' deleted
651 651 $ hg id -ir dcbb326fdec2
652 652 abort: unknown revision 'dcbb326fdec2'!
653 653 [255]
654 654 $ hg id -ir d62d843c9a01
655 655 d62d843c9a01
656 656 $ hg bookmarks
657 657 B 9:ff43616e5d0f
658 658 delete 6:2702dd0c91e7
659 659 multipledelete1 11:e46a4836065c
660 660 multipledelete2 12:b4594d867745
661 661 singlenode1 13:43227190fef8
662 662 singlenode2 13:43227190fef8
663 663 $ hg strip -B multipledelete1 -B multipledelete2
664 664 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg
665 665 bookmark 'multipledelete1' deleted
666 666 bookmark 'multipledelete2' deleted
667 667 $ hg id -ir e46a4836065c
668 668 abort: unknown revision 'e46a4836065c'!
669 669 [255]
670 670 $ hg id -ir b4594d867745
671 671 abort: unknown revision 'b4594d867745'!
672 672 [255]
673 673 $ hg strip -B singlenode1 -B singlenode2
674 674 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg
675 675 bookmark 'singlenode1' deleted
676 676 bookmark 'singlenode2' deleted
677 677 $ hg id -ir 43227190fef8
678 678 abort: unknown revision '43227190fef8'!
679 679 [255]
680 680 $ hg strip -B unknownbookmark
681 681 abort: bookmark 'unknownbookmark' not found
682 682 [255]
683 683 $ hg strip -B unknownbookmark1 -B unknownbookmark2
684 684 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
685 685 [255]
686 686 $ hg strip -B delete -B unknownbookmark
687 687 abort: bookmark 'unknownbookmark' not found
688 688 [255]
689 689 $ hg strip -B delete
690 690 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
691 691 bookmark 'delete' deleted
692 692 $ hg id -ir 6:2702dd0c91e7
693 693 abort: unknown revision '2702dd0c91e7'!
694 694 [255]
695 695 $ hg update B
696 696 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
697 697 (activating bookmark B)
698 698 $ echo a > a
699 699 $ hg add a
700 700 $ hg strip -B B
701 701 abort: local changes found
702 702 [255]
703 703 $ hg bookmarks
704 704 * B 6:ff43616e5d0f
705 705
706 706 Make sure no one adds back a -b option:
707 707
708 708 $ hg strip -b tip
709 709 hg strip: option -b not recognized
710 710 hg strip [-k] [-f] [-B bookmark] [-r] REV...
711 711
712 712 strip changesets and all their descendants from the repository
713 713
714 714 (use 'hg help -e strip' to show help for the strip extension)
715 715
716 716 options ([+] can be repeated):
717 717
718 718 -r --rev REV [+] strip specified revision (optional, can specify
719 719 revisions without this option)
720 720 -f --force force removal of changesets, discard uncommitted
721 721 changes (no backup)
722 722 --no-backup no backups
723 723 -k --keep do not modify working directory during strip
724 724 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
725 725 --mq operate on patch repository
726 726
727 727 (use 'hg strip -h' to show more help)
728 728 [255]
729 729
730 730 $ cd ..
731 731
732 732 Verify bundles don't get overwritten:
733 733
734 734 $ hg init doublebundle
735 735 $ cd doublebundle
736 736 $ touch a
737 737 $ hg commit -Aqm a
738 738 $ touch b
739 739 $ hg commit -Aqm b
740 740 $ hg strip -r 0
741 741 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
742 742 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg
743 743 $ ls .hg/strip-backup
744 744 3903775176ed-e68910bd-backup.hg
745 #if repobundlerepo
745 746 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
746 747 $ hg strip -r 0
747 748 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg
748 749 $ ls .hg/strip-backup
749 750 3903775176ed-54390173-backup.hg
750 751 3903775176ed-e68910bd-backup.hg
752 #endif
751 753 $ cd ..
752 754
753 755 Test that we only bundle the stripped changesets (issue4736)
754 756 ------------------------------------------------------------
755 757
756 758 initialization (previous repo is empty anyway)
757 759
758 760 $ hg init issue4736
759 761 $ cd issue4736
760 762 $ echo a > a
761 763 $ hg add a
762 764 $ hg commit -m commitA
763 765 $ echo b > b
764 766 $ hg add b
765 767 $ hg commit -m commitB
766 768 $ echo c > c
767 769 $ hg add c
768 770 $ hg commit -m commitC
769 771 $ hg up 'desc(commitB)'
770 772 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
771 773 $ echo d > d
772 774 $ hg add d
773 775 $ hg commit -m commitD
774 776 created new head
775 777 $ hg up 'desc(commitC)'
776 778 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
777 779 $ hg merge 'desc(commitD)'
778 780 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
779 781 (branch merge, don't forget to commit)
780 782 $ hg ci -m 'mergeCD'
781 783 $ hg log -G
782 784 @ changeset: 4:d8db9d137221
783 785 |\ tag: tip
784 786 | | parent: 2:5c51d8d6557d
785 787 | | parent: 3:6625a5168474
786 788 | | user: test
787 789 | | date: Thu Jan 01 00:00:00 1970 +0000
788 790 | | summary: mergeCD
789 791 | |
790 792 | o changeset: 3:6625a5168474
791 793 | | parent: 1:eca11cf91c71
792 794 | | user: test
793 795 | | date: Thu Jan 01 00:00:00 1970 +0000
794 796 | | summary: commitD
795 797 | |
796 798 o | changeset: 2:5c51d8d6557d
797 799 |/ user: test
798 800 | date: Thu Jan 01 00:00:00 1970 +0000
799 801 | summary: commitC
800 802 |
801 803 o changeset: 1:eca11cf91c71
802 804 | user: test
803 805 | date: Thu Jan 01 00:00:00 1970 +0000
804 806 | summary: commitB
805 807 |
806 808 o changeset: 0:105141ef12d0
807 809 user: test
808 810 date: Thu Jan 01 00:00:00 1970 +0000
809 811 summary: commitA
810 812
811 813
812 814 Check bundle behavior:
813 815
814 816 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
815 817 2 changesets found
818 #if repobundlerepo
816 819 $ hg log -r 'bundle()' -R ../issue4736.hg
817 820 changeset: 3:6625a5168474
818 821 parent: 1:eca11cf91c71
819 822 user: test
820 823 date: Thu Jan 01 00:00:00 1970 +0000
821 824 summary: commitD
822 825
823 826 changeset: 4:d8db9d137221
824 827 tag: tip
825 828 parent: 2:5c51d8d6557d
826 829 parent: 3:6625a5168474
827 830 user: test
828 831 date: Thu Jan 01 00:00:00 1970 +0000
829 832 summary: mergeCD
830 833
834 #endif
831 835
832 836 check strip behavior
833 837
834 838 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
835 839 resolving manifests
836 840 branchmerge: False, force: True, partial: False
837 841 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
838 842 c: other deleted -> r
839 843 removing c
840 844 d: other deleted -> r
841 845 removing d
842 846 starting 4 threads for background file closing (?)
843 847 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
844 848 2 changesets found
845 849 list of changesets:
846 850 6625a516847449b6f0fa3737b9ba56e9f0f3032c
847 851 d8db9d1372214336d2b5570f20ee468d2c72fa8b
848 852 bundle2-output-bundle: "HG20", (1 params) 3 parts total
849 853 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
850 854 bundle2-output-part: "cache:rev-branch-cache" streamed payload
851 855 bundle2-output-part: "phase-heads" 24 bytes payload
852 856 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg
853 857 updating the branch cache
854 858 invalid branchheads cache (served): tip differs
855 859 $ hg log -G
856 860 o changeset: 2:5c51d8d6557d
857 861 | tag: tip
858 862 | user: test
859 863 | date: Thu Jan 01 00:00:00 1970 +0000
860 864 | summary: commitC
861 865 |
862 866 @ changeset: 1:eca11cf91c71
863 867 | user: test
864 868 | date: Thu Jan 01 00:00:00 1970 +0000
865 869 | summary: commitB
866 870 |
867 871 o changeset: 0:105141ef12d0
868 872 user: test
869 873 date: Thu Jan 01 00:00:00 1970 +0000
870 874 summary: commitA
871 875
872 876
873 877 strip backup content
874 878
879 #if repobundlerepo
875 880 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
876 881 changeset: 3:6625a5168474
877 882 parent: 1:eca11cf91c71
878 883 user: test
879 884 date: Thu Jan 01 00:00:00 1970 +0000
880 885 summary: commitD
881 886
882 887 changeset: 4:d8db9d137221
883 888 tag: tip
884 889 parent: 2:5c51d8d6557d
885 890 parent: 3:6625a5168474
886 891 user: test
887 892 date: Thu Jan 01 00:00:00 1970 +0000
888 893 summary: mergeCD
889 894
895
896 #endif
897
890 898 Check that the phase cache is properly invalidated after a strip with bookmark.
891 899
892 900 $ cat > ../stripstalephasecache.py << EOF
893 901 > from mercurial import extensions, localrepo
894 902 > def transactioncallback(orig, repo, desc, *args, **kwargs):
895 903 > def test(transaction):
896 904 > # observe cache inconsistency
897 905 > try:
898 906 > [repo.changelog.node(r) for r in repo.revs(b"not public()")]
899 907 > except IndexError:
900 908 > repo.ui.status(b"Index error!\n")
901 909 > transaction = orig(repo, desc, *args, **kwargs)
902 910 > # warm up the phase cache
903 911 > list(repo.revs(b"not public()"))
904 912 > if desc != b'strip':
905 913 > transaction.addpostclose(b"phase invalidation test", test)
906 914 > return transaction
907 915 > def extsetup(ui):
908 916 > extensions.wrapfunction(localrepo.localrepository, b"transaction",
909 917 > transactioncallback)
910 918 > EOF
911 919 $ hg up -C 2
912 920 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
913 921 $ echo k > k
914 922 $ hg add k
915 923 $ hg commit -m commitK
916 924 $ echo l > l
917 925 $ hg add l
918 926 $ hg commit -m commitL
919 927 $ hg book -r tip blah
920 928 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
921 929 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
922 930 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg
923 931 $ hg up -C 1
924 932 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
925 933
926 934 Error during post-close callback of the strip transaction
927 935 (They should be gracefully handled and reported)
928 936
929 937 $ cat > ../crashstrip.py << EOF
930 938 > from mercurial import error
931 939 > def reposetup(ui, repo):
932 940 > class crashstriprepo(repo.__class__):
933 941 > def transaction(self, desc, *args, **kwargs):
934 942 > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs)
935 943 > if desc == b'strip':
936 944 > def crash(tra): raise error.Abort(b'boom')
937 945 > tr.addpostclose(b'crash', crash)
938 946 > return tr
939 947 > repo.__class__ = crashstriprepo
940 948 > EOF
941 949 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
942 950 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg
943 951 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg'
944 952 abort: boom
945 953 [255]
946 954
947 955 test stripping a working directory parent doesn't switch named branches
948 956
949 957 $ hg log -G
950 958 @ changeset: 1:eca11cf91c71
951 959 | tag: tip
952 960 | user: test
953 961 | date: Thu Jan 01 00:00:00 1970 +0000
954 962 | summary: commitB
955 963 |
956 964 o changeset: 0:105141ef12d0
957 965 user: test
958 966 date: Thu Jan 01 00:00:00 1970 +0000
959 967 summary: commitA
960 968
961 969
962 970 $ hg branch new-branch
963 971 marked working directory as branch new-branch
964 972 (branches are permanent and global, did you want a bookmark?)
965 973 $ hg ci -m "start new branch"
966 974 $ echo 'foo' > foo.txt
967 975 $ hg ci -Aqm foo
968 976 $ hg up default
969 977 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
970 978 $ echo 'bar' > bar.txt
971 979 $ hg ci -Aqm bar
972 980 $ hg up new-branch
973 981 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
974 982 $ hg merge default
975 983 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
976 984 (branch merge, don't forget to commit)
977 985 $ hg log -G
978 986 @ changeset: 4:35358f982181
979 987 | tag: tip
980 988 | parent: 1:eca11cf91c71
981 989 | user: test
982 990 | date: Thu Jan 01 00:00:00 1970 +0000
983 991 | summary: bar
984 992 |
985 993 | @ changeset: 3:f62c6c09b707
986 994 | | branch: new-branch
987 995 | | user: test
988 996 | | date: Thu Jan 01 00:00:00 1970 +0000
989 997 | | summary: foo
990 998 | |
991 999 | o changeset: 2:b1d33a8cadd9
992 1000 |/ branch: new-branch
993 1001 | user: test
994 1002 | date: Thu Jan 01 00:00:00 1970 +0000
995 1003 | summary: start new branch
996 1004 |
997 1005 o changeset: 1:eca11cf91c71
998 1006 | user: test
999 1007 | date: Thu Jan 01 00:00:00 1970 +0000
1000 1008 | summary: commitB
1001 1009 |
1002 1010 o changeset: 0:105141ef12d0
1003 1011 user: test
1004 1012 date: Thu Jan 01 00:00:00 1970 +0000
1005 1013 summary: commitA
1006 1014
1007 1015
1008 1016 $ hg strip --force -r 35358f982181
1009 1017 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1010 1018 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-50d992d4-backup.hg
1011 1019 $ hg log -G
1012 1020 @ changeset: 3:f62c6c09b707
1013 1021 | branch: new-branch
1014 1022 | tag: tip
1015 1023 | user: test
1016 1024 | date: Thu Jan 01 00:00:00 1970 +0000
1017 1025 | summary: foo
1018 1026 |
1019 1027 o changeset: 2:b1d33a8cadd9
1020 1028 | branch: new-branch
1021 1029 | user: test
1022 1030 | date: Thu Jan 01 00:00:00 1970 +0000
1023 1031 | summary: start new branch
1024 1032 |
1025 1033 o changeset: 1:eca11cf91c71
1026 1034 | user: test
1027 1035 | date: Thu Jan 01 00:00:00 1970 +0000
1028 1036 | summary: commitB
1029 1037 |
1030 1038 o changeset: 0:105141ef12d0
1031 1039 user: test
1032 1040 date: Thu Jan 01 00:00:00 1970 +0000
1033 1041 summary: commitA
1034 1042
1035 1043
1036 1044 $ hg up default
1037 1045 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1038 1046 $ echo 'bar' > bar.txt
1039 1047 $ hg ci -Aqm bar
1040 1048 $ hg up new-branch
1041 1049 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1042 1050 $ hg merge default
1043 1051 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1044 1052 (branch merge, don't forget to commit)
1045 1053 $ hg ci -m merge
1046 1054 $ hg log -G
1047 1055 @ changeset: 5:4cf5e92caec2
1048 1056 |\ branch: new-branch
1049 1057 | | tag: tip
1050 1058 | | parent: 3:f62c6c09b707
1051 1059 | | parent: 4:35358f982181
1052 1060 | | user: test
1053 1061 | | date: Thu Jan 01 00:00:00 1970 +0000
1054 1062 | | summary: merge
1055 1063 | |
1056 1064 | o changeset: 4:35358f982181
1057 1065 | | parent: 1:eca11cf91c71
1058 1066 | | user: test
1059 1067 | | date: Thu Jan 01 00:00:00 1970 +0000
1060 1068 | | summary: bar
1061 1069 | |
1062 1070 o | changeset: 3:f62c6c09b707
1063 1071 | | branch: new-branch
1064 1072 | | user: test
1065 1073 | | date: Thu Jan 01 00:00:00 1970 +0000
1066 1074 | | summary: foo
1067 1075 | |
1068 1076 o | changeset: 2:b1d33a8cadd9
1069 1077 |/ branch: new-branch
1070 1078 | user: test
1071 1079 | date: Thu Jan 01 00:00:00 1970 +0000
1072 1080 | summary: start new branch
1073 1081 |
1074 1082 o changeset: 1:eca11cf91c71
1075 1083 | user: test
1076 1084 | date: Thu Jan 01 00:00:00 1970 +0000
1077 1085 | summary: commitB
1078 1086 |
1079 1087 o changeset: 0:105141ef12d0
1080 1088 user: test
1081 1089 date: Thu Jan 01 00:00:00 1970 +0000
1082 1090 summary: commitA
1083 1091
1084 1092
1085 1093 $ hg strip -r 35358f982181
1086 1094 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1087 1095 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1088 1096 $ hg log -G
1089 1097 @ changeset: 3:f62c6c09b707
1090 1098 | branch: new-branch
1091 1099 | tag: tip
1092 1100 | user: test
1093 1101 | date: Thu Jan 01 00:00:00 1970 +0000
1094 1102 | summary: foo
1095 1103 |
1096 1104 o changeset: 2:b1d33a8cadd9
1097 1105 | branch: new-branch
1098 1106 | user: test
1099 1107 | date: Thu Jan 01 00:00:00 1970 +0000
1100 1108 | summary: start new branch
1101 1109 |
1102 1110 o changeset: 1:eca11cf91c71
1103 1111 | user: test
1104 1112 | date: Thu Jan 01 00:00:00 1970 +0000
1105 1113 | summary: commitB
1106 1114 |
1107 1115 o changeset: 0:105141ef12d0
1108 1116 user: test
1109 1117 date: Thu Jan 01 00:00:00 1970 +0000
1110 1118 summary: commitA
1111 1119
1112 1120
1113 1121 $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1114 1122 adding changesets
1115 1123 adding manifests
1116 1124 adding file changes
1117 1125 added 2 changesets with 1 changes to 1 files
1118 1126 new changesets 35358f982181:4cf5e92caec2
1119 1127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1120 1128
1121 1129 $ hg strip -k -r 35358f982181
1122 1130 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1123 1131 $ hg log -G
1124 1132 @ changeset: 3:f62c6c09b707
1125 1133 | branch: new-branch
1126 1134 | tag: tip
1127 1135 | user: test
1128 1136 | date: Thu Jan 01 00:00:00 1970 +0000
1129 1137 | summary: foo
1130 1138 |
1131 1139 o changeset: 2:b1d33a8cadd9
1132 1140 | branch: new-branch
1133 1141 | user: test
1134 1142 | date: Thu Jan 01 00:00:00 1970 +0000
1135 1143 | summary: start new branch
1136 1144 |
1137 1145 o changeset: 1:eca11cf91c71
1138 1146 | user: test
1139 1147 | date: Thu Jan 01 00:00:00 1970 +0000
1140 1148 | summary: commitB
1141 1149 |
1142 1150 o changeset: 0:105141ef12d0
1143 1151 user: test
1144 1152 date: Thu Jan 01 00:00:00 1970 +0000
1145 1153 summary: commitA
1146 1154
1147 1155 $ hg diff
1148 1156 diff -r f62c6c09b707 bar.txt
1149 1157 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1150 1158 +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1151 1159 @@ -0,0 +1,1 @@
1152 1160 +bar
1153 1161
1154 1162 Use delayedstrip to strip inside a transaction
1155 1163
1156 1164 $ cd $TESTTMP
1157 1165 $ hg init delayedstrip
1158 1166 $ cd delayedstrip
1159 1167 $ hg debugdrawdag <<'EOS'
1160 1168 > D
1161 1169 > |
1162 1170 > C F H # Commit on top of "I",
1163 1171 > | |/| # Strip B+D+I+E+G+H+Z
1164 1172 > I B E G
1165 1173 > \|/
1166 1174 > A Z
1167 1175 > EOS
1168 1176 $ cp -R . ../scmutilcleanup
1169 1177
1170 1178 $ hg up -C I
1171 1179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1172 1180 $ echo 3 >> I
1173 1181 $ cat > $TESTTMP/delayedstrip.py <<EOF
1174 1182 > from __future__ import absolute_import
1175 1183 > from mercurial import commands, registrar, repair
1176 1184 > cmdtable = {}
1177 1185 > command = registrar.command(cmdtable)
1178 1186 > @command(b'testdelayedstrip')
1179 1187 > def testdelayedstrip(ui, repo):
1180 1188 > def getnodes(expr):
1181 1189 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1182 1190 > with repo.wlock():
1183 1191 > with repo.lock():
1184 1192 > with repo.transaction(b'delayedstrip'):
1185 1193 > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J')
1186 1194 > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I')
1187 1195 > commands.commit(ui, repo, message=b'J', date=b'0 0')
1188 1196 > EOF
1189 1197 $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py
1190 1198 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
1191 1199 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg
1192 1200
1193 1201 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
1194 1202 @ 6:2f2d51af6205 J
1195 1203 |
1196 1204 o 3:08ebfeb61bac I
1197 1205 |
1198 1206 | o 5:64a8289d2492 F
1199 1207 | |
1200 1208 | o 2:7fb047a69f22 E
1201 1209 |/
1202 1210 | o 4:26805aba1e60 C
1203 1211 | |
1204 1212 | o 1:112478962961 B
1205 1213 |/
1206 1214 o 0:426bada5c675 A
1207 1215
1208 1216 Test high-level scmutil.cleanupnodes API
1209 1217
1210 1218 $ cd $TESTTMP/scmutilcleanup
1211 1219 $ hg debugdrawdag <<'EOS'
1212 1220 > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G
1213 1221 > | | |
1214 1222 > C H G
1215 1223 > EOS
1216 1224 $ for i in B C D F G I Z; do
1217 1225 > hg bookmark -i -r $i b-$i
1218 1226 > done
1219 1227 $ hg bookmark -i -r E 'b-F@divergent1'
1220 1228 $ hg bookmark -i -r H 'b-F@divergent2'
1221 1229 $ hg bookmark -i -r G 'b-F@divergent3'
1222 1230 $ cp -R . ../scmutilcleanup.obsstore
1223 1231
1224 1232 $ cat > $TESTTMP/scmutilcleanup.py <<EOF
1225 1233 > from mercurial import registrar, scmutil
1226 1234 > cmdtable = {}
1227 1235 > command = registrar.command(cmdtable)
1228 1236 > @command(b'testnodescleanup')
1229 1237 > def testnodescleanup(ui, repo):
1230 1238 > def nodes(expr):
1231 1239 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1232 1240 > def node(expr):
1233 1241 > return nodes(expr)[0]
1234 1242 > with repo.wlock():
1235 1243 > with repo.lock():
1236 1244 > with repo.transaction(b'delayedstrip'):
1237 1245 > mapping = {node(b'F'): [node(b'F2')],
1238 1246 > node(b'D'): [node(b'D2')],
1239 1247 > node(b'G'): [node(b'G2')]}
1240 1248 > scmutil.cleanupnodes(repo, mapping, b'replace')
1241 1249 > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2'),
1242 1250 > b'replace')
1243 1251 > EOF
1244 1252 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1245 1253 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
1246 1254 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg
1247 1255
1248 1256 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1249 1257 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1250 1258 |
1251 1259 | o 7:d11b3456a873 F2 b-F
1252 1260 | |
1253 1261 | o 5:5cb05ba470a7 H
1254 1262 |/|
1255 1263 | o 3:7fb047a69f22 E b-F@divergent1
1256 1264 | |
1257 1265 | | o 6:7c78f703e465 D2 b-D
1258 1266 | | |
1259 1267 | | o 4:26805aba1e60 C
1260 1268 | | |
1261 1269 | | o 2:112478962961 B
1262 1270 | |/
1263 1271 o | 1:1fc8102cda62 G
1264 1272 /
1265 1273 o 0:426bada5c675 A b-B b-C b-I
1266 1274
1267 1275 $ hg bookmark
1268 1276 b-B 0:426bada5c675
1269 1277 b-C 0:426bada5c675
1270 1278 b-D 6:7c78f703e465
1271 1279 b-F 7:d11b3456a873
1272 1280 b-F@divergent1 3:7fb047a69f22
1273 1281 b-F@divergent3 8:1473d4b996d1
1274 1282 b-G 8:1473d4b996d1
1275 1283 b-I 0:426bada5c675
1276 1284 b-Z -1:000000000000
1277 1285
1278 1286 Test the above using obsstore "by the way". Not directly related to strip, but
1279 1287 we have reusable code here
1280 1288
1281 1289 $ cd $TESTTMP/scmutilcleanup.obsstore
1282 1290 $ cat >> .hg/hgrc <<EOF
1283 1291 > [experimental]
1284 1292 > evolution=true
1285 1293 > evolution.track-operation=1
1286 1294 > EOF
1287 1295
1288 1296 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1289 1297 4 new orphan changesets
1290 1298
1291 1299 $ rm .hg/localtags
1292 1300 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1293 1301 * 12:1473d4b996d1 G2 b-F@divergent3 b-G
1294 1302 |
1295 1303 | * 11:d11b3456a873 F2 b-F
1296 1304 | |
1297 1305 | * 8:5cb05ba470a7 H
1298 1306 |/|
1299 1307 | o 4:7fb047a69f22 E b-F@divergent1
1300 1308 | |
1301 1309 | | * 10:7c78f703e465 D2 b-D
1302 1310 | | |
1303 1311 | | x 6:26805aba1e60 C
1304 1312 | | |
1305 1313 | | x 3:112478962961 B
1306 1314 | |/
1307 1315 x | 1:1fc8102cda62 G
1308 1316 /
1309 1317 o 0:426bada5c675 A b-B b-C b-I
1310 1318
1311 1319 $ hg debugobsolete
1312 1320 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1313 1321 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1314 1322 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'replace', 'user': 'test'}
1315 1323 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1316 1324 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1317 1325 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1318 1326 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1319 1327 $ cd ..
1320 1328
1321 1329 Test that obsmarkers are restored even when not using generaldelta
1322 1330
1323 1331 $ hg --config format.usegeneraldelta=no init issue5678
1324 1332 $ cd issue5678
1325 1333 $ cat >> .hg/hgrc <<EOF
1326 1334 > [experimental]
1327 1335 > evolution=true
1328 1336 > EOF
1329 1337 $ echo a > a
1330 1338 $ hg ci -Aqm a
1331 1339 $ hg ci --amend -m a2
1332 1340 $ hg debugobsolete
1333 1341 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1334 1342 $ hg strip .
1335 1343 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1336 1344 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg
1337 1345 $ hg unbundle -q .hg/strip-backup/*
1338 1346 $ hg debugobsolete
1339 1347 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1340 1348 $ cd ..
@@ -1,1205 +1,1205 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extdiff]
3 3 > # for portability:
4 4 > pdiff = sh "$RUNTESTDIR/pdiff"
5 5 > [progress]
6 6 > disable=False
7 7 > assume-tty = 1
8 8 > delay = 0
9 9 > # set changedelay really large so we don't see nested topics
10 10 > changedelay = 30000
11 11 > format = topic bar number
12 12 > refresh = 0
13 13 > width = 60
14 14 > EOF
15 15
16 16 Preparing the subrepository 'sub2'
17 17
18 18 $ hg init sub2
19 19 $ echo sub2 > sub2/sub2
20 20 $ hg add -R sub2
21 21 adding sub2/sub2
22 22 $ hg commit -R sub2 -m "sub2 import"
23 23
24 24 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
25 25
26 26 $ hg init sub1
27 27 $ echo sub1 > sub1/sub1
28 28 $ echo "sub2 = ../sub2" > sub1/.hgsub
29 29 $ hg clone sub2 sub1/sub2
30 30 \r (no-eol) (esc)
31 31 linking [ <=> ] 1\r (no-eol) (esc)
32 32 linking [ <=> ] 2\r (no-eol) (esc)
33 33 linking [ <=> ] 3\r (no-eol) (esc)
34 34 linking [ <=> ] 4\r (no-eol) (esc)
35 35 linking [ <=> ] 5\r (no-eol) (esc)
36 36 linking [ <=> ] 6\r (no-eol) (esc)
37 37 \r (no-eol) (esc)
38 38 \r (no-eol) (esc)
39 39 updating [===========================================>] 1/1\r (no-eol) (esc)
40 40 \r (no-eol) (esc)
41 41 updating to branch default
42 42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 43 $ hg add -R sub1
44 44 adding sub1/.hgsub
45 45 adding sub1/sub1
46 46 $ hg commit -R sub1 -m "sub1 import"
47 47
48 48 Preparing the 'main' repo which depends on the subrepo 'sub1'
49 49
50 50 $ hg init main
51 51 $ echo main > main/main
52 52 $ echo "sub1 = ../sub1" > main/.hgsub
53 53 $ hg clone sub1 main/sub1
54 54 \r (no-eol) (esc)
55 55 linking [ <=> ] 1\r (no-eol) (esc)
56 56 linking [ <=> ] 2\r (no-eol) (esc)
57 57 linking [ <=> ] 3\r (no-eol) (esc)
58 58 linking [ <=> ] 4\r (no-eol) (esc)
59 59 linking [ <=> ] 5\r (no-eol) (esc)
60 60 linking [ <=> ] 6\r (no-eol) (esc)
61 61 linking [ <=> ] 7\r (no-eol) (esc)
62 62 linking [ <=> ] 8\r (no-eol) (esc)
63 63 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
64 64 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
65 65 \r (no-eol) (esc)
66 66 \r (no-eol) (esc)
67 67 updating [===========================================>] 3/3\r (no-eol) (esc)
68 68 \r (no-eol) (esc)
69 69 \r (no-eol) (esc)
70 70 linking [ <=> ] 1\r (no-eol) (esc)
71 71 linking [ <=> ] 2\r (no-eol) (esc)
72 72 linking [ <=> ] 3\r (no-eol) (esc)
73 73 linking [ <=> ] 4\r (no-eol) (esc)
74 74 linking [ <=> ] 5\r (no-eol) (esc)
75 75 linking [ <=> ] 6\r (no-eol) (esc)
76 76 updating [===========================================>] 1/1\r (no-eol) (esc)
77 77 \r (no-eol) (esc)
78 78 updating to branch default
79 79 cloning subrepo sub2 from $TESTTMP/sub2
80 80 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 81 $ hg add -R main
82 82 adding main/.hgsub
83 83 adding main/main
84 84 $ hg commit -R main -m "main import"
85 85
86 86 #if serve
87 87
88 88 Unfortunately, subrepos not at their nominal location cannot be cloned. But
89 89 they are still served from their location within the local repository. The only
90 90 reason why 'main' can be cloned via the filesystem is because 'sub1' and 'sub2'
91 91 are also available as siblings of 'main'.
92 92
93 93 $ hg serve -R main --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
94 94 adding = $TESTTMP/main
95 95 adding sub1 = $TESTTMP/main/sub1
96 96 adding sub1/sub2 = $TESTTMP/main/sub1/sub2
97 97 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
98 98 adding = $TESTTMP/main (?)
99 99 adding sub1 = $TESTTMP/main/sub1 (?)
100 100 adding sub1/sub2 = $TESTTMP/main/sub1/sub2 (?)
101 101 $ cat hg1.pid >> $DAEMON_PIDS
102 102
103 103 $ hg clone http://localhost:$HGPORT httpclone --config progress.disable=True
104 104 requesting all changes
105 105 adding changesets
106 106 adding manifests
107 107 adding file changes
108 108 added 1 changesets with 3 changes to 3 files
109 109 new changesets 7f491f53a367
110 110 updating to branch default
111 111 abort: HTTP Error 404: Not Found
112 112 [255]
113 113
114 114 $ cat access.log
115 115 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
116 116 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
117 117 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
118 118 * "GET /../sub1?cmd=capabilities HTTP/1.1" 404 - (glob)
119 119 $ cat error.log
120 120
121 121 $ killdaemons.py
122 122 $ rm hg1.pid error.log access.log
123 123 #endif
124 124
125 125 Cleaning both repositories, just as a clone -U
126 126
127 127 $ hg up -C -R sub2 null
128 128 \r (no-eol) (esc)
129 129 updating [===========================================>] 1/1\r (no-eol) (esc)
130 130 \r (no-eol) (esc)
131 131 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
132 132 $ hg up -C -R sub1 null
133 133 \r (no-eol) (esc)
134 134 updating [===========================================>] 1/1\r (no-eol) (esc)
135 135 \r (no-eol) (esc)
136 136 \r (no-eol) (esc)
137 137 updating [===========================================>] 3/3\r (no-eol) (esc)
138 138 \r (no-eol) (esc)
139 139 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
140 140 $ hg up -C -R main null
141 141 \r (no-eol) (esc)
142 142 updating [===========================================>] 1/1\r (no-eol) (esc)
143 143 \r (no-eol) (esc)
144 144 \r (no-eol) (esc)
145 145 updating [===========================================>] 3/3\r (no-eol) (esc)
146 146 \r (no-eol) (esc)
147 147 \r (no-eol) (esc)
148 148 updating [===========================================>] 3/3\r (no-eol) (esc)
149 149 \r (no-eol) (esc)
150 150 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
151 151 $ rm -rf main/sub1
152 152 $ rm -rf sub1/sub2
153 153
154 154 Clone main
155 155
156 156 $ hg --config extensions.largefiles= clone main cloned
157 157 \r (no-eol) (esc)
158 158 linking [ <=> ] 1\r (no-eol) (esc)
159 159 linking [ <=> ] 2\r (no-eol) (esc)
160 160 linking [ <=> ] 3\r (no-eol) (esc)
161 161 linking [ <=> ] 4\r (no-eol) (esc)
162 162 linking [ <=> ] 5\r (no-eol) (esc)
163 163 linking [ <=> ] 6\r (no-eol) (esc)
164 164 linking [ <=> ] 7\r (no-eol) (esc)
165 165 linking [ <=> ] 8\r (no-eol) (esc)
166 166 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
167 167 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
168 168 \r (no-eol) (esc)
169 169 \r (no-eol) (esc)
170 170 updating [===========================================>] 3/3\r (no-eol) (esc)
171 171 \r (no-eol) (esc)
172 172 \r (no-eol) (esc)
173 173 linking [ <=> ] 1\r (no-eol) (esc)
174 174 linking [ <=> ] 2\r (no-eol) (esc)
175 175 linking [ <=> ] 3\r (no-eol) (esc)
176 176 linking [ <=> ] 4\r (no-eol) (esc)
177 177 linking [ <=> ] 5\r (no-eol) (esc)
178 178 linking [ <=> ] 6\r (no-eol) (esc)
179 179 linking [ <=> ] 7\r (no-eol) (esc)
180 180 linking [ <=> ] 8\r (no-eol) (esc)
181 181 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
182 182 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
183 183 updating [===========================================>] 3/3\r (no-eol) (esc)
184 184 \r (no-eol) (esc)
185 185 \r (no-eol) (esc)
186 linking [ <=> ] 1\r (no-eol) (esc) (no-reposimplestore !)
187 linking [ <=> ] 2\r (no-eol) (esc) (no-reposimplestore !)
188 linking [ <=> ] 3\r (no-eol) (esc) (no-reposimplestore !)
189 linking [ <=> ] 4\r (no-eol) (esc) (no-reposimplestore !)
190 linking [ <=> ] 5\r (no-eol) (esc) (no-reposimplestore !)
191 linking [ <=> ] 6\r (no-eol) (esc) (no-reposimplestore !)
186 linking [ <=> ] 1\r (no-eol) (esc) (reporevlogstore !)
187 linking [ <=> ] 2\r (no-eol) (esc) (reporevlogstore !)
188 linking [ <=> ] 3\r (no-eol) (esc) (reporevlogstore !)
189 linking [ <=> ] 4\r (no-eol) (esc) (reporevlogstore !)
190 linking [ <=> ] 5\r (no-eol) (esc) (reporevlogstore !)
191 linking [ <=> ] 6\r (no-eol) (esc) (reporevlogstore !)
192 192 linking [ <=> ] 1\r (no-eol) (esc) (reposimplestore !)
193 193 linking [ <=> ] 2\r (no-eol) (esc) (reposimplestore !)
194 194 linking [ <=> ] 3\r (no-eol) (esc) (reposimplestore !)
195 195 linking [ <=> ] 4\r (no-eol) (esc) (reposimplestore !)
196 196 linking [ <=> ] 5\r (no-eol) (esc) (reposimplestore !)
197 197 linking [ <=> ] 6\r (no-eol) (esc) (reposimplestore !)
198 198 updating [===========================================>] 1/1\r (no-eol) (esc)
199 199 \r (no-eol) (esc)
200 200 updating to branch default
201 201 cloning subrepo sub1 from $TESTTMP/sub1
202 202 cloning subrepo sub1/sub2 from $TESTTMP/sub2
203 203 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 204
205 205 Largefiles is NOT enabled in the clone if the source repo doesn't require it
206 206 $ cat cloned/.hg/hgrc
207 207 # example repository config (see 'hg help config' for more info)
208 208 [paths]
209 209 default = $TESTTMP/main
210 210
211 211 # path aliases to other clones of this repo in URLs or filesystem paths
212 212 # (see 'hg help config.paths' for more info)
213 213 #
214 214 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
215 215 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
216 216 # my-clone = /home/jdoe/jdoes-clone
217 217
218 218 [ui]
219 219 # name and email (local to this repository, optional), e.g.
220 220 # username = Jane Doe <jdoe@example.com>
221 221
222 222 Checking cloned repo ids
223 223
224 224 $ printf "cloned " ; hg id -R cloned
225 225 cloned 7f491f53a367 tip
226 226 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
227 227 cloned/sub1 fc3b4ce2696f tip
228 228 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
229 229 cloned/sub1/sub2 c57a0840e3ba tip
230 230
231 231 debugsub output for main and sub1
232 232
233 233 $ hg debugsub -R cloned
234 234 path sub1
235 235 source ../sub1
236 236 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
237 237 $ hg debugsub -R cloned/sub1
238 238 path sub2
239 239 source ../sub2
240 240 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
241 241
242 242 Modifying deeply nested 'sub2'
243 243
244 244 $ echo modified > cloned/sub1/sub2/sub2
245 245 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
246 246 committing subrepository sub1
247 247 committing subrepository sub1/sub2
248 248
249 249 Checking modified node ids
250 250
251 251 $ printf "cloned " ; hg id -R cloned
252 252 cloned ffe6649062fe tip
253 253 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
254 254 cloned/sub1 2ecb03bf44a9 tip
255 255 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
256 256 cloned/sub1/sub2 53dd3430bcaf tip
257 257
258 258 debugsub output for main and sub1
259 259
260 260 $ hg debugsub -R cloned
261 261 path sub1
262 262 source ../sub1
263 263 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
264 264 $ hg debugsub -R cloned/sub1
265 265 path sub2
266 266 source ../sub2
267 267 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
268 268
269 269 Check that deep archiving works
270 270
271 271 $ cd cloned
272 272 $ echo 'test' > sub1/sub2/test.txt
273 273 $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
274 274 $ mkdir sub1/sub2/folder
275 275 $ echo 'subfolder' > sub1/sub2/folder/test.txt
276 276 $ hg ci -ASm "add test.txt"
277 277 adding sub1/sub2/folder/test.txt
278 278 committing subrepository sub1
279 279 committing subrepository sub1/sub2
280 280
281 281 $ rm -r main
282 282 $ hg archive -S -qr 'wdir()' ../wdir
283 283 $ cat ../wdir/.hg_archival.txt
284 284 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
285 285 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
286 286 branch: default
287 287 latesttag: null
288 288 latesttagdistance: 4
289 289 changessincelatesttag: 4
290 290 $ hg update -Cq .
291 291
292 292 A deleted subrepo file is flagged as dirty, like the top level repo
293 293
294 294 $ rm -r ../wdir sub1/sub2/folder/test.txt
295 295 $ hg archive -S -qr 'wdir()' ../wdir
296 296 $ cat ../wdir/.hg_archival.txt
297 297 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
298 298 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
299 299 branch: default
300 300 latesttag: null
301 301 latesttagdistance: 4
302 302 changessincelatesttag: 4
303 303 $ hg update -Cq .
304 304 $ rm -r ../wdir
305 305
306 306 $ hg archive -S -qr 'wdir()' ../wdir \
307 307 > --config 'experimental.archivemetatemplate=archived {node|short}\n'
308 308 $ cat ../wdir/.hg_archival.txt
309 309 archived ffffffffffff
310 310 $ rm -r ../wdir
311 311
312 312 .. but first take a detour through some deep removal testing
313 313
314 314 $ hg remove -S -I 're:.*.txt' .
315 315 \r (no-eol) (esc)
316 316 searching [==========================================>] 1/1\r (no-eol) (esc)
317 317 searching [==========================================>] 1/1\r (no-eol) (esc)
318 318 \r (no-eol) (esc)
319 319 \r (no-eol) (esc)
320 320 deleting [=====================> ] 1/2\r (no-eol) (esc)
321 321 \r (no-eol) (esc)
322 322 \r (no-eol) (esc)
323 323 deleting [===========================================>] 2/2\r (no-eol) (esc)
324 324 \r (no-eol) (esc)
325 325 removing sub1/sub2/folder/test.txt
326 326 removing sub1/sub2/test.txt
327 327 $ hg status -S
328 328 R sub1/sub2/folder/test.txt
329 329 R sub1/sub2/test.txt
330 330 $ hg update -Cq
331 331 $ hg remove -I 're:.*.txt' sub1
332 332 \r (no-eol) (esc)
333 333 searching [==========================================>] 1/1\r (no-eol) (esc)
334 334 \r (no-eol) (esc)
335 335 \r (no-eol) (esc)
336 336 deleting [===========================================>] 1/1\r (no-eol) (esc)
337 337 \r (no-eol) (esc)
338 338 $ hg status -S
339 339 $ hg remove sub1/sub2/folder/test.txt
340 340 \r (no-eol) (esc)
341 341 searching [==========================================>] 1/1\r (no-eol) (esc)
342 342 searching [==========================================>] 1/1\r (no-eol) (esc)
343 343 \r (no-eol) (esc)
344 344 \r (no-eol) (esc)
345 345 deleting [===========================================>] 1/1\r (no-eol) (esc)
346 346 \r (no-eol) (esc)
347 347 \r (no-eol) (esc)
348 348 deleting [===========================================>] 1/1\r (no-eol) (esc)
349 349 \r (no-eol) (esc)
350 350 \r (no-eol) (esc)
351 351 deleting [===========================================>] 1/1\r (no-eol) (esc)
352 352 \r (no-eol) (esc)
353 353 $ hg remove sub1/.hgsubstate
354 354 \r (no-eol) (esc)
355 355 searching [==========================================>] 1/1\r (no-eol) (esc)
356 356 \r (no-eol) (esc)
357 357 \r (no-eol) (esc)
358 358 deleting [===========================================>] 1/1\r (no-eol) (esc)
359 359 \r (no-eol) (esc)
360 360 \r (no-eol) (esc)
361 361 deleting [===========================================>] 1/1\r (no-eol) (esc)
362 362 \r (no-eol) (esc)
363 363 $ mv sub1/.hgsub sub1/x.hgsub
364 364 $ hg status -S
365 365 warning: subrepo spec file 'sub1/.hgsub' not found
366 366 R sub1/.hgsubstate
367 367 R sub1/sub2/folder/test.txt
368 368 ! sub1/.hgsub
369 369 ? sub1/x.hgsub
370 370 $ mv sub1/x.hgsub sub1/.hgsub
371 371 $ hg update -Cq
372 372 $ touch sub1/foo
373 373 $ hg forget sub1/sub2/folder/test.txt
374 374 $ rm sub1/sub2/test.txt
375 375
376 376 Test relative path printing + subrepos
377 377 $ mkdir -p foo/bar
378 378 $ cd foo
379 379 $ touch bar/abc
380 380 $ hg addremove -S ..
381 381 \r (no-eol) (esc)
382 382 searching for exact renames [ ] 0/1\r (no-eol) (esc)
383 383 \r (no-eol) (esc)
384 384 adding ../sub1/sub2/folder/test.txt
385 385 removing ../sub1/sub2/test.txt
386 386 adding ../sub1/foo
387 387 adding bar/abc
388 388 $ cd ..
389 389 $ hg status -S
390 390 A foo/bar/abc
391 391 A sub1/foo
392 392 R sub1/sub2/test.txt
393 393
394 394 Archive wdir() with subrepos
395 395 $ hg rm main
396 396 \r (no-eol) (esc)
397 397 deleting [===========================================>] 1/1\r (no-eol) (esc)
398 398 \r (no-eol) (esc)
399 399 $ hg archive -S -r 'wdir()' ../wdir
400 400 \r (no-eol) (esc)
401 401 archiving [ ] 0/3\r (no-eol) (esc)
402 402 archiving [=============> ] 1/3\r (no-eol) (esc)
403 403 archiving [===========================> ] 2/3\r (no-eol) (esc)
404 404 archiving [==========================================>] 3/3\r (no-eol) (esc)
405 405 \r (no-eol) (esc)
406 406 \r (no-eol) (esc)
407 407 archiving (sub1) [ ] 0/4\r (no-eol) (esc)
408 408 archiving (sub1) [========> ] 1/4\r (no-eol) (esc)
409 409 archiving (sub1) [=================> ] 2/4\r (no-eol) (esc)
410 410 archiving (sub1) [==========================> ] 3/4\r (no-eol) (esc)
411 411 archiving (sub1) [===================================>] 4/4\r (no-eol) (esc)
412 412 \r (no-eol) (esc)
413 413 \r (no-eol) (esc)
414 414 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
415 415 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
416 416 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
417 417 \r (no-eol) (esc)
418 418 $ diff -r . ../wdir | egrep -v '\.hg$|^Common subdirectories:'
419 419 Only in ../wdir: .hg_archival.txt
420 420
421 421 $ find ../wdir -type f | sort
422 422 ../wdir/.hg_archival.txt
423 423 ../wdir/.hgsub
424 424 ../wdir/.hgsubstate
425 425 ../wdir/foo/bar/abc
426 426 ../wdir/sub1/.hgsub
427 427 ../wdir/sub1/.hgsubstate
428 428 ../wdir/sub1/foo
429 429 ../wdir/sub1/sub1
430 430 ../wdir/sub1/sub2/folder/test.txt
431 431 ../wdir/sub1/sub2/sub2
432 432
433 433 $ cat ../wdir/.hg_archival.txt
434 434 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
435 435 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
436 436 branch: default
437 437 latesttag: null
438 438 latesttagdistance: 4
439 439 changessincelatesttag: 4
440 440
441 441 Attempting to archive 'wdir()' with a missing file is handled gracefully
442 442 $ rm sub1/sub1
443 443 $ rm -r ../wdir
444 444 $ hg archive -v -S -r 'wdir()' ../wdir
445 445 \r (no-eol) (esc)
446 446 archiving [ ] 0/3\r (no-eol) (esc)
447 447 archiving [=============> ] 1/3\r (no-eol) (esc)
448 448 archiving [===========================> ] 2/3\r (no-eol) (esc)
449 449 archiving [==========================================>] 3/3\r (no-eol) (esc)
450 450 \r (no-eol) (esc)
451 451 \r (no-eol) (esc)
452 452 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
453 453 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
454 454 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
455 455 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
456 456 \r (no-eol) (esc)
457 457 \r (no-eol) (esc)
458 458 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
459 459 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
460 460 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
461 461 \r (no-eol) (esc)
462 462 $ find ../wdir -type f | sort
463 463 ../wdir/.hg_archival.txt
464 464 ../wdir/.hgsub
465 465 ../wdir/.hgsubstate
466 466 ../wdir/foo/bar/abc
467 467 ../wdir/sub1/.hgsub
468 468 ../wdir/sub1/.hgsubstate
469 469 ../wdir/sub1/foo
470 470 ../wdir/sub1/sub2/folder/test.txt
471 471 ../wdir/sub1/sub2/sub2
472 472
473 473 Continue relative path printing + subrepos
474 474 $ hg update -Cq
475 475 $ rm -r ../wdir
476 476 $ hg archive -S -r 'wdir()' ../wdir
477 477 \r (no-eol) (esc)
478 478 archiving [ ] 0/3\r (no-eol) (esc)
479 479 archiving [=============> ] 1/3\r (no-eol) (esc)
480 480 archiving [===========================> ] 2/3\r (no-eol) (esc)
481 481 archiving [==========================================>] 3/3\r (no-eol) (esc)
482 482 \r (no-eol) (esc)
483 483 \r (no-eol) (esc)
484 484 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
485 485 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
486 486 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
487 487 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
488 488 \r (no-eol) (esc)
489 489 \r (no-eol) (esc)
490 490 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
491 491 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
492 492 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
493 493 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
494 494 \r (no-eol) (esc)
495 495 $ cat ../wdir/.hg_archival.txt
496 496 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
497 497 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd
498 498 branch: default
499 499 latesttag: null
500 500 latesttagdistance: 4
501 501 changessincelatesttag: 4
502 502
503 503 $ touch sub1/sub2/folder/bar
504 504 $ hg addremove sub1/sub2
505 505 adding sub1/sub2/folder/bar
506 506 $ hg status -S
507 507 A sub1/sub2/folder/bar
508 508 ? foo/bar/abc
509 509 ? sub1/foo
510 510 $ hg update -Cq
511 511 $ hg addremove sub1
512 512 adding sub1/sub2/folder/bar
513 513 adding sub1/foo
514 514 $ hg update -Cq
515 515 $ rm sub1/sub2/folder/test.txt
516 516 $ rm sub1/sub2/test.txt
517 517 $ hg ci -ASm "remove test.txt"
518 518 adding sub1/sub2/folder/bar
519 519 removing sub1/sub2/folder/test.txt
520 520 removing sub1/sub2/test.txt
521 521 adding sub1/foo
522 522 adding foo/bar/abc
523 523 committing subrepository sub1
524 524 committing subrepository sub1/sub2
525 525
526 526 $ hg forget sub1/sub2/sub2
527 527 $ echo x > sub1/sub2/x.txt
528 528 $ hg add sub1/sub2/x.txt
529 529
530 530 Files sees uncommitted adds and removes in subrepos
531 531 $ hg files -S
532 532 .hgsub
533 533 .hgsubstate
534 534 foo/bar/abc
535 535 main
536 536 sub1/.hgsub
537 537 sub1/.hgsubstate
538 538 sub1/foo
539 539 sub1/sub1
540 540 sub1/sub2/folder/bar
541 541 sub1/sub2/x.txt
542 542
543 543 $ hg files -S "set:eol('dos') or eol('unix') or size('<= 0')"
544 544 .hgsub
545 545 .hgsubstate
546 546 foo/bar/abc
547 547 main
548 548 sub1/.hgsub
549 549 sub1/.hgsubstate
550 550 sub1/foo
551 551 sub1/sub1
552 552 sub1/sub2/folder/bar
553 553 sub1/sub2/x.txt
554 554
555 555 $ hg files -r '.^' -S "set:eol('dos') or eol('unix')"
556 556 .hgsub
557 557 .hgsubstate
558 558 main
559 559 sub1/.hgsub
560 560 sub1/.hgsubstate
561 561 sub1/sub1
562 562 sub1/sub2/folder/test.txt
563 563 sub1/sub2/sub2
564 564 sub1/sub2/test.txt
565 565
566 566 $ hg files sub1
567 567 sub1/.hgsub
568 568 sub1/.hgsubstate
569 569 sub1/foo
570 570 sub1/sub1
571 571 sub1/sub2/folder/bar
572 572 sub1/sub2/x.txt
573 573
574 574 $ hg files sub1/sub2
575 575 sub1/sub2/folder/bar
576 576 sub1/sub2/x.txt
577 577
578 578 $ hg files
579 579 .hgsub
580 580 .hgsubstate
581 581 foo/bar/abc
582 582 main
583 583
584 584 $ hg files -S -r '.^' sub1/sub2/folder
585 585 sub1/sub2/folder/test.txt
586 586
587 587 $ hg files -S -r '.^' sub1/sub2/missing
588 588 sub1/sub2/missing: no such file in rev 78026e779ea6
589 589 [1]
590 590
591 591 $ hg files -r '.^' sub1/
592 592 sub1/.hgsub
593 593 sub1/.hgsubstate
594 594 sub1/sub1
595 595 sub1/sub2/folder/test.txt
596 596 sub1/sub2/sub2
597 597 sub1/sub2/test.txt
598 598
599 599 $ hg files -r '.^' sub1/sub2
600 600 sub1/sub2/folder/test.txt
601 601 sub1/sub2/sub2
602 602 sub1/sub2/test.txt
603 603
604 604 $ hg rollback -q
605 605 $ hg up -Cq
606 606
607 607 $ hg --config extensions.largefiles=! archive -S ../archive_all
608 608 \r (no-eol) (esc)
609 609 archiving [ ] 0/3\r (no-eol) (esc)
610 610 archiving [=============> ] 1/3\r (no-eol) (esc)
611 611 archiving [===========================> ] 2/3\r (no-eol) (esc)
612 612 archiving [==========================================>] 3/3\r (no-eol) (esc)
613 613 \r (no-eol) (esc)
614 614 \r (no-eol) (esc)
615 615 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
616 616 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
617 617 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
618 618 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
619 619 \r (no-eol) (esc)
620 620 \r (no-eol) (esc)
621 621 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
622 622 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
623 623 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
624 624 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
625 625 \r (no-eol) (esc)
626 626 $ find ../archive_all | sort
627 627 ../archive_all
628 628 ../archive_all/.hg_archival.txt
629 629 ../archive_all/.hgsub
630 630 ../archive_all/.hgsubstate
631 631 ../archive_all/main
632 632 ../archive_all/sub1
633 633 ../archive_all/sub1/.hgsub
634 634 ../archive_all/sub1/.hgsubstate
635 635 ../archive_all/sub1/sub1
636 636 ../archive_all/sub1/sub2
637 637 ../archive_all/sub1/sub2/folder
638 638 ../archive_all/sub1/sub2/folder/test.txt
639 639 ../archive_all/sub1/sub2/sub2
640 640 ../archive_all/sub1/sub2/test.txt
641 641
642 642 Check that archive -X works in deep subrepos
643 643
644 644 $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
645 645 \r (no-eol) (esc)
646 646 archiving [ ] 0/3\r (no-eol) (esc)
647 647 archiving [=============> ] 1/3\r (no-eol) (esc)
648 648 archiving [===========================> ] 2/3\r (no-eol) (esc)
649 649 archiving [==========================================>] 3/3\r (no-eol) (esc)
650 650 \r (no-eol) (esc)
651 651 \r (no-eol) (esc)
652 652 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
653 653 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
654 654 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
655 655 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
656 656 \r (no-eol) (esc)
657 657 \r (no-eol) (esc)
658 658 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
659 659 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
660 660 \r (no-eol) (esc)
661 661 $ find ../archive_exclude | sort
662 662 ../archive_exclude
663 663 ../archive_exclude/.hg_archival.txt
664 664 ../archive_exclude/.hgsub
665 665 ../archive_exclude/.hgsubstate
666 666 ../archive_exclude/main
667 667 ../archive_exclude/sub1
668 668 ../archive_exclude/sub1/.hgsub
669 669 ../archive_exclude/sub1/.hgsubstate
670 670 ../archive_exclude/sub1/sub1
671 671 ../archive_exclude/sub1/sub2
672 672 ../archive_exclude/sub1/sub2/sub2
673 673
674 674 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
675 675 \r (no-eol) (esc)
676 676 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
677 677 \r (no-eol) (esc)
678 678 \r (no-eol) (esc)
679 679 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
680 680 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
681 681 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
682 682 \r (no-eol) (esc)
683 683 $ find ../archive_include | sort
684 684 ../archive_include
685 685 ../archive_include/sub1
686 686 ../archive_include/sub1/sub2
687 687 ../archive_include/sub1/sub2/folder
688 688 ../archive_include/sub1/sub2/folder/test.txt
689 689 ../archive_include/sub1/sub2/test.txt
690 690
691 691 Check that deep archive works with largefiles (which overrides hgsubrepo impl)
692 692 This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
693 693 subrepos are archived properly.
694 694 Note that add --large through a subrepo currently adds the file as a normal file
695 695
696 696 $ echo "large" > sub1/sub2/large.bin
697 697 $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
698 698 $ echo "large" > large.bin
699 699 $ hg --config extensions.largefiles= add --large large.bin
700 700 $ hg --config extensions.largefiles= ci -S -m "add large files"
701 701 committing subrepository sub1
702 702 committing subrepository sub1/sub2
703 703
704 704 $ hg --config extensions.largefiles= archive -S ../archive_lf
705 705 $ find ../archive_lf | sort
706 706 ../archive_lf
707 707 ../archive_lf/.hg_archival.txt
708 708 ../archive_lf/.hgsub
709 709 ../archive_lf/.hgsubstate
710 710 ../archive_lf/large.bin
711 711 ../archive_lf/main
712 712 ../archive_lf/sub1
713 713 ../archive_lf/sub1/.hgsub
714 714 ../archive_lf/sub1/.hgsubstate
715 715 ../archive_lf/sub1/sub1
716 716 ../archive_lf/sub1/sub2
717 717 ../archive_lf/sub1/sub2/folder
718 718 ../archive_lf/sub1/sub2/folder/test.txt
719 719 ../archive_lf/sub1/sub2/large.bin
720 720 ../archive_lf/sub1/sub2/sub2
721 721 ../archive_lf/sub1/sub2/test.txt
722 722 $ rm -rf ../archive_lf
723 723
724 724 Exclude large files from main and sub-sub repo
725 725
726 726 $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
727 727 $ find ../archive_lf | sort
728 728 ../archive_lf
729 729 ../archive_lf/.hg_archival.txt
730 730 ../archive_lf/.hgsub
731 731 ../archive_lf/.hgsubstate
732 732 ../archive_lf/main
733 733 ../archive_lf/sub1
734 734 ../archive_lf/sub1/.hgsub
735 735 ../archive_lf/sub1/.hgsubstate
736 736 ../archive_lf/sub1/sub1
737 737 ../archive_lf/sub1/sub2
738 738 ../archive_lf/sub1/sub2/folder
739 739 ../archive_lf/sub1/sub2/folder/test.txt
740 740 ../archive_lf/sub1/sub2/sub2
741 741 ../archive_lf/sub1/sub2/test.txt
742 742 $ rm -rf ../archive_lf
743 743
744 744 Exclude normal files from main and sub-sub repo
745 745
746 746 $ hg --config extensions.largefiles= archive -S -X '**.txt' -p '.' ../archive_lf.tgz
747 747 $ tar -tzf ../archive_lf.tgz | sort
748 748 .hgsub
749 749 .hgsubstate
750 750 large.bin
751 751 main
752 752 sub1/.hgsub
753 753 sub1/.hgsubstate
754 754 sub1/sub1
755 755 sub1/sub2/large.bin
756 756 sub1/sub2/sub2
757 757
758 758 Include normal files from within a largefiles subrepo
759 759
760 760 $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
761 761 $ find ../archive_lf | sort
762 762 ../archive_lf
763 763 ../archive_lf/.hg_archival.txt
764 764 ../archive_lf/sub1
765 765 ../archive_lf/sub1/sub2
766 766 ../archive_lf/sub1/sub2/folder
767 767 ../archive_lf/sub1/sub2/folder/test.txt
768 768 ../archive_lf/sub1/sub2/test.txt
769 769 $ rm -rf ../archive_lf
770 770
771 771 Include large files from within a largefiles subrepo
772 772
773 773 $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
774 774 $ find ../archive_lf | sort
775 775 ../archive_lf
776 776 ../archive_lf/large.bin
777 777 ../archive_lf/sub1
778 778 ../archive_lf/sub1/sub2
779 779 ../archive_lf/sub1/sub2/large.bin
780 780 $ rm -rf ../archive_lf
781 781
782 782 Find an exact largefile match in a largefiles subrepo
783 783
784 784 $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
785 785 $ find ../archive_lf | sort
786 786 ../archive_lf
787 787 ../archive_lf/sub1
788 788 ../archive_lf/sub1/sub2
789 789 ../archive_lf/sub1/sub2/large.bin
790 790 $ rm -rf ../archive_lf
791 791
792 792 The local repo enables largefiles if a largefiles repo is cloned
793 793 $ hg showconfig extensions
794 794 abort: repository requires features unknown to this Mercurial: largefiles!
795 795 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
796 796 [255]
797 797 $ hg --config extensions.largefiles= clone -qU . ../lfclone
798 798 $ cat ../lfclone/.hg/hgrc
799 799 # example repository config (see 'hg help config' for more info)
800 800 [paths]
801 801 default = $TESTTMP/cloned
802 802
803 803 # path aliases to other clones of this repo in URLs or filesystem paths
804 804 # (see 'hg help config.paths' for more info)
805 805 #
806 806 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
807 807 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
808 808 # my-clone = /home/jdoe/jdoes-clone
809 809
810 810 [ui]
811 811 # name and email (local to this repository, optional), e.g.
812 812 # username = Jane Doe <jdoe@example.com>
813 813
814 814 [extensions]
815 815 largefiles=
816 816
817 817 Find an exact match to a standin (should archive nothing)
818 818 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
819 819 $ find ../archive_lf 2> /dev/null | sort
820 820
821 821 $ cat >> $HGRCPATH <<EOF
822 822 > [extensions]
823 823 > largefiles=
824 824 > [largefiles]
825 825 > patterns=glob:**.dat
826 826 > EOF
827 827
828 828 Test forget through a deep subrepo with the largefiles extension, both a
829 829 largefile and a normal file. Then a largefile that hasn't been committed yet.
830 830 $ touch sub1/sub2/untracked.txt
831 831 $ touch sub1/sub2/large.dat
832 832 $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt
833 833 not removing sub1/sub2/untracked.txt: file is already untracked
834 834 [1]
835 835 $ hg add --large --dry-run -v sub1/sub2/untracked.txt
836 836 adding sub1/sub2/untracked.txt as a largefile
837 837 $ hg add --large -v sub1/sub2/untracked.txt
838 838 adding sub1/sub2/untracked.txt as a largefile
839 839 $ hg add --normal -v sub1/sub2/large.dat
840 840 adding sub1/sub2/large.dat
841 841 $ hg forget -v sub1/sub2/untracked.txt
842 842 removing sub1/sub2/untracked.txt
843 843 $ hg status -S
844 844 A sub1/sub2/large.dat
845 845 R sub1/sub2/large.bin
846 846 R sub1/sub2/test.txt
847 847 ? foo/bar/abc
848 848 ? sub1/sub2/untracked.txt
849 849 ? sub1/sub2/x.txt
850 850 $ hg add sub1/sub2
851 851
852 852 $ hg archive -S -r 'wdir()' ../wdir2
853 853 $ diff -r . ../wdir2 | egrep -v '\.hg$|^Common subdirectories:'
854 854 Only in ../wdir2: .hg_archival.txt
855 855 Only in .: .hglf
856 856 Only in .: foo
857 857 Only in ./sub1/sub2: large.bin
858 858 Only in ./sub1/sub2: test.txt
859 859 Only in ./sub1/sub2: untracked.txt
860 860 Only in ./sub1/sub2: x.txt
861 861 $ find ../wdir2 -type f | sort
862 862 ../wdir2/.hg_archival.txt
863 863 ../wdir2/.hgsub
864 864 ../wdir2/.hgsubstate
865 865 ../wdir2/large.bin
866 866 ../wdir2/main
867 867 ../wdir2/sub1/.hgsub
868 868 ../wdir2/sub1/.hgsubstate
869 869 ../wdir2/sub1/sub1
870 870 ../wdir2/sub1/sub2/folder/test.txt
871 871 ../wdir2/sub1/sub2/large.dat
872 872 ../wdir2/sub1/sub2/sub2
873 873 $ hg status -S -mac -n | sort
874 874 .hgsub
875 875 .hgsubstate
876 876 large.bin
877 877 main
878 878 sub1/.hgsub
879 879 sub1/.hgsubstate
880 880 sub1/sub1
881 881 sub1/sub2/folder/test.txt
882 882 sub1/sub2/large.dat
883 883 sub1/sub2/sub2
884 884
885 885 $ hg ci -Sqm 'forget testing'
886 886
887 887 Test 'wdir()' modified file archiving with largefiles
888 888 $ echo 'mod' > main
889 889 $ echo 'mod' > large.bin
890 890 $ echo 'mod' > sub1/sub2/large.dat
891 891 $ hg archive -S -r 'wdir()' ../wdir3
892 892 $ diff -r . ../wdir3 | egrep -v '\.hg$|^Common subdirectories'
893 893 Only in ../wdir3: .hg_archival.txt
894 894 Only in .: .hglf
895 895 Only in .: foo
896 896 Only in ./sub1/sub2: large.bin
897 897 Only in ./sub1/sub2: test.txt
898 898 Only in ./sub1/sub2: untracked.txt
899 899 Only in ./sub1/sub2: x.txt
900 900 $ find ../wdir3 -type f | sort
901 901 ../wdir3/.hg_archival.txt
902 902 ../wdir3/.hgsub
903 903 ../wdir3/.hgsubstate
904 904 ../wdir3/large.bin
905 905 ../wdir3/main
906 906 ../wdir3/sub1/.hgsub
907 907 ../wdir3/sub1/.hgsubstate
908 908 ../wdir3/sub1/sub1
909 909 ../wdir3/sub1/sub2/folder/test.txt
910 910 ../wdir3/sub1/sub2/large.dat
911 911 ../wdir3/sub1/sub2/sub2
912 912 $ hg up -Cq
913 913
914 914 Test issue4330: commit a directory where only normal files have changed
915 915 $ touch foo/bar/large.dat
916 916 $ hg add --large foo/bar/large.dat
917 917 $ hg ci -m 'add foo/bar/large.dat'
918 918 $ touch a.txt
919 919 $ touch a.dat
920 920 $ hg add -v foo/bar/abc a.txt a.dat
921 921 adding a.dat as a largefile
922 922 adding a.txt
923 923 adding foo/bar/abc
924 924 $ hg ci -m 'dir commit with only normal file deltas' foo/bar
925 925 $ hg status
926 926 A a.dat
927 927 A a.txt
928 928
929 929 Test a directory commit with a changed largefile and a changed normal file
930 930 $ echo changed > foo/bar/large.dat
931 931 $ echo changed > foo/bar/abc
932 932 $ hg ci -m 'dir commit with normal and lf file deltas' foo
933 933 $ hg status
934 934 A a.dat
935 935 A a.txt
936 936
937 937 $ hg ci -m "add a.*"
938 938 $ hg mv a.dat b.dat
939 939 $ hg mv foo/bar/abc foo/bar/def
940 940 $ hg status -C
941 941 A b.dat
942 942 a.dat
943 943 A foo/bar/def
944 944 foo/bar/abc
945 945 R a.dat
946 946 R foo/bar/abc
947 947
948 948 $ hg ci -m "move large and normal"
949 949 $ hg status -C --rev '.^' --rev .
950 950 A b.dat
951 951 a.dat
952 952 A foo/bar/def
953 953 foo/bar/abc
954 954 R a.dat
955 955 R foo/bar/abc
956 956
957 957
958 958 $ echo foo > main
959 959 $ hg ci -m "mod parent only"
960 960 $ hg init sub3
961 961 $ echo "sub3 = sub3" >> .hgsub
962 962 $ echo xyz > sub3/a.txt
963 963 $ hg add sub3/a.txt
964 964 $ hg ci -Sm "add sub3"
965 965 committing subrepository sub3
966 966 $ cat .hgsub | grep -v sub3 > .hgsub1
967 967 $ mv .hgsub1 .hgsub
968 968 $ hg ci -m "remove sub3"
969 969
970 970 $ hg log -r "subrepo()" --style compact
971 971 0 7f491f53a367 1970-01-01 00:00 +0000 test
972 972 main import
973 973
974 974 1 ffe6649062fe 1970-01-01 00:00 +0000 test
975 975 deep nested modif should trigger a commit
976 976
977 977 2 9bb10eebee29 1970-01-01 00:00 +0000 test
978 978 add test.txt
979 979
980 980 3 7c64f035294f 1970-01-01 00:00 +0000 test
981 981 add large files
982 982
983 983 4 f734a59e2e35 1970-01-01 00:00 +0000 test
984 984 forget testing
985 985
986 986 11 9685a22af5db 1970-01-01 00:00 +0000 test
987 987 add sub3
988 988
989 989 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
990 990 remove sub3
991 991
992 992 $ hg log -r "subrepo('sub3')" --style compact
993 993 11 9685a22af5db 1970-01-01 00:00 +0000 test
994 994 add sub3
995 995
996 996 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
997 997 remove sub3
998 998
999 999 $ hg log -r "subrepo('bogus')" --style compact
1000 1000
1001 1001
1002 1002 Test .hgsubstate in the R state
1003 1003
1004 1004 $ hg rm .hgsub .hgsubstate
1005 1005 \r (no-eol) (esc)
1006 1006 deleting [=====================> ] 1/2\r (no-eol) (esc)
1007 1007 deleting [===========================================>] 2/2\r (no-eol) (esc)
1008 1008 \r (no-eol) (esc)
1009 1009 $ hg ci -m 'trash subrepo tracking'
1010 1010
1011 1011 $ hg log -r "subrepo('re:sub\d+')" --style compact
1012 1012 0 7f491f53a367 1970-01-01 00:00 +0000 test
1013 1013 main import
1014 1014
1015 1015 1 ffe6649062fe 1970-01-01 00:00 +0000 test
1016 1016 deep nested modif should trigger a commit
1017 1017
1018 1018 2 9bb10eebee29 1970-01-01 00:00 +0000 test
1019 1019 add test.txt
1020 1020
1021 1021 3 7c64f035294f 1970-01-01 00:00 +0000 test
1022 1022 add large files
1023 1023
1024 1024 4 f734a59e2e35 1970-01-01 00:00 +0000 test
1025 1025 forget testing
1026 1026
1027 1027 11 9685a22af5db 1970-01-01 00:00 +0000 test
1028 1028 add sub3
1029 1029
1030 1030 12 2e0485b475b9 1970-01-01 00:00 +0000 test
1031 1031 remove sub3
1032 1032
1033 1033 13[tip] a68b2c361653 1970-01-01 00:00 +0000 test
1034 1034 trash subrepo tracking
1035 1035
1036 1036
1037 1037 Restore the trashed subrepo tracking
1038 1038
1039 1039 $ hg rollback -q
1040 1040 $ hg update -Cq .
1041 1041
1042 1042 Interaction with extdiff, largefiles and subrepos
1043 1043
1044 1044 $ hg --config extensions.extdiff= pdiff -S
1045 1045
1046 1046 $ hg --config extensions.extdiff= pdiff -r '.^' -S
1047 1047 \r (no-eol) (esc)
1048 1048 archiving [ ] 0/2\r (no-eol) (esc)
1049 1049 archiving [====================> ] 1/2\r (no-eol) (esc)
1050 1050 archiving [==========================================>] 2/2\r (no-eol) (esc)
1051 1051 \r (no-eol) (esc)
1052 1052 \r (no-eol) (esc)
1053 1053 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1054 1054 \r (no-eol) (esc)
1055 1055 \r (no-eol) (esc)
1056 1056 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1057 1057 \r (no-eol) (esc)
1058 1058 \r (no-eol) (esc)
1059 1059 archiving (sub3) [ <=> ] 0\r (no-eol) (esc)
1060 1060 \r (no-eol) (esc)
1061 1061 \r (no-eol) (esc)
1062 1062 archiving [ ] 0/2\r (no-eol) (esc)
1063 1063 archiving [====================> ] 1/2\r (no-eol) (esc)
1064 1064 archiving [==========================================>] 2/2\r (no-eol) (esc)
1065 1065 \r (no-eol) (esc)
1066 1066 \r (no-eol) (esc)
1067 1067 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1068 1068 \r (no-eol) (esc)
1069 1069 \r (no-eol) (esc)
1070 1070 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1071 1071 \r (no-eol) (esc)
1072 1072 diff -Nru cloned.*/.hgsub cloned/.hgsub (glob)
1073 1073 --- cloned.*/.hgsub * (glob)
1074 1074 +++ cloned/.hgsub * (glob)
1075 1075 @@ -1,2 +1* @@ (glob)
1076 1076 sub1 = ../sub1
1077 1077 -sub3 = sub3
1078 1078 diff -Nru cloned.*/.hgsubstate cloned/.hgsubstate (glob)
1079 1079 --- cloned.*/.hgsubstate * (glob)
1080 1080 +++ cloned/.hgsubstate * (glob)
1081 1081 @@ -1,2 +1* @@ (glob)
1082 1082 7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1083 1083 -b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1084 1084 [1]
1085 1085
1086 1086 $ hg --config extensions.extdiff= pdiff -r 0 -r '.^' -S
1087 1087 \r (no-eol) (esc)
1088 1088 archiving [ ] 0/3\r (no-eol) (esc)
1089 1089 archiving [=============> ] 1/3\r (no-eol) (esc)
1090 1090 archiving [===========================> ] 2/3\r (no-eol) (esc)
1091 1091 archiving [==========================================>] 3/3\r (no-eol) (esc)
1092 1092 \r (no-eol) (esc)
1093 1093 \r (no-eol) (esc)
1094 1094 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1095 1095 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1096 1096 \r (no-eol) (esc)
1097 1097 \r (no-eol) (esc)
1098 1098 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1099 1099 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1100 1100 \r (no-eol) (esc)
1101 1101 \r (no-eol) (esc)
1102 1102 archiving [ ] 0/8\r (no-eol) (esc)
1103 1103 archiving [====> ] 1/8\r (no-eol) (esc)
1104 1104 archiving [=========> ] 2/8\r (no-eol) (esc)
1105 1105 archiving [===============> ] 3/8\r (no-eol) (esc)
1106 1106 archiving [====================> ] 4/8\r (no-eol) (esc)
1107 1107 archiving [=========================> ] 5/8\r (no-eol) (esc)
1108 1108 archiving [===============================> ] 6/8\r (no-eol) (esc)
1109 1109 archiving [====================================> ] 7/8\r (no-eol) (esc)
1110 1110 archiving [==========================================>] 8/8\r (no-eol) (esc)
1111 1111 \r (no-eol) (esc)
1112 1112 \r (no-eol) (esc)
1113 1113 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1114 1114 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1115 1115 \r (no-eol) (esc)
1116 1116 \r (no-eol) (esc)
1117 1117 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
1118 1118 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
1119 1119 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
1120 1120 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
1121 1121 \r (no-eol) (esc)
1122 1122 \r (no-eol) (esc)
1123 1123 archiving (sub3) [ ] 0/1\r (no-eol) (esc)
1124 1124 archiving (sub3) [===================================>] 1/1\r (no-eol) (esc)
1125 1125 \r (no-eol) (esc)
1126 1126 diff -Nru cloned.*/.hglf/b.dat cloned.*/.hglf/b.dat (glob)
1127 1127 --- cloned.*/.hglf/b.dat * (glob)
1128 1128 +++ cloned.*/.hglf/b.dat * (glob)
1129 1129 @@ -*,0 +1* @@ (glob)
1130 1130 +da39a3ee5e6b4b0d3255bfef95601890afd80709
1131 1131 diff -Nru cloned.*/.hglf/foo/bar/large.dat cloned.*/.hglf/foo/bar/large.dat (glob)
1132 1132 --- cloned.*/.hglf/foo/bar/large.dat * (glob)
1133 1133 +++ cloned.*/.hglf/foo/bar/large.dat * (glob)
1134 1134 @@ -*,0 +1* @@ (glob)
1135 1135 +2f6933b5ee0f5fdd823d9717d8729f3c2523811b
1136 1136 diff -Nru cloned.*/.hglf/large.bin cloned.*/.hglf/large.bin (glob)
1137 1137 --- cloned.*/.hglf/large.bin * (glob)
1138 1138 +++ cloned.*/.hglf/large.bin * (glob)
1139 1139 @@ -*,0 +1* @@ (glob)
1140 1140 +7f7097b041ccf68cc5561e9600da4655d21c6d18
1141 1141 diff -Nru cloned.*/.hgsub cloned.*/.hgsub (glob)
1142 1142 --- cloned.*/.hgsub * (glob)
1143 1143 +++ cloned.*/.hgsub * (glob)
1144 1144 @@ -1* +1,2 @@ (glob)
1145 1145 sub1 = ../sub1
1146 1146 +sub3 = sub3
1147 1147 diff -Nru cloned.*/.hgsubstate cloned.*/.hgsubstate (glob)
1148 1148 --- cloned.*/.hgsubstate * (glob)
1149 1149 +++ cloned.*/.hgsubstate * (glob)
1150 1150 @@ -1* +1,2 @@ (glob)
1151 1151 -fc3b4ce2696f7741438c79207583768f2ce6b0dd sub1
1152 1152 +7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1153 1153 +b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1154 1154 diff -Nru cloned.*/foo/bar/def cloned.*/foo/bar/def (glob)
1155 1155 --- cloned.*/foo/bar/def * (glob)
1156 1156 +++ cloned.*/foo/bar/def * (glob)
1157 1157 @@ -*,0 +1* @@ (glob)
1158 1158 +changed
1159 1159 diff -Nru cloned.*/main cloned.*/main (glob)
1160 1160 --- cloned.*/main * (glob)
1161 1161 +++ cloned.*/main * (glob)
1162 1162 @@ -1* +1* @@ (glob)
1163 1163 -main
1164 1164 +foo
1165 1165 diff -Nru cloned.*/sub1/.hgsubstate cloned.*/sub1/.hgsubstate (glob)
1166 1166 --- cloned.*/sub1/.hgsubstate * (glob)
1167 1167 +++ cloned.*/sub1/.hgsubstate * (glob)
1168 1168 @@ -1* +1* @@ (glob)
1169 1169 -c57a0840e3badd667ef3c3ef65471609acb2ba3c sub2
1170 1170 +c77908c81ccea3794a896c79e98b0e004aee2e9e sub2
1171 1171 diff -Nru cloned.*/sub1/sub2/folder/test.txt cloned.*/sub1/sub2/folder/test.txt (glob)
1172 1172 --- cloned.*/sub1/sub2/folder/test.txt * (glob)
1173 1173 +++ cloned.*/sub1/sub2/folder/test.txt * (glob)
1174 1174 @@ -*,0 +1* @@ (glob)
1175 1175 +subfolder
1176 1176 diff -Nru cloned.*/sub1/sub2/sub2 cloned.*/sub1/sub2/sub2 (glob)
1177 1177 --- cloned.*/sub1/sub2/sub2 * (glob)
1178 1178 +++ cloned.*/sub1/sub2/sub2 * (glob)
1179 1179 @@ -1* +1* @@ (glob)
1180 1180 -sub2
1181 1181 +modified
1182 1182 diff -Nru cloned.*/sub3/a.txt cloned.*/sub3/a.txt (glob)
1183 1183 --- cloned.*/sub3/a.txt * (glob)
1184 1184 +++ cloned.*/sub3/a.txt * (glob)
1185 1185 @@ -*,0 +1* @@ (glob)
1186 1186 +xyz
1187 1187 [1]
1188 1188
1189 1189 $ echo mod > sub1/sub2/sub2
1190 1190 $ hg --config extensions.extdiff= pdiff -S
1191 1191 \r (no-eol) (esc)
1192 1192 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1193 1193 \r (no-eol) (esc)
1194 1194 \r (no-eol) (esc)
1195 1195 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1196 1196 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1197 1197 \r (no-eol) (esc)
1198 1198 --- */cloned.*/sub1/sub2/sub2 * (glob)
1199 1199 +++ */cloned/sub1/sub2/sub2 * (glob)
1200 1200 @@ -1* +1* @@ (glob)
1201 1201 -modified
1202 1202 +mod
1203 1203 [1]
1204 1204
1205 1205 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now