Mercurial > hg
view tests/test-mq-merge @ 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 | 2376b4cc52d8 |
children |
line wrap: on
line source
#!/bin/sh # Test issue 529 - mq aborts when merging patch deleting files checkundo() { if [ -f .hg/store/undo ]; then echo ".hg/store/undo still exists after $1" fi } echo "[extensions]" >> $HGRCPATH echo "mq =" >> $HGRCPATH echo "[mq]" >> $HGRCPATH echo "git = keep" >> $HGRCPATH # Commit two dummy files in "init" changeset hg init t cd t echo a > a echo b > b hg ci -Am init hg tag -l init # Create a patch removing a hg qnew rm_a hg rm a hg qrefresh -m "rm a" # Save the patch queue so we can merge it later hg qsave -c -e 2>&1 | grep -v '^copy' checkundo qsave # Update b and commit in an "update" changeset hg up -C init echo b >> b hg st hg ci -m update # Here, qpush used to abort with : # The system cannot find the file specified => a hg manifest hg qpush -a -m 2>&1 | grep -v '^merging' checkundo 'qpush -m' hg manifest # ensure status is correct after merge hg qpop -a cd .. # Classic MQ merge sequence *with an explicit named queue* echo echo % init t2 hg init t2 cd t2 echo '[diff]' > .hg/hgrc echo 'nodates = 1' >> .hg/hgrc echo a > a hg ci -Am init echo b > a hg ci -m changea hg up -C 0 hg cp a aa echo c >> a hg qnew --git -f -e patcha echo d >> a hg qnew -d '0 0' -f -e patcha2 echo % create the reference queue hg qsave -c -e -n refqueue 2> /dev/null hg up -C 1 echo % merge HGMERGE=internal:other hg qpush -a -m -n refqueue 2>&1 | \ sed 's/merging with queue at.*refqueue/merging with queue at refqueue/' echo % check patcha is still a git patch cat .hg/patches/patcha echo % check patcha2 is still a regular patch grep git .hg/patches/patcha2 && echo 'git patch found!' cd ..