changeset 3437:d96429ddc8e2

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Tue, 17 Oct 2006 19:04:13 -0500
parents 357b5589dc62 (current diff) f29989e9746e (diff)
children b17f9d3eda74
files
diffstat 28 files changed, 717 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/MANIFEST.in	Tue Oct 17 18:54:37 2006 -0500
+++ b/MANIFEST.in	Tue Oct 17 19:04:13 2006 -0500
@@ -2,7 +2,7 @@
 recursive-include mercurial *.py
 include hgweb.cgi hgwebdir.cgi
 include hgeditor rewrite-log
-include tests/README tests/*.py tests/test-*[a-z0-9] tests/*.out
+include tests/README tests/*.py tests/test-*[a-z0-9] tests/*.out tests/*.bin
 prune tests/*.err
 include *.txt
 include doc/README doc/Makefile doc/gendoc.py doc/*.txt doc/*.html doc/*.[0-9]
--- a/contrib/macosx/Readme.html	Tue Oct 17 18:54:37 2006 -0500
+++ b/contrib/macosx/Readme.html	Tue Oct 17 19:04:13 2006 -0500
@@ -25,7 +25,7 @@
 <p class="p2"><br></p>
 <p class="p1"><b>After you install</b></p>
 <p class="p2"><br></p>
-<p class="p3">This package installs the <span class="s2">hg</span> executable in <span class="s2">/usr/local/bin</span>. This directory may not be in your shell's search path. Don't forget to check.</p>
+<p class="p3">This package installs the <span class="s2">hg</span> executable in <span class="s2">/Library/Frameworks/Python.framework/Versions/Current/bin</span>. This directory may not be in your shell's search path. The MacPython installer will have created an entry in <span class="s2">.profile</span> for it but if your shell doesn't use <span class="s2">.profile</span> you'll need configure it yourself or create a symlink from a directory already in your path.</p>
 <p class="p2"><br></p>
 <p class="p1"><b>Reporting problems</b></p>
 <p class="p2"><br></p>
--- a/contrib/win32/ReadMe.html	Tue Oct 17 18:54:37 2006 -0500
+++ b/contrib/win32/ReadMe.html	Tue Oct 17 19:04:13 2006 -0500
@@ -46,7 +46,7 @@
       other Mercurial commands should work fine for you.</p>
 
     <h1>Configuration notes</h1>
-    <p>The default editor for commit messages is 'vi'. You can set the EDITOR
+    <p>The default editor for commit messages is 'notepad'. You can set the EDITOR
     (or HGEDITOR) environment variable to specify your preference or set it in
     mercurial.ini:</p>
     <pre>
--- a/contrib/win32/mercurial.ini	Tue Oct 17 18:54:37 2006 -0500
+++ b/contrib/win32/mercurial.ini	Tue Oct 17 19:04:13 2006 -0500
@@ -3,6 +3,9 @@
 ; USERNAME is your Windows user name:
 ;   C:\Documents and Settings\USERNAME\Mercurial.ini
 
+[ui] 
+editor = notepad
+
 ; By default, we try to encode and decode all files that do not
 ; contain ASCII NUL characters.  What this means is that we try to set
 ; line endings to Windows style on update, and to Unix style on
--- a/hgext/acl.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/hgext/acl.py	Tue Oct 17 19:04:13 2006 -0500
@@ -80,7 +80,7 @@
         self.user = getpass.getuser()
         cfg = self.ui.config('acl', 'config')
         if cfg:
-            self.ui.readconfig(cfg)
+            self.ui.readsections(cfg, 'acl.allow', 'acl.deny')
         self.allow, self.allowable = self.buildmatch('acl.allow')
         self.deny, self.deniable = self.buildmatch('acl.deny')
 
--- a/hgext/bugzilla.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/hgext/bugzilla.py	Tue Oct 17 19:04:13 2006 -0500
@@ -74,7 +74,7 @@
         timeout = int(self.ui.config('bugzilla', 'timeout', 5))
         usermap = self.ui.config('bugzilla', 'usermap')
         if usermap:
-            self.ui.readconfig(usermap)
+            self.ui.readsections(usermap, 'usermap')
         self.ui.note(_('connecting to %s:%s as %s, password %s\n') %
                      (host, db, user, '*' * len(passwd)))
         self.conn = MySQLdb.connect(host=host, user=user, passwd=passwd,
--- a/hgext/notify.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/hgext/notify.py	Tue Oct 17 19:04:13 2006 -0500
@@ -102,7 +102,7 @@
         self.ui = ui
         cfg = self.ui.config('notify', 'config')
         if cfg:
-            self.ui.readconfig(cfg)
+            self.ui.readsections(cfg, 'usersubs', 'reposubs')
         self.repo = repo
         self.stripcount = int(self.ui.config('notify', 'strip', 0))
         self.root = self.strip(self.repo.root)
--- a/mercurial/bundlerepo.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/mercurial/bundlerepo.py	Tue Oct 17 19:04:13 2006 -0500
@@ -233,10 +233,12 @@
         self.bundlefile.close()
 
     def __del__(self):
-        if not self.bundlefile.closed:
-            self.bundlefile.close()
-        if self.tempfile is not None:
-            os.unlink(self.tempfile)
+        bundlefile = getattr(self, 'bundlefile', None)
+        if bundlefile and not bundlefile.closed:
+            bundlefile.close()
+        tempfile = getattr(self, 'tempfile', None)
+        if tempfile is not None:
+            os.unlink(tempfile)
 
 def instance(ui, path, create):
     if create:
--- a/mercurial/hgweb/hgweb_mod.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Tue Oct 17 19:04:13 2006 -0500
@@ -28,7 +28,7 @@
         return "/"
     return up + "/"
 
-def revnavgen(pos, pagelen, limit):
+def revnavgen(pos, pagelen, limit, nodefunc):
     def seq(factor, limit=None):
         if limit:
             yield limit
@@ -50,16 +50,19 @@
                 break
             last = f
             if pos + f < limit:
-                l.append(("+%d" % f, pos + f))
+                l.append(("+%d" % f, hex(nodefunc(pos + f).node())))
             if pos - f >= 0:
-                l.insert(0, ("-%d" % f, pos - f))
+                l.insert(0, ("-%d" % f, hex(nodefunc(pos - f).node())))
+
+        try:
+            yield {"label": "(0)", "node": hex(nodefunc('0').node())}
 
-        yield {"label": "(0)", "rev": 0}
+            for label, node in l:
+                yield {"label": label, "node": node}
 
-        for label, rev in l:
-            yield {"label": label, "rev": rev}
-
-        yield {"label": "tip", "rev": "tip"}
+            yield {"label": "tip", "node": "tip"}
+        except hg.RepoError:
+            pass
 
     return nav
 
@@ -215,7 +218,7 @@
         end = min(count, start + maxchanges)
         pos = end - 1
 
-        changenav = revnavgen(pos, maxchanges, count)
+        changenav = revnavgen(pos, maxchanges, count, self.repo.changectx)
 
         yield self.t(shortlog and 'shortlog' or 'changelog',
                      changenav=changenav,
@@ -338,7 +341,8 @@
             for e in l:
                 yield e
 
-        nav = revnavgen(pos, pagelen, count)
+        nodefunc = lambda x: fctx.filectx(fileid=x)
+        nav = revnavgen(pos, pagelen, count, nodefunc)
         yield self.t("filelog", file=f, node=hex(fctx.node()), nav=nav,
                      entries=entries)
 
@@ -743,13 +747,9 @@
             style = req.form['style'][0]
         mapfile = style_map(self.templatepath, style)
 
-        if not req.url:
-            port = req.env["SERVER_PORT"]
-            port = port != "80" and (":" + port) or ""
-            uri = req.env["REQUEST_URI"]
-            if "?" in uri:
-                uri = uri.split("?")[0]
-            req.url = "http://%s%s%s" % (req.env["SERVER_NAME"], port, uri)
+        port = req.env["SERVER_PORT"]
+        port = port != "80" and (":" + port) or ""
+        urlbase = 'http://%s%s' % (req.env['SERVER_NAME'], port)
 
         if not self.reponame:
             self.reponame = (self.repo.ui.config("web", "name")
@@ -758,6 +758,7 @@
 
         self.t = templater.templater(mapfile, templater.common_filters,
                                      defaults={"url": req.url,
+                                               "urlbase": urlbase,
                                                "repo": self.reponame,
                                                "header": header,
                                                "footer": footer,
--- a/mercurial/hgweb/hgwebdir_mod.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Tue Oct 17 19:04:13 2006 -0500
@@ -8,7 +8,7 @@
 
 import os
 from mercurial.demandload import demandload
-demandload(globals(), "ConfigParser mimetools cStringIO")
+demandload(globals(), "mimetools cStringIO")
 demandload(globals(), "mercurial:ui,hg,util,templater")
 demandload(globals(), "mercurial.hgweb.hgweb_mod:hgweb")
 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile,style_map")
@@ -30,7 +30,7 @@
             self.repos = cleannames(config.items())
             self.repos.sort()
         else:
-            cp = ConfigParser.SafeConfigParser()
+            cp = util.configparser()
             cp.read(config)
             self.repos = []
             if cp.has_section('web'):
--- a/mercurial/ui.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/mercurial/ui.py	Tue Oct 17 19:04:13 2006 -0500
@@ -11,12 +11,14 @@
 demandload(globals(), "ConfigParser traceback util")
 
 def dupconfig(orig):
-    new = ConfigParser.SafeConfigParser(orig.defaults())
+    new = util.configparser(orig.defaults())
     updateconfig(orig, new)
     return new
 
-def updateconfig(source, dest):
-    for section in source.sections():
+def updateconfig(source, dest, sections=None):
+    if not sections:
+        sections = source.sections()
+    for section in sections:
         if not dest.has_section(section):
             dest.add_section(section)
         for name, value in source.items(section, raw=True):
@@ -37,7 +39,7 @@
             self.debugflag = debug
             self.interactive = interactive
             self.traceback = traceback
-            self.cdata = ConfigParser.SafeConfigParser()
+            self.cdata = util.configparser()
             self.readconfig(util.rcpath())
             self.updateopts(verbose, debug, quiet, interactive)
         else:
@@ -100,6 +102,23 @@
     def addreadhook(self, hook):
         self.readhooks.append(hook)
 
+    def readsections(self, filename, *sections):
+        "read filename and add only the specified sections to the config data"
+        if not sections:
+            return
+
+        cdata = util.configparser()
+        try:
+            cdata.read(filename)
+        except ConfigParser.ParsingError, inst:
+            raise util.Abort(_("failed to parse %s\n%s") % (f, inst))
+
+        for section in sections:
+            if not cdata.has_section(section):
+                cdata.add_section(section)
+
+        updateconfig(cdata, self.cdata, sections)
+
     def fixconfig(self, section=None, name=None, value=None, root=None):
         # translate paths relative to root (or home) into absolute paths
         if section is None or section == 'paths':
@@ -126,7 +145,7 @@
 
     def setconfig(self, section, name, value):
         if not self.overlay:
-            self.overlay = ConfigParser.SafeConfigParser()
+            self.overlay = util.configparser()
         for cdata in (self.overlay, self.cdata):
             if not cdata.has_section(section):
                 cdata.add_section(section)
--- a/mercurial/util.py	Tue Oct 17 18:54:37 2006 -0500
+++ b/mercurial/util.py	Tue Oct 17 19:04:13 2006 -0500
@@ -15,7 +15,7 @@
 from i18n import gettext as _
 from demandload import *
 demandload(globals(), "cStringIO errno getpass popen2 re shutil sys tempfile")
-demandload(globals(), "os threading time calendar")
+demandload(globals(), "os threading time calendar ConfigParser")
 
 # used by parsedate
 defaultdateformats = ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M',
@@ -24,6 +24,11 @@
 class SignalInterrupt(Exception):
     """Exception raised on SIGTERM and SIGHUP."""
 
+# like SafeConfigParser but with case-sensitive keys
+class configparser(ConfigParser.SafeConfigParser):
+    def optionxform(self, optionstr):
+        return optionstr
+
 def cachefunc(func):
     '''cache the result of function calls'''
     # XXX doesn't handle keywords args
--- a/templates/gitweb/map	Tue Oct 17 18:54:37 2006 -0500
+++ b/templates/gitweb/map	Tue Oct 17 19:04:13 2006 -0500
@@ -5,9 +5,9 @@
 changelog = changelog.tmpl
 summary = summary.tmpl
 error = error.tmpl
-naventry = '<a href="#url#log/#rev#{sessionvars%urlparameter}">#label|escape#</a> '
-navshortentry = '<a href="#url#shortlog/#rev#{sessionvars%urlparameter}">#label|escape#</a> '
-filenaventry = '<a href="{url}log/{rev}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
+naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
 filedifflink = '<a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> '
 filenodelink = '<tr class="parity#parity#"><td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">#file|escape#</a></td><td></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> | <a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a></td></tr>'
 fileellipses = '...'
--- a/templates/map	Tue Oct 17 18:54:37 2006 -0500
+++ b/templates/map	Tue Oct 17 19:04:13 2006 -0500
@@ -5,9 +5,9 @@
 changelog = changelog.tmpl
 shortlog = shortlog.tmpl
 shortlogentry = shortlogentry.tmpl
-naventry = '<a href="#url#log/#rev#{sessionvars%urlparameter}">#label|escape#</a> '
-navshortentry = '<a href="#url#shortlog/#rev#{sessionvars%urlparameter}">#label|escape#</a> '
-filenaventry = '<a href="{url}log/{rev}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
+naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
 filedifflink = '<a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> '
 filenodelink = '<a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> '
 fileellipses = '...'
--- a/templates/old/map	Tue Oct 17 18:54:37 2006 -0500
+++ b/templates/old/map	Tue Oct 17 19:04:13 2006 -0500
@@ -5,8 +5,8 @@
 changelog = changelog.tmpl
 shortlog = shortlog.tmpl
 shortlogentry = shortlogentry.tmpl
-naventry = '<a href="?cl=#rev#">#label|escape#</a> '
-navshortentry = '<a href="?sl=#rev#">#label|escape#</a> '
+naventry = '<a href="?cl={node|short}">{label|escape}</a> '
+navshortentry = '<a href="?sl={node|short}">{label|escape}</a> '
 filedifflink = '<a href="?fd=#node|short#;file=#file|urlescape#">#file|escape#</a> '
 filenodelink = '<a href="?f=#node|short#;file=#file|urlescape#">#file|escape#</a> '
 fileellipses = '...'
--- a/templates/rss/changelogentry.tmpl	Tue Oct 17 18:54:37 2006 -0500
+++ b/templates/rss/changelogentry.tmpl	Tue Oct 17 19:04:13 2006 -0500
@@ -1,6 +1,6 @@
 <item>
     <title>#desc|strip|firstline|strip|escape#</title>
-    <link>#url#?cs=#node|short#</link>
+    <link>{urlbase}{url}rev/{node|short}</link>
     <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
     <author>#author|obfuscate#</author>
     <pubDate>#date|rfc822date#</pubDate>
--- a/templates/rss/filelogentry.tmpl	Tue Oct 17 18:54:37 2006 -0500
+++ b/templates/rss/filelogentry.tmpl	Tue Oct 17 19:04:13 2006 -0500
@@ -1,6 +1,6 @@
 <item>
     <title>#desc|strip|firstline|strip|escape#</title>
-    <link>#url#?f=#node|short#;file=#file|urlescape#</link>
+    <link>{urlbase}{url}log{#node|short#}/{file|urlescape}</link>
     <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
     <author>#author|obfuscate#</author>
     <pubDate>#date|rfc822date#</pubDate>
--- a/templates/rss/header.tmpl	Tue Oct 17 18:54:37 2006 -0500
+++ b/templates/rss/header.tmpl	Tue Oct 17 19:04:13 2006 -0500
@@ -2,5 +2,5 @@
 
 <rss version="2.0">
   <channel>
-    <link>#url#</link>
+    <link>{urlbase}{url}</link>
     <language>en-us</language>
--- a/templates/rss/tagentry.tmpl	Tue Oct 17 18:54:37 2006 -0500
+++ b/templates/rss/tagentry.tmpl	Tue Oct 17 19:04:13 2006 -0500
@@ -1,6 +1,6 @@
 <item>
     <title>#tag|escape#</title>
-    <link>#url#?cs=#node|short#</link>
+    <link>{urlbase}{url}rev/{node|short}</link>
     <description><![CDATA[#tag|strip|escape|addbreaks#]]></description>
     <pubDate>#date|rfc822date#</pubDate>
 </item>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-acl	Tue Oct 17 19:04:13 2006 -0500
@@ -0,0 +1,109 @@
+#!/bin/sh
+
+do_push()
+{
+    user=$1
+    shift
+
+    echo "Pushing as user $user"
+    echo 'hgrc = """'
+    sed -e 1,2d b/.hg/hgrc
+    echo '"""'
+    if [ -e acl.config ]; then
+	echo 'acl.config = """'
+	cat acl.config
+	echo '"""'
+    fi
+    LOGNAME=$user hg --cwd a --debug push ../b
+    hg --cwd b rollback
+    hg --cwd b --quiet tip
+    echo
+}
+
+hg init a
+cd a
+mkdir foo foo/Bar quux
+echo 'in foo' > foo/file.txt
+echo 'in foo/Bar' > foo/Bar/file.txt
+echo 'in quux' > quux/file.py
+hg add
+hg ci -m 'add files' -d '1000000 0'
+echo >> foo/file.txt
+hg ci -m 'change foo/file' -d '1000001 0'
+echo >> foo/Bar/file.txt
+hg ci -m 'change foo/Bar/file' -d '1000002 0'
+echo >> quux/file.py
+hg ci -m 'change quux/file' -d '1000003 0'
+hg tip --quiet
+
+cd ..
+hg clone -r 0 a b
+
+echo '[extensions]' >> $HGRCPATH
+echo 'hgext.acl =' >> $HGRCPATH
+
+config=b/.hg/hgrc
+
+echo
+
+echo 'Extension disabled for lack of a hook'
+do_push fred
+
+echo '[hooks]' >> $config
+echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
+
+echo 'Extension disabled for lack of acl.sources'
+do_push fred
+
+echo 'No [acl.allow]/[acl.deny]'
+echo '[acl]' >> $config
+echo 'sources = push' >> $config
+do_push fred
+
+echo 'Empty [acl.allow]'
+echo '[acl.allow]' >> $config
+do_push fred
+
+echo 'fred is allowed inside foo/'
+echo 'foo/** = fred' >> $config
+do_push fred
+
+echo 'Empty [acl.deny]'
+echo '[acl.deny]' >> $config
+do_push barney
+
+echo 'fred is allowed inside foo/, but not foo/bar/ (case matters)'
+echo 'foo/bar/** = fred' >> $config
+do_push fred
+
+echo 'fred is allowed inside foo/, but not foo/Bar/'
+echo 'foo/Bar/** = fred' >> $config
+do_push fred
+
+echo 'barney is not mentioned => not allowed anywhere'
+do_push barney
+
+echo 'barney is allowed everywhere'
+echo '[acl.allow]' >> $config
+echo '** = barney' >> $config
+do_push barney
+
+echo 'wilma can change files with a .txt extension'
+echo '**/*.txt = wilma' >> $config
+do_push wilma
+
+echo 'file specified by acl.config does not exist'
+echo '[acl]' >> $config
+echo 'config = ../acl.config' >> $config
+do_push barney
+
+echo 'betty is allowed inside foo/ by a acl.config file'
+echo '[acl.allow]' >> acl.config
+echo 'foo/** = betty' >> acl.config
+do_push betty
+
+echo 'acl.config can set only [acl.allow]/[acl.deny]'
+echo '[hooks]' >> acl.config
+echo 'changegroup.acl = false' >> acl.config
+do_push barney
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-acl.out	Tue Oct 17 19:04:13 2006 -0500
@@ -0,0 +1,517 @@
+adding foo/Bar/file.txt
+adding foo/file.txt
+adding quux/file.py
+3:911600dab2ae
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 3 changes to 3 files
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Extension disabled for lack of a hook
+Pushing as user fred
+hgrc = """
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+rolling back last transaction
+0:6675d58eff77
+
+Extension disabled for lack of acl.sources
+Pushing as user fred
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow not enabled
+acl: acl.deny not enabled
+acl: changes have source "push" - skipping
+rolling back last transaction
+0:6675d58eff77
+
+No [acl.allow]/[acl.deny]
+Pushing as user fred
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow not enabled
+acl: acl.deny not enabled
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: allowing changeset 911600dab2ae
+rolling back last transaction
+0:6675d58eff77
+
+Empty [acl.allow]
+Pushing as user fred
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 0 entries for user fred
+acl: acl.deny not enabled
+acl: user fred not allowed on foo/file.txt
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
+abort: acl: access denied for changeset ef1ea85a6374
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+fred is allowed inside foo/
+Pushing as user fred
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user fred
+acl: acl.deny not enabled
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: user fred not allowed on quux/file.py
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+abort: acl: access denied for changeset 911600dab2ae
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+Empty [acl.deny]
+Pushing as user barney
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 0 entries for user barney
+acl: acl.deny enabled, 0 entries for user barney
+acl: user barney not allowed on foo/file.txt
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
+abort: acl: access denied for changeset ef1ea85a6374
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+fred is allowed inside foo/, but not foo/bar/ (case matters)
+Pushing as user fred
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user fred
+acl: acl.deny enabled, 1 entries for user fred
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: user fred not allowed on quux/file.py
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+abort: acl: access denied for changeset 911600dab2ae
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+fred is allowed inside foo/, but not foo/Bar/
+Pushing as user fred
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+foo/Bar/** = fred
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user fred
+acl: acl.deny enabled, 2 entries for user fred
+acl: allowing changeset ef1ea85a6374
+acl: user fred denied on foo/Bar/file.txt
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset f9cafe1212c8
+abort: acl: access denied for changeset f9cafe1212c8
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+barney is not mentioned => not allowed anywhere
+Pushing as user barney
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+foo/Bar/** = fred
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 0 entries for user barney
+acl: acl.deny enabled, 0 entries for user barney
+acl: user barney not allowed on foo/file.txt
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset ef1ea85a6374
+abort: acl: access denied for changeset ef1ea85a6374
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+barney is allowed everywhere
+Pushing as user barney
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+foo/Bar/** = fred
+[acl.allow]
+** = barney
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user barney
+acl: acl.deny enabled, 0 entries for user barney
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: allowing changeset 911600dab2ae
+rolling back last transaction
+0:6675d58eff77
+
+wilma can change files with a .txt extension
+Pushing as user wilma
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+foo/Bar/** = fred
+[acl.allow]
+** = barney
+**/*.txt = wilma
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user wilma
+acl: acl.deny enabled, 0 entries for user wilma
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: user wilma not allowed on quux/file.py
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+abort: acl: access denied for changeset 911600dab2ae
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+file specified by acl.config does not exist
+Pushing as user barney
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+foo/Bar/** = fred
+[acl.allow]
+** = barney
+**/*.txt = wilma
+[acl]
+config = ../acl.config
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user barney
+acl: acl.deny enabled, 0 entries for user barney
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: allowing changeset 911600dab2ae
+rolling back last transaction
+0:6675d58eff77
+
+betty is allowed inside foo/ by a acl.config file
+Pushing as user betty
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+foo/Bar/** = fred
+[acl.allow]
+** = barney
+**/*.txt = wilma
+[acl]
+config = ../acl.config
+"""
+acl.config = """
+[acl.allow]
+foo/** = betty
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user betty
+acl: acl.deny enabled, 0 entries for user betty
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: user betty not allowed on quux/file.py
+error: pretxnchangegroup.acl hook failed: acl: access denied for changeset 911600dab2ae
+abort: acl: access denied for changeset 911600dab2ae
+transaction abort!
+rollback completed
+no rollback information available
+0:6675d58eff77
+
+acl.config can set only [acl.allow]/[acl.deny]
+Pushing as user barney
+hgrc = """
+[hooks]
+pretxnchangegroup.acl = python:hgext.acl.hook
+[acl]
+sources = push
+[acl.allow]
+foo/** = fred
+[acl.deny]
+foo/bar/** = fred
+foo/Bar/** = fred
+[acl.allow]
+** = barney
+**/*.txt = wilma
+[acl]
+config = ../acl.config
+"""
+acl.config = """
+[acl.allow]
+foo/** = betty
+[hooks]
+changegroup.acl = false
+"""
+pushing to ../b
+searching for changes
+common changesets up to 6675d58eff77
+adding changesets
+add changeset ef1ea85a6374
+add changeset f9cafe1212c8
+add changeset 911600dab2ae
+adding manifests
+adding file changes
+adding foo/Bar/file.txt revisions
+adding foo/file.txt revisions
+adding quux/file.py revisions
+added 3 changesets with 3 changes to 3 files
+calling hook pretxnchangegroup.acl: hgext.acl.hook
+acl: acl.allow enabled, 1 entries for user barney
+acl: acl.deny enabled, 0 entries for user barney
+acl: allowing changeset ef1ea85a6374
+acl: allowing changeset f9cafe1212c8
+acl: allowing changeset 911600dab2ae
+rolling back last transaction
+0:6675d58eff77
+
--- a/tests/test-bad-pull	Tue Oct 17 18:54:37 2006 -0500
+++ b/tests/test-bad-pull	Tue Oct 17 19:04:13 2006 -0500
@@ -2,7 +2,7 @@
 
 hg clone http://localhost:20059/ copy
 echo $?
-ls copy 2>/dev/null || echo copy: No such file or directory
+test -e copy || echo copy: No such file or directory
 
 cat > dumb.py <<EOF
 import BaseHTTPServer, SimpleHTTPServer, signal
--- a/tests/test-bundle	Tue Oct 17 18:54:37 2006 -0500
+++ b/tests/test-bundle	Tue Oct 17 19:04:13 2006 -0500
@@ -57,4 +57,5 @@
 hg -R bundle://../full.hg log
 hg incoming bundle://../full.hg
 hg -R bundle://../full.hg outgoing ../partial2
+hg -R bundle://../does-not-exist.hg outgoing ../partial2
 cd ..
--- a/tests/test-bundle.out	Tue Oct 17 18:54:37 2006 -0500
+++ b/tests/test-bundle.out	Tue Oct 17 19:04:13 2006 -0500
@@ -208,3 +208,4 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     0.3m
 
+abort: No such file or directory: ../does-not-exist.hg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-config-case	Tue Oct 17 19:04:13 2006 -0500
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+echo '[Section]' >> $HGRCPATH
+echo 'KeY = Case Sensitive' >> $HGRCPATH
+echo 'key = lower case' >> $HGRCPATH
+
+hg showconfig
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-config-case.out	Tue Oct 17 19:04:13 2006 -0500
@@ -0,0 +1,2 @@
+Section.KeY=Case Sensitive
+Section.key=lower case
--- a/tests/test-empty-dir	Tue Oct 17 18:54:37 2006 -0500
+++ b/tests/test-empty-dir	Tue Oct 17 19:04:13 2006 -0500
@@ -11,6 +11,6 @@
 cat sub/b
 hg co 0
 cat sub/b 2>/dev/null || echo "sub/b not present"
-ls sub 2>/dev/null || echo "sub not present"
+test -e sub || echo "sub not present"
 
 true
--- a/tests/test-static-http	Tue Oct 17 18:54:37 2006 -0500
+++ b/tests/test-static-http	Tue Oct 17 19:04:13 2006 -0500
@@ -2,7 +2,7 @@
 
 http_proxy= hg clone static-http://localhost:20059/ copy
 echo $?
-ls copy 2>/dev/null || echo copy: No such file or directory
+test -e copy || echo copy: No such file or directory
 
 # This server doesn't do range requests so it's basically only good for
 # one pull