Mercurial > hg-stable
comparison tests/test-convert-svn-source.t @ 16466:c53a49c345e1 stable
convert/svn: do not try converting empty head revisions (issue3347)
Subversion conversion works by picking trunk and branches heads, computing a
revision graph from them and converting the selected commits. By design we fail
to convert empty revisions so we have to be careful when discovering the
revision graph. In this particular issue, the source svn repository was a
partial mirror made by svnsync. The funny part is svnsync preserves all
revisions including empty ones. Also, we trusted ra.stat(path,
stop).created_rev to give us the latest revision with changes in path history
up to stop. This assumption broke at least when path is '', that is the
repository root, which always returned 'stop' revision despited being empty.
The workaround is to first trust ra.stat() but if the returned revision appear
empty, search the whole path history from stop to r1 until some changes are
found.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Wed, 18 Apr 2012 14:04:58 +0200 |
parents | 00121103546a |
children | b12b65d2cbe4 |
comparison
equal
deleted
inserted
replaced
16465:ad38b96c88f9 | 16466:c53a49c345e1 |
---|---|
185 $ cd stoprev | 185 $ cd stoprev |
186 $ hg tip --debug | grep extra | 186 $ hg tip --debug | grep extra |
187 extra: branch=default | 187 extra: branch=default |
188 extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) | 188 extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) |
189 $ cd .. | 189 $ cd .. |
190 | |
191 Test converting empty heads (issue3347) | |
192 | |
193 $ svnadmin create svn-empty | |
194 $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" | |
195 $ hg --config convert.svn.trunk= convert svn-empty | |
196 assuming destination svn-empty-hg | |
197 initializing destination svn-empty-hg repository | |
198 scanning source... | |
199 sorting... | |
200 converting... | |
201 1 init projA | |
202 0 adddir | |
203 $ hg --config convert.svn.trunk= convert file://$svnpath/svn-empty/trunk | |
204 assuming destination trunk-hg | |
205 initializing destination trunk-hg repository | |
206 scanning source... | |
207 sorting... | |
208 converting... | |
209 1 init projA | |
210 0 adddir |