# HG changeset patch # User Brett Cannon # Date 1271625608 25200 # Node ID 33119d0252c1aa46da82a22aeb067fcd172ce804 # Parent f1250e2e8fd1b132bf3c034543daa821b6021362 subrepo: fix repo root path handling in svn subrepo diff -r f1250e2e8fd1 -r 33119d0252c1 mercurial/subrepo.py --- a/mercurial/subrepo.py Thu Apr 08 00:13:33 2010 +0900 +++ b/mercurial/subrepo.py Sun Apr 18 14:20:08 2010 -0700 @@ -273,7 +273,8 @@ self._ui = ctx._repo.ui def _svncommand(self, commands): - cmd = ['svn'] + commands + [self._path] + path = os.path.join(self._ctx._repo.origroot, self._path) + cmd = ['svn'] + commands + [path] cmd = [util.shellquote(arg) for arg in cmd] cmd = util.quotecommand(' '.join(cmd)) env = dict(os.environ) diff -r f1250e2e8fd1 -r 33119d0252c1 tests/test-subrepo-svn --- a/tests/test-subrepo-svn Thu Apr 08 00:13:33 2010 +0900 +++ b/tests/test-subrepo-svn Sun Apr 18 14:20:08 2010 -0700 @@ -16,7 +16,8 @@ fi escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"` filterpath="s|$escapedwd|/root|" -filtersvn='s/ in transaction.*/ is out of date/;s/Out of date: /File /' +filteroutofdate='s/ in transaction.*/ is out of date/;s/Out of date: /File /' +filterexternal="s|Fetching external item into '.*/s/externals'|Fetching external item into 's/externals'|g" echo % create subversion repo @@ -62,7 +63,7 @@ echo % change file in svn and hg, commit echo a >> a echo alpha >> s/alpha -hg commit -m 'Message!' +hg commit -m 'Message!' | sed "$filterexternal" hg debugsub | sed "$filterpath" echo @@ -81,12 +82,12 @@ echo % this commit from hg will fail echo zzz >> s/alpha -hg ci -m 'amend alpha from hg' 2>&1 | sed "$filtersvn" +hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate" svn revert -q s/alpha echo % this commit fails because of meta changes svn propset svn:mime-type 'text/html' s/alpha -hg ci -m 'amend alpha from hg' 2>&1 | sed "$filtersvn" +hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate" svn revert -q s/alpha echo % this commit fails because of externals changes @@ -106,3 +107,6 @@ cd tc echo % debugsub in clone hg debugsub | sed "$filterpath" + +echo % verify subrepo is contained within the repo directory +python -c "import os.path; print os.path.exists('s')" diff -r f1250e2e8fd1 -r 33119d0252c1 tests/test-subrepo-svn.out --- a/tests/test-subrepo-svn.out Thu Apr 08 00:13:33 2010 +0900 +++ b/tests/test-subrepo-svn.out Sun Apr 18 14:20:08 2010 -0700 @@ -72,11 +72,11 @@ % clone updating to branch default -A s/alpha - U s +A tc/s/alpha + U tc/s -Fetching external item into 's/externals' -A s/externals/other +Fetching external item into 'tc/s/externals' +A tc/s/externals/other Checked out external at revision 1. Checked out revision 3. @@ -85,3 +85,5 @@ path s source file:///root/svn-repo/src revision 3 +% verify subrepo is contained within the repo directory +True