--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/hgweb.fcgi Wed Apr 28 13:45:57 2010 -0500
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+#
+# An example FastCGI script for use with flup, edit as necessary
+
+# Path to repo or hgweb config to serve (see 'hg help hgweb')
+config = "/path/to/repo/or/config"
+
+# Uncomment and adjust if Mercurial is not installed system-wide:
+#import sys; sys.path.insert(0, "/path/to/python/lib")
+
+# Uncomment to send python tracebacks to the browser if an error occurs:
+#import cgitb; cgitb.enable()
+
+from mercurial import demandimport; demandimport.enable()
+from mercurial.hgweb import hgweb
+from flup.server.fcgi import WSGIServer
+application = hgweb(config)
+WSGIServer(application).run()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/hgweb.wsgi Wed Apr 28 13:45:57 2010 -0500
@@ -0,0 +1,16 @@
+# An example WSGI for use with mod_wsgi, edit as necessary
+
+# Path to repo or hgweb config to serve (see 'hg help hgweb')
+config = "/path/to/repo/or/config"
+
+# Uncomment and adjust if Mercurial is not installed system-wide:
+#import sys; sys.path.insert(0, "/path/to/python/lib")
+
+# Uncomment to send python tracebacks to the browser if an error occurs:
+#import cgitb; cgitb.enable()
+
+# enable demandloading to reduce startup time
+from mercurial import demandimport; demandimport.enable()
+
+from mercurial.hgweb import hgweb
+application = hgweb(config)
--- a/contrib/hgwebdir.fcgi Sat Apr 24 01:41:32 2010 -0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-#
-# An example CGI script to export multiple hgweb repos, edit as necessary
-
-# adjust python path if not a system-wide install:
-#import sys
-#sys.path.insert(0, "/path/to/python/lib")
-
-# enable demandloading to reduce startup time
-from mercurial import demandimport; demandimport.enable()
-
-# Uncomment to send python tracebacks to the browser if an error occurs:
-#import cgitb
-#cgitb.enable()
-
-# If you'd like to serve pages with UTF-8 instead of your default
-# locale charset, you can do so by uncommenting the following lines.
-# Note that this will cause your .hgrc files to be interpreted in
-# UTF-8 and all your repo files to be displayed using UTF-8.
-#
-#import os
-#os.environ["HGENCODING"] = "UTF-8"
-
-from mercurial.hgweb.hgwebdir_mod import hgwebdir
-from flup.server.fcgi import WSGIServer
-
-# The config file looks like this. You can have paths to individual
-# repos, collections of repos in a directory tree, or both.
-#
-# [paths]
-# virtual/path1 = /real/path1
-# virtual/path2 = /real/path2
-# virtual/root = /real/root/*
-# / = /real/root2/*
-#
-# [collections]
-# /prefix/to/strip/off = /root/of/tree/full/of/repos
-#
-# paths example:
-#
-# * First two lines mount one repository into one virtual path, like
-# '/real/path1' into 'virtual/path1'.
-#
-# * The third entry tells every mercurial repository found in
-# '/real/root', recursively, should be mounted in 'virtual/root'. This
-# format is preferred over the [collections] one, using absolute paths
-# as configuration keys is not supported on every platform (including
-# Windows).
-#
-# * The last entry is a special case mounting all repositories in
-# '/real/root2' in the root of the virtual directory.
-#
-# collections example: say directory tree /foo contains repos /foo/bar,
-# /foo/quux/baz. Give this config section:
-# [collections]
-# /foo = /foo
-# Then repos will list as bar and quux/baz.
-#
-# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
-# or use a dictionary with entries like 'virtual/path': '/real/path'
-
-WSGIServer(hgwebdir('hgweb.config')).run()
--- a/contrib/hgwebdir.wsgi Sat Apr 24 01:41:32 2010 -0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-# An example WSGI (use with mod_wsgi) script to export multiple hgweb repos
-
-# adjust python path if not a system-wide install:
-#import sys
-#sys.path.insert(0, "/path/to/python/lib")
-
-# enable demandloading to reduce startup time
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb.hgwebdir_mod import hgwebdir
-
-# If you'd like to serve pages with UTF-8 instead of your default
-# locale charset, you can do so by uncommenting the following lines.
-# Note that this will cause your .hgrc files to be interpreted in
-# UTF-8 and all your repo files to be displayed using UTF-8.
-#
-#import os
-#os.environ["HGENCODING"] = "UTF-8"
-
-# The config file looks like this. You can have paths to individual
-# repos, collections of repos in a directory tree, or both.
-#
-# [paths]
-# virtual/path1 = /real/path1
-# virtual/path2 = /real/path2
-# virtual/root = /real/root/*
-# / = /real/root2/*
-#
-# paths example:
-#
-# * First two lines mount one repository into one virtual path, like
-# '/real/path1' into 'virtual/path1'.
-#
-# * The third entry tells every mercurial repository found in
-# '/real/root', recursively, should be mounted in 'virtual/root'. This
-# format is preferred over the [collections] one, using absolute paths
-# as configuration keys is not supported on every platform (including
-# Windows).
-#
-# * The last entry is a special case mounting all repositories in
-# '/real/root2' in the root of the virtual directory.
-#
-# collections example: say directory tree /foo contains repos /foo/bar,
-# /foo/quux/baz. Give this config section:
-# [collections]
-# /foo = /foo
-# Then repos will list as bar and quux/baz.
-#
-# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
-# or use a dictionary with entries like 'virtual/path': '/real/path'
-
-application = hgwebdir('hgweb.config')
--- a/contrib/mercurial.spec Sat Apr 24 01:41:32 2010 -0300
+++ b/contrib/mercurial.spec Wed Apr 28 13:45:57 2010 -0500
@@ -44,8 +44,6 @@
install contrib/hgk $RPM_BUILD_ROOT%{_bindir}
install contrib/convert-repo $RPM_BUILD_ROOT%{_bindir}/mercurial-convert-repo
install contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}
-install contrib/git-viz/hg-viz $RPM_BUILD_ROOT%{_bindir}
-install contrib/git-viz/git-rev-tree $RPM_BUILD_ROOT%{_bindir}
bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
mkdir -p $bash_completion_dir
@@ -77,8 +75,6 @@
%{_bindir}/hg
%{_bindir}/hgk
%{_bindir}/hg-ssh
-%{_bindir}/hg-viz
-%{_bindir}/git-rev-tree
%{_bindir}/mercurial-convert-repo
%dir %{_sysconfdir}/bash_completion.d/
%dir %{_datadir}/zsh/site-functions/
--- a/contrib/win32/win32-build.txt Sat Apr 24 01:41:32 2010 -0300
+++ b/contrib/win32/win32-build.txt Wed Apr 28 13:45:57 2010 -0500
@@ -82,16 +82,10 @@
Microsoft.VC90.MFC.manifest)
Before building the installer, you have to build Mercurial HTML documentation
-(or fix mercurial.iss to not reference the doc directory). Docutils does not
-come with a ready-made script for rst2html.py, so you will have to write your
-own and put it in %PATH% like:
-
- @python c:\pythonXX\scripts\rst2html.py %*
-
-Then build the documentation with:
+(or fix mercurial.iss to not reference the doc directory):
cd doc
- mingw32-make RST2HTML=rst2html.bat html
+ mingw32-make html
cd ..
If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss
@@ -113,7 +107,7 @@
echo compiler=mingw32 >> setup.cfg
python setup.py py2exe -b 1
cd doc
- mingw32-make RST2HTML=rst2html.bat html
+ mingw32-make html
cd ..
iscc contrib\win32\mercurial.iss /DVERSION=snapshot
--- a/contrib/wix/contrib.wxs Sat Apr 24 01:41:32 2010 -0300
+++ b/contrib/wix/contrib.wxs Wed Apr 28 13:45:57 2010 -0500
@@ -16,8 +16,8 @@
<Component Id="contrib" Guid="$(var.contrib.guid)">
<File Name="bash_completion" KeyPath="yes" />
<File Name="hgk" />
- <File Name="hgwebdir.fcgi" />
- <File Name="hgwebdir.wsgi" />
+ <File Name="hgweb.fcgi" />
+ <File Name="hgweb.wsgi" />
<File Name="logo-droplets.svg" />
<File Name="mercurial.el" />
<File Name="sample.hgrc" />
--- a/contrib/wix/guids.wxi Sat Apr 24 01:41:32 2010 -0300
+++ b/contrib/wix/guids.wxi Wed Apr 28 13:45:57 2010 -0500
@@ -5,7 +5,7 @@
your project. Component GUIDs have global namespace! -->
<!-- contrib.wxs -->
- <?define contrib.guid = {B2EB15EA-F5F2-40c7-97EB-944DBED85F83} ?>
+ <?define contrib.guid = {F17D27B7-4A6B-4cd2-AE72-FED3CFAA585E} ?>
<?define contrib.vim.guid = {56B49B46-6657-405d-9E91-3FA68D011471} ?>
<!-- doc.wxs -->
--- a/doc/hgrc.5.txt Sat Apr 24 01:41:32 2010 -0300
+++ b/doc/hgrc.5.txt Wed Apr 28 13:45:57 2010 -0500
@@ -110,6 +110,19 @@
A line with ``%unset name`` will remove ``name`` from the current
section, if it has been set previously.
+The values are either free-form text strings, lists of text strings,
+or Boolean values. Boolean values can be set to true using any of "1",
+"yes", "true", or "on" and to false using "0", "no", "false", or "off"
+(all case insensitive).
+
+List values are separated by whitespace or comma, except when values are
+placed in double quotation marks::
+
+ allow_read = "John Doe, PhD", brian, betty
+
+Quotation marks can be escaped by prefixing them with a backslash. Only
+quotation marks at the beginning of a word is counted as a quotation
+(e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
Sections
--------
@@ -862,20 +875,18 @@
push is not allowed. If the special value ``*``, any remote user can
push, including unauthenticated users. Otherwise, the remote user
must have been authenticated, and the authenticated user name must
- be present in this list (separated by whitespace or ``,``). The
- contents of the allow_push list are examined after the deny_push
- list.
+ be present in this list. The contents of the allow_push list are
+ examined after the deny_push list.
``allow_read``
If the user has not already been denied repository access due to
the contents of deny_read, this list determines whether to grant
repository access to the user. If this list is not empty, and the
- user is unauthenticated or not present in the list (separated by
- whitespace or ``,``), then access is denied for the user. If the
- list is empty or not set, then access is permitted to all users by
- default. Setting allow_read to the special value ``*`` is equivalent
- to it not being set (i.e. access is permitted to all users). The
- contents of the allow_read list are examined after the deny_read
- list.
+ user is unauthenticated or not present in the list, then access is
+ denied for the user. If the list is empty or not set, then access
+ is permitted to all users by default. Setting allow_read to the
+ special value ``*`` is equivalent to it not being set (i.e. access
+ is permitted to all users). The contents of the allow_read list are
+ examined after the deny_read list.
``allowzip``
(DEPRECATED) Whether to allow .zip downloading of repository
revisions. Default is False. This feature creates temporary files.
@@ -910,17 +921,15 @@
Whether to deny pushing to the repository. If empty or not set,
push is not denied. If the special value ``*``, all remote users are
denied push. Otherwise, unauthenticated users are all denied, and
- any authenticated user name present in this list (separated by
- whitespace or ``,``) is also denied. The contents of the deny_push
- list are examined before the allow_push list.
+ any authenticated user name present in this list is also denied. The
+ contents of the deny_push list are examined before the allow_push list.
``deny_read``
Whether to deny reading/viewing of the repository. If this list is
not empty, unauthenticated users are all denied, and any
- authenticated user name present in this list (separated by
- whitespace or ``,``) is also denied access to the repository. If set
- to the special value ``*``, all remote users are denied access
- (rarely needed ;). If deny_read is empty or not set, the
- determination of repository access depends on the presence and
+ authenticated user name present in this list is also denied access to
+ the repository. If set to the special value ``*``, all remote users
+ are denied access (rarely needed ;). If deny_read is empty or not set,
+ the determination of repository access depends on the presence and
content of the allow_read list (see description). If both
deny_read and allow_read are empty or not set, then access is
permitted to all users by default. If the repository is being
@@ -936,7 +945,7 @@
Textual description of the repository's purpose or contents.
Default is "unknown".
``encoding``
- Character encoding name.
+ Character encoding name. Default is the current locale charset.
Example: "UTF-8"
``errorlog``
Where to output the error log. Default is stderr.
--- a/hgext/color.py Sat Apr 24 01:41:32 2010 -0300
+++ b/hgext/color.py Wed Apr 28 13:45:57 2010 -0500
@@ -217,7 +217,7 @@
_("when to colorize (always, auto, or never)")))
try:
- import re
+ import re, pywintypes
from win32console import *
# http://msdn.microsoft.com/en-us/library/ms682088%28VS.85%29.aspx
@@ -243,7 +243,13 @@
}
stdout = GetStdHandle(STD_OUTPUT_HANDLE)
- origattr = stdout.GetConsoleScreenBufferInfo()['Attributes']
+ try:
+ origattr = stdout.GetConsoleScreenBufferInfo()['Attributes']
+ except pywintypes.error:
+ # stdout may be defined but not support
+ # GetConsoleScreenBufferInfo(), when called from subprocess or
+ # redirected.
+ raise ImportError()
ansire = re.compile('\033\[([^m]*)m([^\033]*)(.*)', re.MULTILINE | re.DOTALL)
def win32print(text, orig, **opts):
--- a/hgext/convert/git.py Sat Apr 24 01:41:32 2010 -0300
+++ b/hgext/convert/git.py Wed Apr 28 13:45:57 2010 -0500
@@ -16,7 +16,7 @@
# cannot remove environment variable. Just assume none have
# both issues.
if hasattr(os, 'unsetenv'):
- def gitcmd(self, s):
+ def gitopen(self, s):
prevgitdir = os.environ.get('GIT_DIR')
os.environ['GIT_DIR'] = self.path
try:
@@ -27,9 +27,14 @@
else:
os.environ['GIT_DIR'] = prevgitdir
else:
- def gitcmd(self, s):
+ def gitopen(self, s):
return util.popen('GIT_DIR=%s %s' % (self.path, s), 'rb')
+ def gitread(self, s):
+ fh = self.gitopen(s)
+ data = fh.read()
+ return data, fh.close()
+
def __init__(self, ui, path, rev=None):
super(convert_git, self).__init__(ui, path, rev=rev)
@@ -44,17 +49,22 @@
def getheads(self):
if not self.rev:
- fh = self.gitcmd('git rev-parse --branches --remotes')
- return fh.read().splitlines()
+ heads, ret = self.gitread('git rev-parse --branches --remotes')
+ heads = heads.splitlines()
else:
- fh = self.gitcmd("git rev-parse --verify %s" % self.rev)
- return [fh.read()[:-1]]
+ heads, ret = self.gitread("git rev-parse --verify %s" % self.rev)
+ heads = [heads[:-1]]
+ if ret:
+ raise util.Abort(_('cannot retrieve git heads'))
+ return heads
def catfile(self, rev, type):
if rev == "0" * 40:
raise IOError()
- fh = self.gitcmd("git cat-file %s %s" % (type, rev))
- return fh.read()
+ data, ret = self.gitread("git cat-file %s %s" % (type, rev))
+ if ret:
+ raise util.Abort(_('cannot read %r object at %s') % (type, rev))
+ return data
def getfile(self, name, rev):
return self.catfile(rev, "blob")
@@ -64,7 +74,7 @@
def getchanges(self, version):
self.modecache = {}
- fh = self.gitcmd("git diff-tree -z --root -m -r %s" % version)
+ fh = self.gitopen("git diff-tree -z --root -m -r %s" % version)
changes = []
seen = set()
entry = None
@@ -84,6 +94,8 @@
self.modecache[(f, h)] = (p and "x") or (s and "l") or ""
changes.append((f, h))
entry = None
+ if fh.close():
+ raise util.Abort(_('cannot read changes in %s') % version)
return (changes, {})
def getcommit(self, version):
@@ -123,7 +135,7 @@
def gettags(self):
tags = {}
- fh = self.gitcmd('git ls-remote --tags "%s"' % self.path)
+ fh = self.gitopen('git ls-remote --tags "%s"' % self.path)
prefix = 'refs/tags/'
for line in fh:
line = line.strip()
@@ -134,23 +146,25 @@
continue
tag = tag[len(prefix):-3]
tags[tag] = node
+ if fh.close():
+ raise util.Abort(_('cannot read tags from %s') % self.path)
return tags
def getchangedfiles(self, version, i):
changes = []
if i is None:
- fh = self.gitcmd("git diff-tree --root -m -r %s" % version)
+ fh = self.gitopen("git diff-tree --root -m -r %s" % version)
for l in fh:
if "\t" not in l:
continue
m, f = l[:-1].split("\t")
changes.append(f)
- fh.close()
else:
- fh = self.gitcmd('git diff-tree --name-only --root -r %s "%s^%s" --'
+ fh = self.gitopen('git diff-tree --name-only --root -r %s "%s^%s" --'
% (version, version, i + 1))
changes = [f.rstrip('\n') for f in fh]
- fh.close()
+ if fh.close():
+ raise util.Abort(_('cannot read changes in %s') % version)
return changes
--- a/hgext/zeroconf/__init__.py Sat Apr 24 01:41:32 2010 -0300
+++ b/hgext/zeroconf/__init__.py Wed Apr 28 13:45:57 2010 -0500
@@ -98,16 +98,17 @@
server.registerService(svc)
class hgwebzc(hgweb_mod.hgweb):
- def __init__(self, repo, name=None):
- super(hgwebzc, self).__init__(repo, name)
- name = self.reponame or os.path.basename(repo.root)
+ def __init__(self, repo, name=None, baseui=None):
+ super(hgwebzc, self).__init__(repo, name=name, baseui=baseui)
+ name = self.reponame or os.path.basename(self.repo.root)
path = self.repo.ui.config("web", "prefix", "").strip('/')
desc = self.repo.ui.config("web", "description", name)
- publish(name, desc, path, int(repo.ui.config("web", "port", 8000)))
+ publish(name, desc, path,
+ int(self.repo.ui.config("web", "port", 8000)))
class hgwebdirzc(hgwebdir_mod.hgwebdir):
def __init__(self, conf, baseui=None):
- super(hgwebdirzc, self).__init__(conf, baseui)
+ super(hgwebdirzc, self).__init__(conf, baseui=baseui)
prefix = self.ui.config("web", "prefix", "").strip('/') + '/'
for repo, path in self.repos:
u = self.ui.copy()
--- a/hgweb.cgi Sat Apr 24 01:41:32 2010 -0300
+++ b/hgweb.cgi Wed Apr 28 13:45:57 2010 -0500
@@ -1,28 +1,17 @@
#!/usr/bin/env python
#
-# An example CGI script to use hgweb, edit as necessary
+# An example hgweb CGI script, edit as necessary
-# adjust python path if not a system-wide install:
-#import sys
-#sys.path.insert(0, "/path/to/python/lib")
+# Path to repo or hgweb config to serve (see 'hg help hgweb')
+config = "/path/to/repo/or/config"
-# enable importing on demand to reduce startup time
-from mercurial import demandimport; demandimport.enable()
+# Uncomment and adjust if Mercurial is not installed system-wide:
+#import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
-#import cgitb
-#cgitb.enable()
+#import cgitb; cgitb.enable()
-# If you'd like to serve pages with UTF-8 instead of your default
-# locale charset, you can do so by uncommenting the following lines.
-# Note that this will cause your .hgrc files to be interpreted in
-# UTF-8 and all your repo files to be displayed using UTF-8.
-#
-#import os
-#os.environ["HGENCODING"] = "UTF-8"
-
-from mercurial.hgweb.hgweb_mod import hgweb
-import mercurial.hgweb.wsgicgi as wsgicgi
-
-application = hgweb("/path/to/repo", "repository name")
+from mercurial import demandimport; demandimport.enable()
+from mercurial.hgweb import hgweb, wsgicgi
+application = hgweb(config)
wsgicgi.launch(application)
--- a/hgwebdir.cgi Sat Apr 24 01:41:32 2010 -0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-#
-# An example CGI script to export multiple hgweb repos, edit as necessary
-
-# adjust python path if not a system-wide install:
-#import sys
-#sys.path.insert(0, "/path/to/python/lib")
-
-# enable importing on demand to reduce startup time
-from mercurial import demandimport; demandimport.enable()
-
-# Uncomment to send python tracebacks to the browser if an error occurs:
-#import cgitb
-#cgitb.enable()
-
-# If you'd like to serve pages with UTF-8 instead of your default
-# locale charset, you can do so by uncommenting the following lines.
-# Note that this will cause your .hgrc files to be interpreted in
-# UTF-8 and all your repo files to be displayed using UTF-8.
-#
-#import os
-#os.environ["HGENCODING"] = "UTF-8"
-
-from mercurial.hgweb.hgwebdir_mod import hgwebdir
-import mercurial.hgweb.wsgicgi as wsgicgi
-
-# The config file looks like this. You can have paths to individual
-# repos, collections of repos in a directory tree, or both.
-#
-# [paths]
-# virtual/path1 = /real/path1
-# virtual/path2 = /real/path2
-# virtual/root = /real/root/*
-# / = /real/root2/*
-# virtual/root2 = /real/root2/**
-#
-# [collections]
-# /prefix/to/strip/off = /root/of/tree/full/of/repos
-#
-# paths example:
-#
-# * First two lines mount one repository into one virtual path, like
-# '/real/path1' into 'virtual/path1'.
-#
-# * The third entry mounts every mercurial repository found in '/real/root'
-# in 'virtual/root'. This format is preferred over the [collections] one,
-# since using absolute paths as configuration keys is not supported on every
-# platform (especially on Windows).
-#
-# * The fourth entry is a special case mounting all repositories in
-# /'real/root2' in the root of the virtual directory.
-#
-# * The fifth entry recursively finds all repositories under the real root,
-# and mounts them using their relative path (to given real root) under the
-# virtual root.
-#
-# collections example: say directory tree /foo contains repos /foo/bar,
-# /foo/quux/baz. Give this config section:
-# [collections]
-# /foo = /foo
-# Then repos will list as bar and quux/baz.
-#
-# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
-# or use a dictionary with entries like 'virtual/path': '/real/path'
-
-application = hgwebdir('hgweb.config')
-wsgicgi.launch(application)
--- a/mercurial/cmdutil.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/cmdutil.py Wed Apr 28 13:45:57 2010 -0500
@@ -1113,7 +1113,7 @@
fncache.setdefault(rev, [])
fncache[rev].append(file_)
wanted.add(rev)
- if follow and copied:
+ if copied:
copies.append(copied)
if slowpath:
if follow:
--- a/mercurial/commands.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/commands.py Wed Apr 28 13:45:57 2010 -0500
@@ -11,8 +11,7 @@
import os, re, sys, difflib, time, tempfile
import hg, util, revlog, bundlerepo, extensions, copies, error
import patch, help, mdiff, url, encoding, templatekw
-import archival, changegroup, cmdutil, sshserver, hbisect
-from hgweb import server, hgweb_mod, hgwebdir_mod
+import archival, changegroup, cmdutil, sshserver, hbisect, hgweb, hgweb.server
import merge as mergemod
import minirst
@@ -2379,13 +2378,20 @@
Show definition of symbolic path name NAME. If no name is given,
show definition of all available names.
- Path names are defined in the [paths] section of /etc/mercurial/hgrc
- and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
-
- The names 'default' and 'default-push' have a special meaning.
- They are the locations used when pulling and pushing respectively
- unless a location is specified. When cloning a repository, the
- clone source is written as 'default' in .hg/hgrc.
+ Path names are defined in the [paths] section of
+ ``/etc/mercurial/hgrc`` and ``$HOME/.hgrc``. If run inside a
+ repository, ``.hg/hgrc`` is used, too.
+
+ The path names ``default`` and ``default-push`` have a special
+ meaning. When performing a push or pull operation, they are used
+ as fallbacks if no location is specified on the command-line.
+ When ``default-push`` is set, it will be used for push and
+ ``default`` will be used for pull; otherwise ``default`` is used
+ as the fallback for both. When cloning a repository, the clone
+ source is written as ``default`` in ``.hg/hgrc``. Note that
+ ``default`` and ``default-push`` apply to all inbound (e.g.
+ :hg:`incoming`) and outbound (e.g. :hg:`outgoing`, :hg:`email` and
+ :hg:`bundle`) operations.
See :hg:`help urls` for more information.
"""
@@ -2938,18 +2944,19 @@
if repo and repo.ui != baseui:
repo.ui.setconfig("web", o, val)
- if opts.get('webdir_conf'):
- app = hgwebdir_mod.hgwebdir(opts['webdir_conf'], ui)
- elif repo is not None:
- app = hgweb_mod.hgweb(hg.repository(repo.ui, repo.root))
- else:
- raise error.RepoError(_("There is no Mercurial repository"
- " here (.hg not found)"))
+ o = opts.get('web_conf') or opts.get('webdir_conf')
+ if not o:
+ if not repo:
+ raise error.RepoError(_("There is no Mercurial repository"
+ " here (.hg not found)"))
+ o = repo.root
+
+ app = hgweb.hgweb(o, baseui=ui)
class service(object):
def init(self):
util.set_signal_handler()
- self.httpd = server.create_server(ui, app)
+ self.httpd = hgweb.server.create_server(ui, app)
if opts['port'] and not ui.verbose:
return
@@ -3851,8 +3858,10 @@
_('prefix path to serve from (default: server root)')),
('n', 'name', '',
_('name to show in web pages (default: working directory)')),
- ('', 'webdir-conf', '', _('name of the webdir config file'
+ ('', 'web-conf', '', _('name of the hgweb config file'
' (serve more than one repository)')),
+ ('', 'webdir-conf', '', _('name of the hgweb config file'
+ ' (DEPRECATED)')),
('', 'pid-file', '', _('name of file to write process ID to')),
('', 'stdio', None, _('for remote clients')),
('t', 'templates', '', _('web templates to use')),
--- a/mercurial/help.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/help.py Wed Apr 28 13:45:57 2010 -0500
@@ -97,4 +97,5 @@
loaddoc('templates')),
(['urls'], _('URL Paths'), loaddoc('urls')),
(["extensions"], _("Using additional features"), extshelp),
+ (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
)
--- a/mercurial/help/config.txt Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/help/config.txt Wed Apr 28 13:45:57 2010 -0500
@@ -5,12 +5,13 @@
- ``<repo>\.hg\hgrc``
- ``%USERPROFILE%\.hgrc``
-- ``%USERPROFILE%\Mercurial.ini``
+- ``%USERPROFILE%\mercurial.ini``
- ``%HOME%\.hgrc``
-- ``%HOME%\Mercurial.ini``
-- ``C:\Mercurial\Mercurial.ini``
-- ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial``
-- ``<install-dir>\Mercurial.ini``
+- ``%HOME%\mercurial.ini``
+- ``C:\mercurial\mercurial.ini`` (unless regkey or hgrc.d\ or mercurial.ini found)
+- ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (unless hgrc.d\ or mercurial.ini found)
+- ``<hg.exe-dir>\hgrc.d\*.rc`` (unless mercurial.ini found)
+- ``<hg.exe-dir>\mercurial.ini``
On Unix, these files are read:
@@ -29,7 +30,7 @@
username = Firstname Lastname <firstname.lastname@example.net>
verbose = True
-This above entries will be referred to as ``ui.username`` and
+The above entries will be referred to as ``ui.username`` and
``ui.verbose``, respectively. Please see the hgrc man page for a full
description of the possible configuration values:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/help/hgweb.txt Wed Apr 28 13:45:57 2010 -0500
@@ -0,0 +1,46 @@
+Mercurial's internal web server, hgweb, can serve either a single
+repository, or a collection of them. In the latter case, a special
+configuration file can be used to specify the repository paths to use
+and global web configuration options.
+
+This file uses the same syntax as hgrc configuration files, but only
+the following sections are recognized:
+
+ - web
+ - paths
+ - collections
+
+The ``web`` section can specify all the settings described in the web
+section of the hgrc documentation.
+
+The ``paths`` section provides mappings of physical repository
+paths to virtual ones. For instance::
+
+ [paths]
+ projects/a = /foo/bar
+ projects/b = /baz/quux
+ web/root = /real/root/*
+ / = /real/root2/*
+ virtual/root2 = /real/root2/**
+
+- The first two entries make two repositories in different directories
+ appear under the same directory in the web interface
+- The third entry maps every Mercurial repository found in '/real/root'
+ into 'web/root'. This format is preferred over the [collections] one,
+ since using absolute paths as configuration keys is not supported on every
+ platform (especially on Windows).
+- The fourth entry is a special case mapping all repositories in
+ '/real/root2' in the root of the virtual directory.
+- The fifth entry recursively finds all repositories under the real
+ root, and maps their relative paths under the virtual root.
+
+The ``collections`` section provides mappings of trees of physical
+repositories paths to virtual ones, though the paths syntax is generally
+preferred. For instance::
+
+ [collections]
+ /foo = /foo
+
+Here, the left side will be stripped off all repositories found in the
+right side. Thus ``/foo/bar`` and ``foo/quux/baz`` will be listed as
+``bar`` and ``quux/baz`` respectively.
--- a/mercurial/hgweb/__init__.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/hgweb/__init__.py Wed Apr 28 13:45:57 2010 -0500
@@ -6,11 +6,26 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
+import os
import hgweb_mod, hgwebdir_mod
-def hgweb(*args, **kwargs):
- return hgweb_mod.hgweb(*args, **kwargs)
+def hgweb(config, name=None, baseui=None):
+ '''create an hgweb wsgi object
-def hgwebdir(*args, **kwargs):
- return hgwebdir_mod.hgwebdir(*args, **kwargs)
+ config can be one of:
+ - repo object (single repo view)
+ - path to repo (single repo view)
+ - path to config file (multi-repo view)
+ - dict of virtual:real pairs (multi-repo view)
+ - list of virtual:real tuples (multi-repo view)
+ '''
+ if ((isinstance(config, str) and not os.path.isdir(config)) or
+ isinstance(config, dict) or isinstance(config, list)):
+ # create a multi-dir interface
+ return hgwebdir_mod.hgwebdir(config, baseui=baseui)
+ return hgweb_mod.hgweb(config, name=name, baseui=baseui)
+
+def hgwebdir(config, baseui=None):
+ return hgwebdir_mod.hgwebdir(config, baseui=baseui)
+
--- a/mercurial/hgweb/hgweb_mod.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/hgweb/hgweb_mod.py Wed Apr 28 13:45:57 2010 -0500
@@ -21,15 +21,18 @@
}
class hgweb(object):
- def __init__(self, repo, name=None):
+ def __init__(self, repo, name=None, baseui=None):
if isinstance(repo, str):
- u = ui.ui()
- u.setconfig('ui', 'report_untrusted', 'off')
- u.setconfig('ui', 'interactive', 'off')
+ if baseui:
+ u = baseui.copy()
+ else:
+ u = ui.ui()
self.repo = hg.repository(u, repo)
else:
self.repo = repo
+ self.repo.ui.setconfig('ui', 'report_untrusted', 'off')
+ self.repo.ui.setconfig('ui', 'interactive', 'off')
hook.redirect(True)
self.mtime = -1
self.reponame = name
--- a/mercurial/minirst.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/minirst.py Wed Apr 28 13:45:57 2010 -0500
@@ -225,6 +225,8 @@
return blocks, pruned
+_sectionre = re.compile(r"""^([-=`:.'"~^_*+#])\1+$""")
+
def findsections(blocks):
"""Finds sections.
@@ -240,14 +242,17 @@
# +------------------------------+
if (block['type'] == 'paragraph' and
len(block['lines']) == 2 and
- block['lines'][1] == '-' * len(block['lines'][0])):
+ len(block['lines'][0]) == len(block['lines'][1]) and
+ _sectionre.match(block['lines'][1])):
+ block['underline'] = block['lines'][1][0]
block['type'] = 'section'
+ del block['lines'][1]
return blocks
def inlineliterals(blocks):
for b in blocks:
- if b['type'] == 'paragraph':
+ if b['type'] in ('paragraph', 'section'):
b['lines'] = [l.replace('``', '"') for l in b['lines']]
return blocks
@@ -256,7 +261,7 @@
def hgrole(blocks):
for b in blocks:
- if b['type'] == 'paragraph':
+ if b['type'] in ('paragraph', 'section'):
b['lines'] = [_hgrolere.sub(r'"hg \1"', l) for l in b['lines']]
return blocks
@@ -289,7 +294,8 @@
indent += ' '
return indent + ('\n' + indent).join(block['lines'])
if block['type'] == 'section':
- return indent + ('\n' + indent).join(block['lines'])
+ underline = len(block['lines'][0]) * block['underline']
+ return "%s%s\n%s%s" % (indent, block['lines'][0],indent, underline)
if block['type'] == 'definition':
term = indent + block['lines'][0]
hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
@@ -341,11 +347,11 @@
b['indent'] += indent
blocks = findliteralblocks(blocks)
blocks, pruned = prunecontainers(blocks, keep or [])
+ blocks = findsections(blocks)
blocks = inlineliterals(blocks)
blocks = hgrole(blocks)
blocks = splitparagraphs(blocks)
blocks = updatefieldlists(blocks)
- blocks = findsections(blocks)
blocks = addmargins(blocks)
text = '\n'.join(formatblock(b, width) for b in blocks)
if keep is None:
--- a/mercurial/patch.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/patch.py Wed Apr 28 13:45:57 2010 -0500
@@ -303,6 +303,9 @@
isexec = mode & 0100
self.mode = (islink, isexec)
+ def __repr__(self):
+ return "<patchmeta %s %r>" % (self.op, self.path)
+
def readgitpatch(lr):
"""extract git-style metadata about patches from <patchname>"""
@@ -344,8 +347,6 @@
gp.path = line[8:]
elif line.startswith('deleted file'):
gp.op = 'DELETE'
- # is the deleted file a symlink?
- gp.setmode(int(line[-6:], 8))
elif line.startswith('new file mode '):
gp.op = 'ADD'
gp.setmode(int(line[-6:], 8))
@@ -906,24 +907,25 @@
return s
return s[:i]
+def pathstrip(path, strip):
+ pathlen = len(path)
+ i = 0
+ if strip == 0:
+ return '', path.rstrip()
+ count = strip
+ while count > 0:
+ i = path.find('/', i)
+ if i == -1:
+ raise PatchError(_("unable to strip away %d of %d dirs from %s") %
+ (count, strip, path))
+ i += 1
+ # consume '//' in the path
+ while i < pathlen - 1 and path[i] == '/':
+ i += 1
+ count -= 1
+ return path[:i].lstrip(), path[i:].rstrip()
+
def selectfile(afile_orig, bfile_orig, hunk, strip):
- def pathstrip(path, count=1):
- pathlen = len(path)
- i = 0
- if count == 0:
- return '', path.rstrip()
- while count > 0:
- i = path.find('/', i)
- if i == -1:
- raise PatchError(_("unable to strip away %d dirs from %s") %
- (count, path))
- i += 1
- # consume '//' in the path
- while i < pathlen - 1 and path[i] == '/':
- i += 1
- count -= 1
- return path[:i].lstrip(), path[i:].rstrip()
-
nulla = afile_orig == "/dev/null"
nullb = bfile_orig == "/dev/null"
abase, afile = pathstrip(afile_orig, strip)
@@ -1151,8 +1153,8 @@
rejects = 0
err = 0
current_file = None
- gitpatches = None
- opener = util.opener(os.getcwd())
+ cwd = os.getcwd()
+ opener = util.opener(cwd)
def closefile():
if not current_file:
@@ -1164,8 +1166,7 @@
if state == 'hunk':
if not current_file:
continue
- current_hunk = values
- ret = current_file.apply(current_hunk)
+ ret = current_file.apply(values)
if ret >= 0:
changed.setdefault(current_file.fname, None)
if ret > 0:
@@ -1184,13 +1185,14 @@
missing=missing, eolmode=eolmode)
except PatchError, err:
ui.warn(str(err) + '\n')
- current_file, current_hunk = None, None
+ current_file = None
rejects += 1
continue
elif state == 'git':
- gitpatches = values
- cwd = os.getcwd()
- for gp in gitpatches:
+ for gp in values:
+ gp.path = pathstrip(gp.path, strip - 1)[1]
+ if gp.oldpath:
+ gp.oldpath = pathstrip(gp.oldpath, strip - 1)[1]
if gp.op in ('COPY', 'RENAME'):
copyfn(gp.oldpath, gp.path, cwd)
changed[gp.path] = gp
@@ -1237,8 +1239,7 @@
if gp.op == 'ADD' and not os.path.exists(dst):
flags = (isexec and 'x' or '') + (islink and 'l' or '')
repo.wwrite(gp.path, '', flags)
- elif gp.op != 'DELETE':
- util.set_flags(dst, islink, isexec)
+ util.set_flags(dst, islink, isexec)
cmdutil.addremove(repo, cfiles, similarity=similarity)
files = patches.keys()
files.extend([r for r in removes if r not in files])
--- a/mercurial/posix.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/posix.py Wed Apr 28 13:45:57 2010 -0500
@@ -265,3 +265,27 @@
def gethgcmd():
return sys.argv[:1]
+
+def termwidth_():
+ try:
+ import termios, array, fcntl
+ for dev in (sys.stderr, sys.stdout, sys.stdin):
+ try:
+ try:
+ fd = dev.fileno()
+ except AttributeError:
+ continue
+ if not os.isatty(fd):
+ continue
+ arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8)
+ return array.array('h', arri)[1]
+ except ValueError:
+ pass
+ except IOError, e:
+ if e[0] == errno.EINVAL:
+ pass
+ else:
+ raise
+ except ImportError:
+ pass
+ return 80
--- a/mercurial/tags.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/tags.py Wed Apr 28 13:45:57 2010 -0500
@@ -337,4 +337,3 @@
cachefile.write("%s %s\n" % (hex(node), name))
cachefile.rename()
- cachefile.close()
--- a/mercurial/ui.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/ui.py Wed Apr 28 13:45:57 2010 -0500
@@ -154,11 +154,82 @@
def configlist(self, section, name, default=None, untrusted=False):
"""Return a list of comma/space separated strings"""
+
+ def _parse_plain(parts, s, offset):
+ whitespace = False
+ while offset < len(s) and (s[offset].isspace() or s[offset] == ','):
+ whitespace = True
+ offset += 1
+ if offset >= len(s):
+ return None, parts, offset
+ if whitespace:
+ parts.append('')
+ if s[offset] == '"' and not parts[-1]:
+ return _parse_quote, parts, offset + 1
+ elif s[offset] == '"' and parts[-1][-1] == '\\':
+ parts[-1] = parts[-1][:-1] + s[offset]
+ return _parse_plain, parts, offset + 1
+ parts[-1] += s[offset]
+ return _parse_plain, parts, offset + 1
+
+ def _parse_quote(parts, s, offset):
+ if offset < len(s) and s[offset] == '"': # ""
+ parts.append('')
+ offset += 1
+ while offset < len(s) and (s[offset].isspace() or
+ s[offset] == ','):
+ offset += 1
+ return _parse_plain, parts, offset
+
+ while offset < len(s) and s[offset] != '"':
+ if s[offset] == '\\' and offset + 1 < len(s) and s[offset + 1] == '"':
+ offset += 1
+ parts[-1] += '"'
+ else:
+ parts[-1] += s[offset]
+ offset += 1
+
+ if offset >= len(s):
+ real_parts = _configlist(parts[-1])
+ if not real_parts:
+ parts[-1] = '"'
+ else:
+ real_parts[0] = '"' + real_parts[0]
+ parts = parts[:-1]
+ parts.extend(real_parts)
+ return None, parts, offset
+
+ offset += 1
+ while offset < len(s) and s[offset] in [' ', ',']:
+ offset += 1
+
+ if offset < len(s):
+ if offset + 1 == len(s) and s[offset] == '"':
+ parts[-1] += '"'
+ offset += 1
+ else:
+ parts.append('')
+ else:
+ return None, parts, offset
+
+ return _parse_plain, parts, offset
+
+ def _configlist(s):
+ s = s.rstrip(' ,')
+ if not s:
+ return None
+ parser, parts, offset = _parse_plain, [''], 0
+ while parser:
+ parser, parts, offset = parser(parts, s, offset)
+ return parts
+
result = self.config(section, name, untrusted=untrusted)
if result is None:
result = default or []
if isinstance(result, basestring):
- result = result.replace(",", " ").split()
+ result = _configlist(result)
+ if result is None:
+ result = default or []
return result
def has_section(self, section, untrusted=False):
--- a/mercurial/util.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/util.py Wed Apr 28 13:45:57 2010 -0500
@@ -1252,35 +1252,6 @@
# Avoid double backslash in Windows path repr()
return repr(s).replace('\\\\', '\\')
-def termwidth():
- if 'COLUMNS' in os.environ:
- try:
- return int(os.environ['COLUMNS'])
- except ValueError:
- pass
- try:
- import termios, array, fcntl
- for dev in (sys.stderr, sys.stdout, sys.stdin):
- try:
- try:
- fd = dev.fileno()
- except AttributeError:
- continue
- if not os.isatty(fd):
- continue
- arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8)
- return array.array('h', arri)[1]
- except ValueError:
- pass
- except IOError, e:
- if e[0] == errno.EINVAL:
- pass
- else:
- raise
- except ImportError:
- pass
- return 80
-
def wrap(line, hangindent, width=None):
if width is None:
width = termwidth() - 2
@@ -1364,3 +1335,11 @@
if not i:
return False
return True
+
+def termwidth():
+ if 'COLUMNS' in os.environ:
+ try:
+ return int(os.environ['COLUMNS'])
+ except ValueError:
+ pass
+ return termwidth_()
--- a/mercurial/win32.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/win32.py Wed Apr 28 13:45:57 2010 -0500
@@ -16,7 +16,7 @@
import win32api
import errno, os, sys, pywintypes, win32con, win32file, win32process
-import winerror, win32gui
+import winerror, win32gui, win32console
import osutil, encoding
from win32com.shell import shell, shellcon
@@ -189,3 +189,16 @@
pid = win32process.GetCurrentProcessId()
win32gui.EnumWindows(callback, pid)
+
+def termwidth_():
+ try:
+ # Query stderr to avoid problems with redirections
+ screenbuf = win32console.GetStdHandle(win32console.STD_ERROR_HANDLE)
+ try:
+ window = screenbuf.GetConsoleScreenBufferInfo()['Window']
+ width = window.Right - window.Left
+ return width
+ finally:
+ screenbuf.Detach()
+ except pywintypes.error:
+ return 79
--- a/mercurial/windows.py Sat Apr 24 01:41:32 2010 -0300
+++ b/mercurial/windows.py Wed Apr 28 13:45:57 2010 -0500
@@ -356,6 +356,13 @@
def gethgcmd():
return [sys.executable] + sys.argv[:1]
+def termwidth_():
+ # cmd.exe does not handle CR like a unix console, the CR is
+ # counted in the line length. On 80 columns consoles, if 80
+ # characters are written, the following CR won't apply on the
+ # current line but on the new one. Keep room for it.
+ return 79
+
try:
# override functions with win32 versions if possible
from win32 import *
--- a/tests/test-convert-git Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-convert-git Wed Apr 28 13:45:57 2010 -0500
@@ -170,4 +170,17 @@
echo '% --sourceorder should fail'
hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg
+echo '% damage git repository and convert again'
+cat > damage.py <<EOF
+import os
+for root, dirs, files in os.walk('git-repo4/.git/objects'):
+ if files:
+ path = os.path.join(root, files[0])
+ os.remove(path)
+ break
+EOF
+python damage.py
+hg convert git-repo4 git-repo4-broken-hg 2>&1 | \
+ grep 'abort:' | sed 's/abort:.*/abort:/g'
+
true
--- a/tests/test-convert-git.out Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-convert-git.out Wed Apr 28 13:45:57 2010 -0500
@@ -127,3 +127,5 @@
% --sourceorder should fail
initializing destination git-repo4-sourcesort-hg repository
abort: --sourcesort is not supported by this data source
+% damage git repository and convert again
+abort:
--- a/tests/test-debugcomplete.out Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-debugcomplete.out Wed Apr 28 13:45:57 2010 -0500
@@ -143,7 +143,7 @@
--traceback
--verbose
--version
---webdir-conf
+--web-conf
-6
-A
-E
@@ -176,7 +176,7 @@
pull: update, force, rev, branch, ssh, remotecmd
push: force, rev, branch, ssh, remotecmd
remove: after, force, include, exclude
-serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
+serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude
summary: remote
update: clean, check, date, rev
--- a/tests/test-globalopts.out Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-globalopts.out Wed Apr 28 13:45:57 2010 -0500
@@ -212,6 +212,7 @@
templating Template Usage
urls URL Paths
extensions Using additional features
+ hgweb Configuring hgweb
use "hg -v help" to show aliases and global options
Mercurial Distributed SCM
@@ -281,6 +282,7 @@
templating Template Usage
urls URL Paths
extensions Using additional features
+ hgweb Configuring hgweb
use "hg -v help" to show aliases and global options
%% not tested: --debugger
--- a/tests/test-help.out Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-help.out Wed Apr 28 13:45:57 2010 -0500
@@ -105,6 +105,7 @@
templating Template Usage
urls URL Paths
extensions Using additional features
+ hgweb Configuring hgweb
use "hg -v help" to show aliases and global options
add add the specified files on the next commit
@@ -170,6 +171,7 @@
templating Template Usage
urls URL Paths
extensions Using additional features
+ hgweb Configuring hgweb
%% test short command list with verbose option
Mercurial Distributed SCM (version xxx)
@@ -595,6 +597,7 @@
templating Template Usage
urls URL Paths
extensions Using additional features
+ hgweb Configuring hgweb
use "hg -v help" to show aliases and global options
%% test list of commands with command with no help text
--- a/tests/test-minirst.py Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-minirst.py Wed Apr 28 13:45:57 2010 -0500
@@ -181,3 +181,19 @@
roles = """Please see :hg:`add`."""
debugformat('roles', roles, 60)
+
+
+sections = """
+Title
+=====
+
+Section
+-------
+
+Subsection
+''''''''''
+
+Markup: ``foo`` and :hg:`help`
+------------------------------
+"""
+debugformat('sections', sections, 20)
--- a/tests/test-minirst.py.out Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-minirst.py.out Wed Apr 28 13:45:57 2010 -0500
@@ -303,3 +303,18 @@
Please see "hg add".
----------------------------------------------------------------------
+sections formatted to fit within 20 characters:
+----------------------------------------------------------------------
+Title
+=====
+
+Section
+-------
+
+Subsection
+''''''''''
+
+Markup: "foo" and "hg help"
+---------------------------
+----------------------------------------------------------------------
+
--- a/tests/test-ui-config.py Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-ui-config.py Wed Apr 28 13:45:57 2010 -0500
@@ -11,6 +11,19 @@
'lists.list2=foo bar baz',
'lists.list3=alice, bob',
'lists.list4=foo bar baz alice, bob',
+ 'lists.list5=abc d"ef"g "hij def"',
+ 'lists.list6="hello world", "how are you?"',
+ 'lists.list7=Do"Not"Separate',
+ 'lists.list8="Do"Separate',
+ 'lists.list9="Do\\"NotSeparate"',
+ 'lists.list10=string "with extraneous" quotation mark"',
+ 'lists.list11=x, y',
+ 'lists.list12="x", "y"',
+ 'lists.list13=""" key = "x", "y" """',
+ 'lists.list14=,,,, ',
+ 'lists.list15=" just with starting quotation',
+ 'lists.list16="longer quotation" with "no ending quotation',
+ 'lists.list17=this is \\" "not a quotation mark"',
])
print repr(testui.configitems('values'))
@@ -36,6 +49,19 @@
print repr(testui.configlist('lists', 'list3'))
print repr(testui.configlist('lists', 'list4'))
print repr(testui.configlist('lists', 'list4', ['foo']))
+print repr(testui.configlist('lists', 'list5'))
+print repr(testui.configlist('lists', 'list6'))
+print repr(testui.configlist('lists', 'list7'))
+print repr(testui.configlist('lists', 'list8'))
+print repr(testui.configlist('lists', 'list9'))
+print repr(testui.configlist('lists', 'list10'))
+print repr(testui.configlist('lists', 'list11'))
+print repr(testui.configlist('lists', 'list12'))
+print repr(testui.configlist('lists', 'list13'))
+print repr(testui.configlist('lists', 'list14'))
+print repr(testui.configlist('lists', 'list15'))
+print repr(testui.configlist('lists', 'list16'))
+print repr(testui.configlist('lists', 'list17'))
print repr(testui.configlist('lists', 'unknown'))
print repr(testui.configlist('lists', 'unknown', ''))
print repr(testui.configlist('lists', 'unknown', 'foo'))
--- a/tests/test-ui-config.py.out Sat Apr 24 01:41:32 2010 -0300
+++ b/tests/test-ui-config.py.out Wed Apr 28 13:45:57 2010 -0500
@@ -1,5 +1,5 @@
[('string', 'string value'), ('bool1', 'true'), ('bool2', 'false')]
-[('list1', 'foo'), ('list2', 'foo bar baz'), ('list3', 'alice, bob'), ('list4', 'foo bar baz alice, bob')]
+[('list1', 'foo'), ('list2', 'foo bar baz'), ('list3', 'alice, bob'), ('list4', 'foo bar baz alice, bob'), ('list5', 'abc d"ef"g "hij def"'), ('list6', '"hello world", "how are you?"'), ('list7', 'Do"Not"Separate'), ('list8', '"Do"Separate'), ('list9', '"Do\\"NotSeparate"'), ('list10', 'string "with extraneous" quotation mark"'), ('list11', 'x, y'), ('list12', '"x", "y"'), ('list13', '""" key = "x", "y" """'), ('list14', ',,,, '), ('list15', '" just with starting quotation'), ('list16', '"longer quotation" with "no ending quotation'), ('list17', 'this is \\" "not a quotation mark"')]
---
'string value'
'true'
@@ -18,6 +18,19 @@
['alice', 'bob']
['foo', 'bar', 'baz', 'alice', 'bob']
['foo', 'bar', 'baz', 'alice', 'bob']
+['abc', 'd"ef"g', 'hij def']
+['hello world', 'how are you?']
+['Do"Not"Separate']
+['Do', 'Separate']
+['Do"NotSeparate']
+['string', 'with extraneous', 'quotation', 'mark"']
+['x', 'y']
+['x', 'y']
+['', ' key = ', 'x"', 'y', '', '"']
+[]
+['"', 'just', 'with', 'starting', 'quotation']
+['longer quotation', 'with', '"no', 'ending', 'quotation']
+['this', 'is', '"', 'not a quotation mark']
[]
[]
['foo']