view tests/test-subrepo-svn.out @ 11109:a2bc2f2d77a9

subrepo: normalize path part of URLs so that pulling subrepos from webdir works For a "all projects at root" repo layout eg: /main /sub Where subrepos are used such that a clone of main has this layout: ./main/ ./main/.hgsub ./main/sub/ And the .hgsub content is: sub = ../sub This allows a pull from a hgweb where main and sub are exposed at the root (or same directory level) The current code doesn't normalize the path component of a pull url. this results in trying to pull from http://server.com/hg/main/../sub Current hgweb implementation doesn't reduce the path component so this results in a 404 error though everything is setup logically. This patch adresses this 404 error on the puller side normalizing the URLs used for pulling sub repos. For this example, the URL would be reduced to http://server.com/hg/sub Fix + test
author Edouard Gomez <ed.gomez@free.fr>
date Sat, 01 May 2010 23:05:19 +0200
parents 33119d0252c1
children
line wrap: on
line source

% create subversion repo
Checked out revision 0.
A         src
A         src/alpha
A         externals
A         externals/other
Adding         externals
Adding         externals/other
Adding         src
Adding         src/alpha
Transmitting file data ..
Committed revision 1.
At revision 1.
property 'svn:externals' set on 'src'
Sending        src

Committed revision 2.
% create hg repo
% first revision, no sub
adding a
% add first svn sub with leading whitespaces
committing subrepository s
% debugsub
path s
 source   file:///root/svn-repo/src
 revision 2

% change file in svn and hg, commit
committing subrepository s
Sending        s/alpha
Transmitting file data .
Committed revision 3.

Fetching external item into 's/externals'
External at revision 1.

At revision 3.
path s
 source   file:///root/svn-repo/src
 revision 3

% should be empty despite change to s/a

% add a commit from svn
U    alpha

Fetching external item into 'externals'
A    externals/other
Updated external to revision 1.

Updated to revision 3.
property 'svn:mime-type' set on 'alpha'
Sending        src/alpha
Transmitting file data .
Committed revision 4.
% this commit from hg will fail
committing subrepository s
abort: svn: Commit failed (details follow):
svn: File '/src/alpha' is out of date
% this commit fails because of meta changes
property 'svn:mime-type' set on 's/alpha'
committing subrepository s
abort: svn: Commit failed (details follow):
svn: File '/src/alpha' is out of date
% this commit fails because of externals changes
committing subrepository s
abort: cannot commit svn externals
% this commit fails because of externals meta changes
property 'svn:mime-type' set on 's/externals/other'
committing subrepository s
abort: cannot commit svn externals

% clone
updating to branch default
A    tc/s/alpha
 U   tc/s

Fetching external item into 'tc/s/externals'
A    tc/s/externals/other
Checked out external at revision 1.

Checked out revision 3.
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
% debugsub in clone
path s
 source   file:///root/svn-repo/src
 revision 3
% verify subrepo is contained within the repo directory
True