Mercurial > public > mercurial-scm > hg-stable
diff tests/test-subrepo-svn.t @ 14050:9e8a9d45945c stable
subrepo: handle svn tracked/unknown directory collisions
This happens more often than expected. Say you have an svn subrepository with
python code. Python would have generated unknown .pyc files. Now, you rebase
this setup on a revision where a directory containing python code does not
exist. Subversion is first asked to remove this directory when updating, but
will not because it contains untracked items. Then it will have to bring back
the directory after the merge but will fail because it now collides with an
untracked directory.
Using --force is not very elegant and only works with svn >= 1.5 but the only
alternative I can think of is to write our own purge command for subversion.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 04 Mar 2011 14:00:49 +0100 |
parents | 42a34c0aeddc |
children | ecaa78594983 |
line wrap: on
line diff
--- a/tests/test-subrepo-svn.t Fri Apr 29 03:05:48 2011 -0500 +++ b/tests/test-subrepo-svn.t Fri Mar 04 14:00:49 2011 +0100 @@ -438,3 +438,54 @@ $ svnversion 2 $ cd .. + +Test case where subversion would fail to update the subrepo because there +are unknown directories being replaced by tracked ones (happens with rebase). + + $ cd $WCROOT/src + $ mkdir dir + $ echo epsilon.py > dir/epsilon.py + $ svn add dir + A dir + A dir/epsilon.py + $ svn ci -m 'Add dir/epsilon.py' + Adding src/dir + Adding src/dir/epsilon.py + Transmitting file data . + Committed revision 6. + $ cd ../.. + $ hg init rebaserepo + $ cd rebaserepo + $ svn co -r5 --quiet "$SVNREPO"/src s + $ echo "s = [svn] $SVNREPO/src" >> .hgsub + $ hg add .hgsub + $ hg ci -m addsub + committing subrepository s + $ echo a > a + $ hg ci -Am adda + adding a + $ hg up 0 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ svn up -r6 s + A s/dir + A s/dir/epsilon.py + + Fetching external item into 's/externals' + Updated external to revision 1. + + Updated to revision 6. + $ hg ci -m updatesub + committing subrepository s + created new head + $ echo pyc > s/dir/epsilon.pyc + $ hg up 1 + D $TESTTMP/rebaserepo/s/dir + + Fetching external item into '$TESTTMP/rebaserepo/s/externals' + Checked out external at revision 1. + + Checked out revision 5. + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ if "$TESTDIR/hghave" -q svn15; then + > hg up 2 >/dev/null 2>&1 || echo update failed + > fi