##// END OF EJS Templates
test-obsolete-bundle-strip: test bundling in the first case...
marmoute -
r32592:9df4c261 default
parent child Browse files
Show More
@@ -2,12 +2,8 b''
2 Test obsmarkers interaction with bundle and strip
2 Test obsmarkers interaction with bundle and strip
3 ==================================================
3 ==================================================
4
4
5 In practice, this file does not yet contains any tests for bundle and strip.
5 The file currently only contains test for bundle.
6 But their will be some soon (tm).
6 Testing of strip will happen some time soon (tm).
7
8 For now this test check the logic computing markers relevant to a set of
9 revision. That logic will be use by "hg bundle" to select the markers to
10 include, and strip to find the markers to backup.
11
7
12 Setup a repository with various case
8 Setup a repository with various case
13 ====================================
9 ====================================
@@ -53,6 +49,32 b' Config setup'
53 > mkcommit ROOT
49 > mkcommit ROOT
54 > }
50 > }
55
51
52 Function to compare the expected bundled obsmarkers with the actually bundled
53 obsmarkers.
54
55 $ testrevs () {
56 > revs="$1"
57 > testname=`basename \`pwd\``
58 > revsname=`hg --hidden log -T '-{desc}\n' --rev "${revs}"`
59 > prefix="${TESTTMP}/${testname}${revsname}"
60 > markersfile="${prefix}-relevant-markers.txt"
61 > bundlefile="${prefix}-bundle.hg"
62 > contentfile="${prefix}-bundle-markers.hg"
63 > hg debugobsolete --hidden --rev "${revs}" | sed 's/^/ /' > "${markersfile}"
64 > echo '### Matched revisions###'
65 > hg log --hidden --rev "${revs}" | sort
66 > echo '### Relevant markers ###'
67 > cat "${markersfile}"
68 > printf "# bundling: "
69 > hg bundle --hidden --base "parents(roots(${revs}))" --rev "${revs}" "${bundlefile}"
70 > hg debugbundle "${bundlefile}" | grep "obsmarkers --" -A 100 | sed 1,2d > "${contentfile}"
71 > echo '### Bundled markers ###'
72 > cat "${contentfile}"
73 > echo '### diff <relevant> <bundled> ###'
74 > cmp "${markersfile}" "${contentfile}" || diff -u "${markersfile}" "${contentfile}"
75 > echo '#################################'
76 > }
77
56 root setup
78 root setup
57 -------------
79 -------------
58
80
@@ -94,12 +116,47 b' setup'
94 Actual testing
116 Actual testing
95 --------------
117 --------------
96
118
97 $ hg debugobsolete --rev 'desc("C-A0")'
119 $ testrevs 'desc("C-A0")'
98 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
120 ### Matched revisions###
99 $ hg debugobsolete --rev 'desc("C-A1")'
121 84fcb0dfe17b: C-A0
100 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
122 ### Relevant markers ###
101 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
123 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
102 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
124 # bundling: 1 changesets found
125 ### Bundled markers ###
126 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
127 ### diff <relevant> <bundled> ###
128 #################################
129
130 $ testrevs 'desc("C-A1")'
131 ### Matched revisions###
132 cf2c22470d67: C-A1
133 ### Relevant markers ###
134 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
135 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
136 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
137 # bundling: 1 changesets found
138 ### Bundled markers ###
139 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
140 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
141 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
142 ### diff <relevant> <bundled> ###
143 #################################
144
145 $ testrevs 'desc("C-A")'
146 ### Matched revisions###
147 84fcb0dfe17b: C-A0
148 cf2c22470d67: C-A1
149 ### Relevant markers ###
150 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
151 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
152 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
153 # bundling: 2 changesets found
154 ### Bundled markers ###
155 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
156 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
157 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
158 ### diff <relevant> <bundled> ###
159 #################################
103
160
104 chain with prune children
161 chain with prune children
105 =========================
162 =========================
General Comments 0
You need to be logged in to leave comments. Login now