changeset 7525:6a49fa7674c1

hgweb: mq repos should be in non-recursive collections, too
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 19 Dec 2008 18:24:49 +0100
parents 7fc19b12cb6b
children b7d4db95e95a 9e186bda013d
files mercurial/util.py tests/test-hgwebdir.out tests/test-mq-qclone-http tests/test-mq-qclone-http.out
diffstat 4 files changed, 61 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Fri Dec 19 08:41:46 2008 +0100
+++ b/mercurial/util.py	Fri Dec 19 18:24:49 2008 +0100
@@ -1902,13 +1902,12 @@
     for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler):
         if '.hg' in dirs:
             yield root # found a repository
+            qroot = os.path.join(root, '.hg', 'patches')
+            if os.path.isdir(os.path.join(qroot, '.hg')):
+                yield qroot # we have a patch queue repo here
             if recurse:
                 # avoid recursing inside the .hg directory
-                # the mq repository is added in any case
                 dirs.remove('.hg')
-                qroot = os.path.join(root, '.hg', 'patches')
-                if os.path.isdir(os.path.join(qroot, '.hg')):
-                    yield qroot # we have a patch queue repo here
             else:
                 dirs[:] = [] # don't descend further
         elif followsym:
--- a/tests/test-hgwebdir.out	Fri Dec 19 08:41:46 2008 +0100
+++ b/tests/test-hgwebdir.out	Fri Dec 19 18:24:49 2008 +0100
@@ -31,6 +31,7 @@
 
 /b/
 /coll/a/
+/coll/a/.hg/patches/
 /coll/b/
 /coll/c/
 /rcoll/a/
@@ -115,6 +116,7 @@
 
 
 /coll/a/
+/coll/a/.hg/patches/
 /coll/b/
 /coll/c/
 
@@ -138,6 +140,7 @@
 
 
 /a/
+/a/.hg/patches/
 /b/
 /c/
 
--- a/tests/test-mq-qclone-http	Fri Dec 19 08:41:46 2008 +0100
+++ b/tests/test-mq-qclone-http	Fri Dec 19 18:24:49 2008 +0100
@@ -22,6 +22,8 @@
 
 cd ..
 
+echo % test with recursive collection
+
 cat > collections.conf <<EOF
 [paths]
 /=$root/**
@@ -38,6 +40,8 @@
 hg --cwd b qpush -a
 hg --cwd b log --template "{desc}\n"
 
+echo % test with normal collection
+
 cat > collections1.conf <<EOF
 [paths]
 /=$root/*
@@ -53,3 +57,21 @@
 hg --cwd c log --template "{desc}\n"
 hg --cwd c qpush -a
 hg --cwd c log --template "{desc}\n"
+
+echo % test with old-style collection
+
+cat > collections2.conf <<EOF
+[collections]
+$root=$root
+EOF
+
+hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \
+    -A access-paths.log -E error-paths-1.log
+cat hg.pid >> $DAEMON_PIDS
+
+"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
+
+hg qclone http://localhost:$HGPORT2/a d
+hg --cwd d log --template "{desc}\n"
+hg --cwd d qpush -a
+hg --cwd d log --template "{desc}\n"
--- a/tests/test-mq-qclone-http.out	Fri Dec 19 08:41:46 2008 +0100
+++ b/tests/test-mq-qclone-http.out	Fri Dec 19 18:24:49 2008 +0100
@@ -3,6 +3,7 @@
 [mq]: b.patch
 a
 b.patch
+% test with recursive collection
 200 Script output follows
 
 
@@ -27,10 +28,12 @@
 Now at: b.patch
 imported patch b.patch
 a
+% test with normal collection
 200 Script output follows
 
 
 /a/
+/a/.hg/patches/
 
 requesting all changes
 adding changesets
@@ -41,10 +44,37 @@
 adding changesets
 adding manifests
 adding file changes
-added 2 changesets with 2 changes to 2 files
+added 1 changesets with 3 changes to 3 files
 updating working directory
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 a
-no patches in series
+applying b.patch
+Now at: b.patch
+imported patch b.patch
 a
+% test with old-style collection
+200 Script output follows
+
+
+/a/
+/a/.hg/patches/
+
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 2 changesets with 2 changes to 2 files
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 3 changes to 3 files
+updating working directory
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+a
+applying b.patch
+Now at: b.patch
+imported patch b.patch
+a