- |
+ |
{topics % helpentry}
{if(earlycommands, '
diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -137,13 +137,6 @@ comparisonline = '
{rightlinenumber} {rightline|escape} |
'
-changelogparent = '
-
- parent {rev}: |
-
- {node|short}
- |
-
'
changesetlink = '{node|short}'
changesetbranch = 'branch | {name|escape} |
'
changesetparent = '
@@ -182,11 +175,6 @@ fileannotateparent = '
'
-changelogchild = '
-
- child {rev}: |
- {node|short} |
-
'
changesetchild = '
child {rev} |
@@ -258,11 +246,6 @@ filecompparent = '
'
-filelogparent = '
-
- parent {rev}: |
- {node|short} |
-
'
filediffchild = '
child {rev} |
@@ -277,11 +260,6 @@ filecompchild = '
{node|short}
'
-filelogchild = '
-
- child {rev}: |
- {node|short} |
-
'
shortlog = shortlog.tmpl
graph = graph.tmpl
tagtag = '{name|escape} '
diff --git a/mercurial/templates/gitweb/summary.tmpl b/mercurial/templates/gitweb/summary.tmpl
--- a/mercurial/templates/gitweb/summary.tmpl
+++ b/mercurial/templates/gitweb/summary.tmpl
@@ -60,7 +60,7 @@ summary |
{branches%branchentry}
- ... |
+ ... |
{footer}
diff --git a/mercurial/templates/monoblue/helptopics.tmpl b/mercurial/templates/monoblue/helptopics.tmpl
--- a/mercurial/templates/monoblue/helptopics.tmpl
+++ b/mercurial/templates/monoblue/helptopics.tmpl
@@ -35,7 +35,7 @@
help
- |
+ |
{topics % helpentry}
{if(earlycommands, '
diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -136,13 +136,6 @@ comparisonline = '
'
changesetlink = '{node|short}'
-changelogparent = '
-
- parent {rev}: |
-
- {changesetlink}
- |
-
'
changesetbranch = 'branch{name|escape}'
changesetparent = '
parent {rev}
@@ -168,9 +161,6 @@ fileannotateparent = '
{rename%filerename}{node|short}
'
-changelogchild = '
- child {rev}:
- {node|short}'
changesetchild = '
child {rev}
{node|short}'
@@ -224,22 +214,12 @@ filediffparent = '
filecompparent = '
parent {rev}
{node|short}'
-filelogparent = '
-
- parent {rev}: |
- {node|short} |
-
'
filediffchild = '
child {rev}
{node|short}'
filecompchild = '
child {rev}
{node|short}'
-filelogchild = '
-
- child {rev}: |
- {node|short} |
-
'
shortlog = shortlog.tmpl
tagtag = '{name|escape} '
branchtag = '{name|escape} '
diff --git a/mercurial/templates/monoblue/summary.tmpl b/mercurial/templates/monoblue/summary.tmpl
--- a/mercurial/templates/monoblue/summary.tmpl
+++ b/mercurial/templates/monoblue/summary.tmpl
@@ -71,7 +71,7 @@
{branches%branchentry}
- ... |
+ ... |
{footer}
diff --git a/mercurial/templates/paper/helptopics.tmpl b/mercurial/templates/paper/helptopics.tmpl
--- a/mercurial/templates/paper/helptopics.tmpl
+++ b/mercurial/templates/paper/helptopics.tmpl
@@ -32,7 +32,7 @@
{searchhint}
- |
+ |
{topics % helpentry}
{if(earlycommands, '
diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
--- a/mercurial/templates/paper/map
+++ b/mercurial/templates/paper/map
@@ -118,12 +118,6 @@ comparisonline = '
{rightlinenumber} {rightline|escape} |
'
-changelogparent = '
-
- parent {rev}: |
- {node|short} |
-
'
-
changesetparent = '{node|short} '
changesetparentdiff = '
@@ -153,15 +147,6 @@ fileannotateparent = '
'
changesetchild = ' {node|short}'
-changelogchild = '
-
- child |
-
-
- {node|short}
-
- |
-
'
fileannotatechild = '
child: |
@@ -224,22 +209,12 @@ filediffparent = '
parent {rev}: |
{node|short} |
'
-filelogparent = '
-
- parent {rev}: |
- {node|short} |
-
'
filediffchild = '
child {rev}: |
{node|short}
|
'
-filelogchild = '
-
- child {rev}: |
- {node|short} |
-
'
indexentry = '
diff --git a/mercurial/templates/spartan/map b/mercurial/templates/spartan/map
--- a/mercurial/templates/spartan/map
+++ b/mercurial/templates/spartan/map
@@ -170,21 +170,11 @@ filediffparent = '
parent {rev}: |
{node|short} |
'
-filelogparent = '
-
- parent {rev}: |
- {node|short} |
-
'
filediffchild = '
child {rev}: |
{node|short} |
'
-filelogchild = '
-
- child {rev}: |
- {node|short} |
-
'
indexentry = '
{name|escape} |
diff --git a/mercurial/templates/static/style-gitweb.css b/mercurial/templates/static/style-gitweb.css
--- a/mercurial/templates/static/style-gitweb.css
+++ b/mercurial/templates/static/style-gitweb.css
@@ -55,6 +55,9 @@ div.index_include { border:solid #d9d8d1
div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
tr.thisrev a { color:#999999; text-decoration: none; }
tr.thisrev pre { color:#009900; }
+td.annotate {
+ white-space: nowrap;
+}
div.annotate-info {
display: none;
position: absolute;
diff --git a/mercurial/templates/static/style-monoblue.css b/mercurial/templates/static/style-monoblue.css
--- a/mercurial/templates/static/style-monoblue.css
+++ b/mercurial/templates/static/style-monoblue.css
@@ -335,6 +335,9 @@ td.linenr {
}
tr.thisrev a { color:#999999; text-decoration: none; }
tr.thisrev td.source { color:#009900; }
+td.annotate {
+ white-space: nowrap;
+}
div.annotate-info {
display: none;
position: absolute;
diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -210,6 +210,9 @@ h3 {
.bigtable td.source { font-size: inherit; }
tr.thisrev a { color:#999999; text-decoration: none; }
tr.thisrev td.source { color:#009900; }
+td.annotate {
+ white-space: nowrap;
+}
div.annotate-info {
display: none;
position: absolute;
diff --git a/mercurial/templates/static/style.css b/mercurial/templates/static/style.css
--- a/mercurial/templates/static/style.css
+++ b/mercurial/templates/static/style.css
@@ -12,6 +12,9 @@ a { text-decoration:none; }
.annotate { font-size: smaller; text-align: right; padding-right: 1em; }
tr.thisrev a { color:#999999; text-decoration: none; }
tr.thisrev pre { color:#009900; }
+td.annotate {
+ white-space: nowrap;
+}
div.annotate-info {
display: none;
position: absolute;
diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -48,7 +48,7 @@ def _playback(journal, report, opener, v
for f, o, _ignore in entries:
if o or not unlink:
try:
- fp = opener(f, 'a')
+ fp = opener(f, 'a', checkambig=True)
fp.truncate(o)
fp.close()
except IOError:
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -33,7 +33,7 @@ urlreq = util.urlreq
samplehgrcs = {
'user':
-"""# example user config (see "hg help config" for more info)
+"""# example user config (see 'hg help config' for more info)
[ui]
# name and email, e.g.
# username = Jane Doe
@@ -41,18 +41,18 @@ username =
[extensions]
# uncomment these lines to enable some popular extensions
-# (see "hg help extensions" for more info)
+# (see 'hg help extensions' for more info)
#
# pager =
# color =""",
'cloned':
-"""# example repository config (see "hg help config" for more info)
+"""# example repository config (see 'hg help config' for more info)
[paths]
default = %s
# path aliases to other clones of this repo in URLs or filesystem paths
-# (see "hg help config.paths" for more info)
+# (see 'hg help config.paths' for more info)
#
# default-push = ssh://jdoe@example.net/hg/jdoes-fork
# my-fork = ssh://jdoe@example.net/hg/jdoes-fork
@@ -64,10 +64,10 @@ default = %s
""",
'local':
-"""# example repository config (see "hg help config" for more info)
+"""# example repository config (see 'hg help config' for more info)
[paths]
# path aliases to other clones of this repo in URLs or filesystem paths
-# (see "hg help config.paths" for more info)
+# (see 'hg help config.paths' for more info)
#
# default = http://example.com/hg/example-repo
# default-push = ssh://jdoe@example.net/hg/jdoes-fork
@@ -80,11 +80,11 @@ default = %s
""",
'global':
-"""# example system-wide hg config (see "hg help config" for more info)
+"""# example system-wide hg config (see 'hg help config' for more info)
[extensions]
# uncomment these lines to enable some popular extensions
-# (see "hg help extensions" for more info)
+# (see 'hg help extensions' for more info)
#
# blackbox =
# color =
@@ -1175,6 +1175,7 @@ class ui(object):
% ((msg,) + calframe[stacklevel][1:4]))
self.log('develwarn', '%s at: %s:%s (%s)\n',
msg, *calframe[stacklevel][1:4])
+ curframe = calframe = None # avoid cycles
def deprecwarn(self, msg, version):
"""issue a deprecation warning
diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -151,35 +151,6 @@ def _gen_sendfile(orgsend):
return _sendfile
has_https = util.safehasattr(urlreq, 'httpshandler')
-if has_https:
- try:
- _create_connection = socket.create_connection
- except AttributeError:
- _GLOBAL_DEFAULT_TIMEOUT = object()
-
- def _create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
- source_address=None):
- # lifted from Python 2.6
-
- msg = "getaddrinfo returns an empty list"
- host, port = address
- for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
- af, socktype, proto, canonname, sa = res
- sock = None
- try:
- sock = socket.socket(af, socktype, proto)
- if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
- sock.settimeout(timeout)
- if source_address:
- sock.bind(source_address)
- sock.connect(sa)
- return sock
-
- except socket.error as msg:
- if sock is not None:
- sock.close()
-
- raise socket.error(msg)
class httpconnection(keepalive.HTTPConnection):
# must be able to send big bundle as stream.
@@ -237,18 +208,14 @@ def _generic_proxytunnel(self):
version, status, reason = res._read_status()
if status != httplib.CONTINUE:
break
- while True:
- skip = res.fp.readline().strip()
- if not skip:
- break
+ # skip lines that are all whitespace
+ list(iter(lambda: res.fp.readline().strip(), ''))
res.status = status
res.reason = reason.strip()
if res.status == 200:
- while True:
- line = res.fp.readline()
- if line == '\r\n':
- break
+ # skip lines until we find a blank line
+ list(iter(res.fp.readline, '\r\n'))
return True
if version == 'HTTP/1.0':
@@ -337,7 +304,7 @@ if has_https:
self.cert_file = cert_file
def connect(self):
- self.sock = _create_connection((self.host, self.port))
+ self.sock = socket.create_connection((self.host, self.port))
host = self.host
if self.realhostport: # use CONNECT proxy
diff --git a/mercurial/util.h b/mercurial/util.h
--- a/mercurial/util.h
+++ b/mercurial/util.h
@@ -11,53 +11,8 @@
#include "compat.h"
#if PY_MAJOR_VERSION >= 3
-
#define IS_PY3K
-#define PyInt_FromLong PyLong_FromLong
-#define PyInt_AsLong PyLong_AsLong
-
-/*
- Mapping of some of the python < 2.x PyString* functions to py3k's PyUnicode.
-
- The commented names below represent those that are present in the PyBytes
- definitions for python < 2.6 (below in this file) that don't have a direct
- implementation.
-*/
-
-#define PyStringObject PyUnicodeObject
-#define PyString_Type PyUnicode_Type
-
-#define PyString_Check PyUnicode_Check
-#define PyString_CheckExact PyUnicode_CheckExact
-#define PyString_CHECK_INTERNED PyUnicode_CHECK_INTERNED
-#define PyString_AS_STRING PyUnicode_AsLatin1String
-#define PyString_GET_SIZE PyUnicode_GET_SIZE
-
-#define PyString_FromStringAndSize PyUnicode_FromStringAndSize
-#define PyString_FromString PyUnicode_FromString
-#define PyString_FromFormatV PyUnicode_FromFormatV
-#define PyString_FromFormat PyUnicode_FromFormat
-/* #define PyString_Size PyUnicode_GET_SIZE */
-/* #define PyString_AsString */
-/* #define PyString_Repr */
-#define PyString_Concat PyUnicode_Concat
-#define PyString_ConcatAndDel PyUnicode_AppendAndDel
-#define _PyString_Resize PyUnicode_Resize
-/* #define _PyString_Eq */
-#define PyString_Format PyUnicode_Format
-/* #define _PyString_FormatLong */
-/* #define PyString_DecodeEscape */
-#define _PyString_Join PyUnicode_Join
-#define PyString_Decode PyUnicode_Decode
-#define PyString_Encode PyUnicode_Encode
-#define PyString_AsEncodedObject PyUnicode_AsEncodedObject
-#define PyString_AsEncodedString PyUnicode_AsEncodedString
-#define PyString_AsDecodedObject PyUnicode_AsDecodedObject
-#define PyString_AsDecodedString PyUnicode_AsDecodedUnicode
-/* #define PyString_AsStringAndSize */
-#define _PyString_InsertThousandsGrouping _PyUnicode_InsertThousandsGrouping
-
-#endif /* PY_MAJOR_VERSION */
+#endif
typedef struct {
PyObject_HEAD
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -28,6 +28,7 @@ import re as remod
import shutil
import signal
import socket
+import string
import subprocess
import sys
import tempfile
@@ -59,7 +60,8 @@ for attr in (
'socketserver',
'xmlrpclib',
):
- globals()[attr] = getattr(pycompat, attr)
+ a = pycompat.sysstr(attr)
+ globals()[a] = getattr(pycompat, a)
# This line is to make pyflakes happy:
urlreq = pycompat.urlreq
@@ -232,7 +234,7 @@ class digestchecker(object):
try:
buffer = buffer
except NameError:
- if sys.version_info[0] < 3:
+ if not pycompat.ispy3:
def buffer(sliceable, offset=0):
return sliceable[offset:]
else:
@@ -561,7 +563,7 @@ class _lrucachenode(object):
Holds a reference to nodes on either side as well as a key-value
pair for the dictionary entry.
"""
- __slots__ = ('next', 'prev', 'key', 'value')
+ __slots__ = (u'next', u'prev', u'key', u'value')
def __init__(self):
self.next = None
@@ -651,7 +653,7 @@ class lrucachedict(object):
def get(self, k, default=None):
try:
- return self._cache[k]
+ return self._cache[k].value
except KeyError:
return default
@@ -881,6 +883,8 @@ def nogc(func):
This garbage collector issue have been fixed in 2.7.
"""
+ if sys.version_info >= (2, 7):
+ return func
def wrapper(*args, **kwargs):
gcenabled = gc.isenabled()
gc.disable()
@@ -925,7 +929,7 @@ def mainfrozen():
"""
return (safehasattr(sys, "frozen") or # new py2exe
safehasattr(sys, "importers") or # old py2exe
- imp.is_frozen("__main__")) # tools/freeze
+ imp.is_frozen(u"__main__")) # tools/freeze
# the location of data files matching the source code
if mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app':
@@ -1012,10 +1016,7 @@ def system(cmd, environ=None, cwd=None,
proc = subprocess.Popen(cmd, shell=True, close_fds=closefds,
env=env, cwd=cwd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
- while True:
- line = proc.stdout.readline()
- if not line:
- break
+ for line in iter(proc.stdout.readline, ''):
out.write(line)
proc.wait()
rc = proc.returncode
@@ -1214,7 +1215,7 @@ def fstat(fp):
# File system features
-def checkcase(path):
+def fscasesensitive(path):
"""
Return true if the given path is on a case-sensitive filesystem
@@ -1342,6 +1343,10 @@ def checknlink(testfile):
try:
posixfile(f1, 'w').close()
except IOError:
+ try:
+ os.unlink(f1)
+ except OSError:
+ pass
return False
f2 = testfile + ".hgtmp2"
@@ -1679,9 +1684,9 @@ class chunkbuffer(object):
return ''.join(buf)
-def filechunkiter(f, size=65536, limit=None):
+def filechunkiter(f, size=131072, limit=None):
"""Create a generator that produces the data in the file size
- (default 65536) bytes at a time, up to optional limit (default is
+ (default 131072) bytes at a time, up to optional limit (default is
to read all data). Chunks may be less than size bytes if the
chunk is the last chunk in the file, or the file is a socket or
some other type of file that sometimes reads less data than is
@@ -1950,7 +1955,7 @@ def matchdate(date):
except ValueError:
raise Abort(_("invalid day spec: %s") % date[1:])
if days < 0:
- raise Abort(_('%s must be nonnegative (see "hg help dates")')
+ raise Abort(_("%s must be nonnegative (see 'hg help dates')")
% date[1:])
when = makedate()[0] - days * 3600 * 24
return lambda x: x >= when
@@ -2294,29 +2299,8 @@ def parsebool(s):
"""
return _booleans.get(s.lower(), None)
-_hexdig = '0123456789ABCDEFabcdef'
_hextochr = dict((a + b, chr(int(a + b, 16)))
- for a in _hexdig for b in _hexdig)
-
-def _urlunquote(s):
- """Decode HTTP/HTML % encoding.
-
- >>> _urlunquote('abc%20def')
- 'abc def'
- """
- res = s.split('%')
- # fastpath
- if len(res) == 1:
- return s
- s = res[0]
- for item in res[1:]:
- try:
- s += _hextochr[item[:2]] + item[2:]
- except KeyError:
- s += '%' + item
- except UnicodeDecodeError:
- s += unichr(int(item[:2], 16)) + item[2:]
- return s
+ for a in string.hexdigits for b in string.hexdigits)
class url(object):
r"""Reliable URL parser.
@@ -2374,6 +2358,22 @@ class url(object):
>>> url('http://host/a?b#c', parsequery=False, parsefragment=False)
+
+ Empty path:
+
+ >>> url('')
+
+ >>> url('#a')
+
+ >>> url('http://host/')
+
+ >>> url('http://host/#a')
+
+
+ Only scheme:
+
+ >>> url('http:')
+
"""
_safechars = "!~*'()+"
@@ -2390,8 +2390,6 @@ class url(object):
if parsefragment and '#' in path:
path, self.fragment = path.split('#', 1)
- if not path:
- path = None
# special case for Windows drive letters and UNC paths
if hasdriveletter(path) or path.startswith(r'\\'):
@@ -2472,7 +2470,7 @@ class url(object):
'path', 'fragment'):
v = getattr(self, a)
if v is not None:
- setattr(self, a, _urlunquote(v))
+ setattr(self, a, pycompat.urlparse.unquote(v))
def __repr__(self):
attrs = []
diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -7,7 +7,6 @@
from __future__ import absolute_import
-import _winreg
import errno
import msvcrt
import os
@@ -22,6 +21,12 @@ from . import (
win32,
)
+try:
+ import _winreg as winreg
+ winreg.CloseKey
+except ImportError:
+ import winreg
+
executablepath = win32.executablepath
getuser = win32.getuser
hidewindow = win32.hidewindow
@@ -432,12 +437,12 @@ def lookupreg(key, valname=None, scope=N
LOCAL_MACHINE).
'''
if scope is None:
- scope = (_winreg.HKEY_CURRENT_USER, _winreg.HKEY_LOCAL_MACHINE)
+ scope = (winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE)
elif not isinstance(scope, (list, tuple)):
scope = (scope,)
for s in scope:
try:
- val = _winreg.QueryValueEx(_winreg.OpenKey(s, key), valname)[0]
+ val = winreg.QueryValueEx(winreg.OpenKey(s, key), valname)[0]
# never let a Unicode string escape into the wild
return encoding.tolocal(val.encode('UTF-8'))
except EnvironmentError:
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -78,10 +78,19 @@ class abstractserverproto(object):
# """
# raise NotImplementedError()
- def groupchunks(self, cg):
- """return 4096 chunks from a changegroup object
+ def groupchunks(self, fh):
+ """Generator of chunks to send to the client.
+
+ Some protocols may have compressed the contents.
+ """
+ raise NotImplementedError()
- Some protocols may have compressed the contents."""
+ def compresschunks(self, chunks):
+ """Generator of possible compressed chunks to send to the client.
+
+ This is like ``groupchunks()`` except it accepts a generator as
+ its argument.
+ """
raise NotImplementedError()
class remotebatch(peer.batcher):
@@ -187,6 +196,21 @@ def unescapearg(escaped):
.replace(':o', ',')
.replace(':c', ':'))
+def encodebatchcmds(req):
+ """Return a ``cmds`` argument value for the ``batch`` command."""
+ cmds = []
+ for op, argsdict in req:
+ # Old servers didn't properly unescape argument names. So prevent
+ # the sending of argument names that may not be decoded properly by
+ # servers.
+ assert all(escapearg(k) == k for k in argsdict)
+
+ args = ','.join('%s=%s' % (escapearg(k), escapearg(v))
+ for k, v in argsdict.iteritems())
+ cmds.append('%s %s' % (op, args))
+
+ return ';'.join(cmds)
+
# mapping of options accepted by getbundle and their types
#
# Meant to be extended by extensions. It is extensions responsibility to ensure
@@ -226,12 +250,7 @@ class wirepeer(peer.peerrepository):
Returns an iterator of the raw responses from the server.
"""
- cmds = []
- for op, argsdict in req:
- args = ','.join('%s=%s' % (escapearg(k), escapearg(v))
- for k, v in argsdict.iteritems())
- cmds.append('%s %s' % (op, args))
- rsp = self._callstream("batch", cmds=';'.join(cmds))
+ rsp = self._callstream("batch", cmds=encodebatchcmds(req))
chunk = rsp.read(1024)
work = [chunk]
while chunk:
@@ -399,7 +418,7 @@ class wirepeer(peer.peerrepository):
else:
return changegroupmod.cg1unpacker(f, 'UN')
- def unbundle(self, cg, heads, source):
+ def unbundle(self, cg, heads, url):
'''Send cg (a readable file-like object representing the
changegroup to push, typically a chunkbuffer object) to the
remote server as a bundle.
@@ -407,7 +426,11 @@ class wirepeer(peer.peerrepository):
When pushing a bundle10 stream, return an integer indicating the
result of the push (see localrepository.addchangegroup()).
- When pushing a bundle20 stream, return a bundle20 stream.'''
+ When pushing a bundle20 stream, return a bundle20 stream.
+
+ `url` is the url the client thinks it's pushing to, which is
+ visible to hooks.
+ '''
if heads != ['force'] and self.capable('unbundlehash'):
heads = encodelist(['hashed',
@@ -611,7 +634,7 @@ def batch(repo, proto, cmds, others):
for a in args.split(','):
if a:
n, v = a.split('=')
- vals[n] = unescapearg(v)
+ vals[unescapearg(n)] = unescapearg(v)
func, spec = commands[op]
if spec:
keys = spec.split()
@@ -731,12 +754,6 @@ def debugwireargs(repo, proto, one, two,
opts = options('debugwireargs', ['three', 'four'], others)
return repo.debugwireargs(one, two, **opts)
-# List of options accepted by getbundle.
-#
-# Meant to be extended by extensions. It is the extension's responsibility to
-# ensure such options are properly processed in exchange.getbundle.
-gboptslist = ['heads', 'common', 'bundlecaps']
-
@wireprotocommand('getbundle', '*')
def getbundle(repo, proto, others):
opts = options('getbundle', gboptsmap.keys(), others)
@@ -763,8 +780,8 @@ def getbundle(repo, proto, others):
if not exchange.bundle2requested(opts.get('bundlecaps')):
return ooberror(bundle2required)
- cg = exchange.getbundle(repo, 'serve', **opts)
- return streamres(proto.groupchunks(cg))
+ chunks = exchange.getbundlechunks(repo, 'serve', **opts)
+ return streamres(proto.compresschunks(chunks))
@wireprotocommand('heads')
def heads(repo, proto):
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -318,7 +318,10 @@ class hgbuildpy(build_py):
if self.distribution.pure:
self.distribution.ext_modules = []
elif self.distribution.cffi:
- exts = []
+ import setup_mpatch_cffi
+ import setup_bdiff_cffi
+ exts = [setup_mpatch_cffi.ffi.distutils_extension(),
+ setup_bdiff_cffi.ffi.distutils_extension()]
# cffi modules go here
if sys.platform == 'darwin':
import setup_osutil_cffi
@@ -561,7 +564,8 @@ extmodules = [
depends=common_depends + ['mercurial/bdiff.h']),
Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c'],
depends=common_depends),
- Extension('mercurial.mpatch', ['mercurial/mpatch.c'],
+ Extension('mercurial.mpatch', ['mercurial/mpatch.c',
+ 'mercurial/mpatch_module.c'],
depends=common_depends),
Extension('mercurial.parsers', ['mercurial/dirs.c',
'mercurial/manifest.c',
diff --git a/setup_bdiff_cffi.py b/setup_bdiff_cffi.py
new file mode 100644
--- /dev/null
+++ b/setup_bdiff_cffi.py
@@ -0,0 +1,31 @@
+from __future__ import absolute_import
+
+import cffi
+import os
+
+ffi = cffi.FFI()
+ffi.set_source("_bdiff_cffi",
+ open(os.path.join(os.path.join(os.path.dirname(__file__), 'mercurial'),
+ 'bdiff.c')).read(), include_dirs=['mercurial'])
+ffi.cdef("""
+struct bdiff_line {
+ int hash, n, e;
+ ssize_t len;
+ const char *l;
+};
+
+struct bdiff_hunk;
+struct bdiff_hunk {
+ int a1, a2, b1, b2;
+ struct bdiff_hunk *next;
+};
+
+int bdiff_splitlines(const char *a, ssize_t len, struct bdiff_line **lr);
+int bdiff_diff(struct bdiff_line *a, int an, struct bdiff_line *b, int bn,
+ struct bdiff_hunk *base);
+void bdiff_freehunks(struct bdiff_hunk *l);
+void free(void*);
+""")
+
+if __name__ == '__main__':
+ ffi.compile()
diff --git a/setup_mpatch_cffi.py b/setup_mpatch_cffi.py
new file mode 100644
--- /dev/null
+++ b/setup_mpatch_cffi.py
@@ -0,0 +1,35 @@
+from __future__ import absolute_import
+
+import cffi
+import os
+
+ffi = cffi.FFI()
+mpatch_c = os.path.join(os.path.join(os.path.dirname(__file__), 'mercurial',
+ 'mpatch.c'))
+ffi.set_source("_mpatch_cffi", open(mpatch_c).read(),
+ include_dirs=["mercurial"])
+ffi.cdef("""
+
+struct mpatch_frag {
+ int start, end, len;
+ const char *data;
+};
+
+struct mpatch_flist {
+ struct mpatch_frag *base, *head, *tail;
+};
+
+extern "Python" struct mpatch_flist* cffi_get_next_item(void*, ssize_t);
+
+int mpatch_decode(const char *bin, ssize_t len, struct mpatch_flist** res);
+ssize_t mpatch_calcsize(size_t len, struct mpatch_flist *l);
+void mpatch_lfree(struct mpatch_flist *a);
+static int mpatch_apply(char *buf, const char *orig, size_t len,
+ struct mpatch_flist *l);
+struct mpatch_flist *mpatch_fold(void *bins,
+ struct mpatch_flist* (*get_next_item)(void*, ssize_t),
+ ssize_t start, ssize_t end);
+""")
+
+if __name__ == '__main__':
+ ffi.compile()
diff --git a/setup_osutil_cffi.py b/setup_osutil_cffi.py
--- a/setup_osutil_cffi.py
+++ b/setup_osutil_cffi.py
@@ -45,6 +45,8 @@ typedef struct attrreference {
...;
} attrreference_t;
+typedef int ... off_t;
+
typedef struct val_attrs {
uint32_t length;
attribute_set_t returned;
@@ -52,14 +54,13 @@ typedef struct val_attrs {
uint32_t obj_type;
struct timespec mtime;
uint32_t accessmask;
- int datalength;
+ off_t datalength;
...;
} val_attrs_t;
/* the exact layout of the above struct will be figured out during build time */
typedef int ... time_t;
-typedef int ... off_t;
typedef struct timespec {
time_t tv_sec;
diff --git a/tests/check-perf-code.py b/tests/check-perf-code.py
--- a/tests/check-perf-code.py
+++ b/tests/check-perf-code.py
@@ -10,6 +10,12 @@ import sys
# write static check patterns here
perfpypats = [
[
+ (r'(branchmap|repoview)\.subsettable',
+ "use getbranchmapsubsettable() for early Mercurial"),
+ (r'\.(vfs|svfs|opener|sopener)',
+ "use getvfs()/getsvfs() for early Mercurial"),
+ (r'ui\.configint',
+ "use getint() instead of ui.configint() for early Mercurial"),
],
# warnings
[
diff --git a/tests/failfilemerge.py b/tests/failfilemerge.py
--- a/tests/failfilemerge.py
+++ b/tests/failfilemerge.py
@@ -9,7 +9,7 @@ from mercurial import (
)
def failfilemerge(filemergefn,
- premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
+ premerge, repo, mynode, orig, fcd, fco, fca, labels=None):
raise error.Abort("^C")
return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels)
diff --git a/tests/fakemergerecord.py b/tests/fakemergerecord.py
--- a/tests/fakemergerecord.py
+++ b/tests/fakemergerecord.py
@@ -16,10 +16,11 @@ command = cmdutil.command(cmdtable)
[('X', 'mandatory', None, 'add a fake mandatory record'),
('x', 'advisory', None, 'add a fake advisory record')], '')
def fakemergerecord(ui, repo, *pats, **opts):
- ms = merge.mergestate.read(repo)
- records = ms._makerecords()
- if opts.get('mandatory'):
- records.append(('X', 'mandatory record'))
- if opts.get('advisory'):
- records.append(('x', 'advisory record'))
- ms._writerecords(records)
+ with repo.wlock():
+ ms = merge.mergestate.read(repo)
+ records = ms._makerecords()
+ if opts.get('mandatory'):
+ records.append(('X', 'mandatory record'))
+ if opts.get('advisory'):
+ records.append(('x', 'advisory record'))
+ ms._writerecords(records)
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -110,8 +110,13 @@ def has_baz():
def has_bzr():
try:
import bzrlib
+ import bzrlib.bzrdir
+ import bzrlib.errors
+ import bzrlib.revision
+ import bzrlib.revisionspec
+ bzrlib.revisionspec.RevisionSpec
return bzrlib.__doc__ is not None
- except ImportError:
+ except (AttributeError, ImportError):
return False
@checkvers("bzr", "Canonical's Bazaar client >= %s", (1.14,))
@@ -349,6 +354,14 @@ def has_tla():
def has_gpg():
return matchoutput('gpg --version 2>&1', br'GnuPG')
+@check("gpg2", "gpg client v2")
+def has_gpg2():
+ return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.')
+
+@check("gpg21", "gpg client v2.1+")
+def has_gpg21():
+ return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.(?!0)')
+
@check("unix-permissions", "unix-style permissions")
def has_unix_permissions():
d = tempfile.mkdtemp(dir='.', prefix=tempprefix)
@@ -522,6 +535,10 @@ def has_debhelper():
br'other supported Python versions')
return dpkg and dh and dh_py2
+@check("demandimport", "demandimport enabled")
+def has_demandimport():
+ return os.environ.get('HGDEMANDIMPORT') != 'disable'
+
@check("absimport", "absolute_import in __future__")
def has_absimport():
import __future__
@@ -540,6 +557,16 @@ def has_py3k():
def has_python3exe():
return 'PYTHON3' in os.environ
+@check("py3pygments", "Pygments available on Python 3.x")
+def has_py3pygments():
+ if has_py3k():
+ return has_pygments()
+ elif has_python3exe():
+ # just check exit status (ignoring output)
+ py3 = os.environ['PYTHON3']
+ return matchoutput('%s -c "import pygments"' % py3, br'')
+ return False
+
@check("pure", "running with pure Python code")
def has_pure():
return any([
@@ -559,3 +586,7 @@ def has_hypothesis():
return True
except ImportError:
return False
+
+@check("unziplinks", "unzip(1) understands and extracts symlinks")
+def unzip_understands_symlinks():
+ return matchoutput('unzip --help', br'Info-ZIP')
diff --git a/tests/killdaemons.py b/tests/killdaemons.py
--- a/tests/killdaemons.py
+++ b/tests/killdaemons.py
@@ -82,7 +82,11 @@ def killdaemons(pidfile, tryhard=True, r
for line in fp:
try:
pid = int(line)
+ if pid <= 0:
+ raise ValueError
except ValueError:
+ logfn('# Not killing daemon process %s - invalid pid'
+ % line.rstrip())
continue
kill(pid, logfn, tryhard)
fp.close()
diff --git a/tests/lockdelay.py b/tests/lockdelay.py
--- a/tests/lockdelay.py
+++ b/tests/lockdelay.py
@@ -7,20 +7,16 @@ from __future__ import absolute_import
import os
import time
-from mercurial import (
- lock as lockmod,
-)
+def reposetup(ui, repo):
-class delaylock(lockmod.lock):
- def lock(self):
- delay = float(os.environ.get('HGPRELOCKDELAY', '0.0'))
- if delay:
- time.sleep(delay)
- res = super(delaylock, self).lock()
- delay = float(os.environ.get('HGPOSTLOCKDELAY', '0.0'))
- if delay:
- time.sleep(delay)
- return res
-
-def extsetup(ui):
- lockmod.lock = delaylock
+ class delayedlockrepo(repo.__class__):
+ def lock(self):
+ delay = float(os.environ.get('HGPRELOCKDELAY', '0.0'))
+ if delay:
+ time.sleep(delay)
+ res = super(delayedlockrepo, self).lock()
+ delay = float(os.environ.get('HGPOSTLOCKDELAY', '0.0'))
+ if delay:
+ time.sleep(delay)
+ return res
+ repo.__class__ = delayedlockrepo
diff --git a/tests/md5sum.py b/tests/md5sum.py
--- a/tests/md5sum.py
+++ b/tests/md5sum.py
@@ -34,10 +34,7 @@ for filename in sys.argv[1:]:
m = md5()
try:
- while True:
- data = fp.read(8192)
- if not data:
- break
+ for data in iter(lambda: fp.read(8192), ''):
m.update(data)
except IOError as msg:
sys.stderr.write('%s: I/O error: %s\n' % (filename, msg))
diff --git a/tests/test-acl.t b/tests/test-acl.t
--- a/tests/test-acl.t
+++ b/tests/test-acl.t
@@ -44,13 +44,6 @@
> EOF
> }
- $ cat << EOF >> $HGRCPATH
- > [experimental]
- > # drop me once bundle2 is the default,
- > # added to get test change early.
- > bundle2-exp = True
- > EOF
-
$ hg init a
$ cd a
$ mkdir foo foo/Bar quux
@@ -119,11 +112,11 @@ Extension disabled for lack of a hook
adding foo/file.txt revisions
adding quux/file.py revisions
added 3 changesets with 3 changes to 3 files
- bundle2-input-part: total payload size 1606
+ updating the branch cache
+ bundle2-input-part: total payload size 1553
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 2 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -184,11 +177,11 @@ Extension disabled for lack of acl.sourc
added 3 changesets with 3 changes to 3 files
calling hook pretxnchangegroup.acl: hgext.acl.hook
acl: changes have source "push" - skipping
- bundle2-input-part: total payload size 1606
+ updating the branch cache
+ bundle2-input-part: total payload size 1553
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 2 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -260,11 +253,11 @@ No [acl.allow]/[acl.deny]
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
- bundle2-input-part: total payload size 1606
+ updating the branch cache
+ bundle2-input-part: total payload size 1553
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 2 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -332,7 +325,7 @@ Empty [acl.allow]
acl: acl.deny not enabled
acl: branch access granted: "ef1ea85a6374" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -401,7 +394,7 @@ fred is allowed inside foo/
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -467,7 +460,7 @@ Empty [acl.deny]
acl: acl.deny enabled, 0 entries for user barney
acl: branch access granted: "ef1ea85a6374" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -538,7 +531,7 @@ fred is allowed inside foo/, but not foo
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -608,7 +601,7 @@ fred is allowed inside foo/, but not foo
acl: path access granted: "ef1ea85a6374"
acl: branch access granted: "f9cafe1212c8" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -675,7 +668,7 @@ fred is allowed inside foo/, but not foo
acl: acl.deny enabled, 0 entries for user barney
acl: branch access granted: "ef1ea85a6374" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -750,11 +743,11 @@ barney is allowed everywhere
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
- bundle2-input-part: total payload size 1606
+ updating the branch cache
+ bundle2-input-part: total payload size 1553
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 2 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -833,7 +826,7 @@ wilma can change files with a .txt exten
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -902,7 +895,7 @@ file specified by acl.config does not ex
calling hook pretxnchangegroup.acl: hgext.acl.hook
acl: checking access for user "barney"
error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config'
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -984,7 +977,7 @@ betty is allowed inside foo/ by a acl.co
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -1068,11 +1061,11 @@ acl.config can set only [acl.allow]/[acl
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
- bundle2-input-part: total payload size 1606
+ updating the branch cache
+ bundle2-input-part: total payload size 1553
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 2 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -1154,11 +1147,11 @@ fred is always allowed
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
- bundle2-input-part: total payload size 1606
+ updating the branch cache
+ bundle2-input-part: total payload size 1553
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 2 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -1234,7 +1227,7 @@ no one is allowed inside foo/Bar/
acl: path access granted: "ef1ea85a6374"
acl: branch access granted: "f9cafe1212c8" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -1313,11 +1306,11 @@ OS-level groups
acl: path access granted: "f9cafe1212c8"
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
- bundle2-input-part: total payload size 1606
+ updating the branch cache
+ bundle2-input-part: total payload size 1553
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 2 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -1395,7 +1388,7 @@ OS-level groups
acl: path access granted: "ef1ea85a6374"
acl: branch access granted: "f9cafe1212c8" on branch "default"
error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
- bundle2-input-part: total payload size 1606
+ bundle2-input-part: total payload size 1553
bundle2-input-bundle: 3 parts total
transaction abort!
rollback completed
@@ -1515,13 +1508,13 @@ No branch acls specified
acl: path access granted: "911600dab2ae"
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
- bundle2-input-part: total payload size 2101
+ updating the branch cache
+ bundle2-input-part: total payload size 2068
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 3 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -1602,7 +1595,7 @@ Branch acl deny test
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
- bundle2-input-part: total payload size 2101
+ bundle2-input-part: total payload size 2068
bundle2-input-bundle: 4 parts total
transaction abort!
rollback completed
@@ -1670,7 +1663,7 @@ Branch acl empty allow test
acl: acl.allow not enabled
acl: acl.deny not enabled
error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
- bundle2-input-part: total payload size 2101
+ bundle2-input-part: total payload size 2068
bundle2-input-bundle: 4 parts total
transaction abort!
rollback completed
@@ -1740,7 +1733,7 @@ Branch acl allow other
acl: acl.allow not enabled
acl: acl.deny not enabled
error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
- bundle2-input-part: total payload size 2101
+ bundle2-input-part: total payload size 2068
bundle2-input-bundle: 4 parts total
transaction abort!
rollback completed
@@ -1811,13 +1804,13 @@ Branch acl allow other
acl: path access granted: "911600dab2ae"
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
- bundle2-input-part: total payload size 2101
+ updating the branch cache
+ bundle2-input-part: total payload size 2068
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 3 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -1904,13 +1897,13 @@ push foobar into the remote
acl: path access granted: "911600dab2ae"
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
- bundle2-input-part: total payload size 2101
+ updating the branch cache
+ bundle2-input-part: total payload size 2068
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 3 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -1989,7 +1982,7 @@ Branch acl conflicting deny
acl: acl.allow not enabled
acl: acl.deny not enabled
error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
- bundle2-input-part: total payload size 2101
+ bundle2-input-part: total payload size 2068
bundle2-input-bundle: 4 parts total
transaction abort!
rollback completed
@@ -2065,13 +2058,13 @@ User 'astro' must not be denied
acl: path access granted: "911600dab2ae"
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
- bundle2-input-part: total payload size 2101
+ updating the branch cache
+ bundle2-input-part: total payload size 2068
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
- updating the branch cache
bundle2-output-bundle: "HG20", 3 parts total
bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
@@ -2144,7 +2137,7 @@ Non-astro users must be denied
acl: acl.allow not enabled
acl: acl.deny not enabled
error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
- bundle2-input-part: total payload size 2101
+ bundle2-input-part: total payload size 2068
bundle2-input-bundle: 4 parts total
transaction abort!
rollback completed
diff --git a/tests/test-alias.t b/tests/test-alias.t
--- a/tests/test-alias.t
+++ b/tests/test-alias.t
@@ -99,7 +99,7 @@ disabled
patchbomb command to send changesets as (a series of) patch emails
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
no definition
@@ -441,7 +441,7 @@ invalid arguments
alias for: hg root
- (use "hg rt -h" to show more help)
+ (use 'hg rt -h' to show more help)
[255]
invalid global arguments for normal commands, aliases, and shell aliases
@@ -470,7 +470,7 @@ invalid global arguments for normal comm
summary summarize working directory state
update update working directory (or switch revisions)
- (use "hg help" for the full list of commands or "hg -v" for details)
+ (use 'hg help' for the full list of commands or 'hg -v' for details)
[255]
$ hg --invalid mylog
hg: option --invalid not recognized
@@ -496,7 +496,7 @@ invalid global arguments for normal comm
summary summarize working directory state
update update working directory (or switch revisions)
- (use "hg help" for the full list of commands or "hg -v" for details)
+ (use 'hg help' for the full list of commands or 'hg -v' for details)
[255]
$ hg --invalid blank
hg: option --invalid not recognized
@@ -522,7 +522,7 @@ invalid global arguments for normal comm
summary summarize working directory state
update update working directory (or switch revisions)
- (use "hg help" for the full list of commands or "hg -v" for details)
+ (use 'hg help' for the full list of commands or 'hg -v' for details)
[255]
environment variable changes in alias commands
diff --git a/tests/test-archive-symlinks.t b/tests/test-archive-symlinks.t
--- a/tests/test-archive-symlinks.t
+++ b/tests/test-archive-symlinks.t
@@ -29,6 +29,7 @@ tar
$ readlink.py dangling
dangling -> nothing
+#if unziplinks
zip
$ cd "$origdir"
@@ -36,5 +37,6 @@ zip
$ cd zip
$ readlink.py dangling
dangling -> nothing
+#endif
$ cd ..
diff --git a/tests/test-bad-extension.t b/tests/test-bad-extension.t
--- a/tests/test-bad-extension.t
+++ b/tests/test-bad-extension.t
@@ -53,7 +53,7 @@ show traceback for ImportError of hgext.
*** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
Traceback (most recent call last):
Exception: bit bucket overflow
- could not import hgext.badext2 (No module named *badext2): trying badext2 (glob)
+ could not import hgext.badext2 (No module named *badext2): trying hgext3rd.badext2 (glob)
Traceback (most recent call last):
ImportError: No module named *badext2 (glob)
could not import hgext3rd.badext2 (No module named *badext2): trying badext2 (glob)
diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t
--- a/tests/test-blackbox.t
+++ b/tests/test-blackbox.t
@@ -4,6 +4,8 @@ setup
> blackbox=
> mock=$TESTDIR/mockblackbox.py
> mq=
+ > [alias]
+ > confuse = log --limit 3
> EOF
$ hg init blackboxtest
$ cd blackboxtest
@@ -17,6 +19,18 @@ command, exit codes, and duration
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
+alias expansion is logged
+ $ hg confuse
+ $ hg blackbox
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config blackbox.dirty=True exited 0 after * seconds (glob)
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob)
+ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
+
incoming change tracking
create two heads to verify that we only see one change in the log later
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -7,9 +7,6 @@
> publish=False
> [experimental]
> evolution=createmarkers,exchange
- > # drop me once bundle2 is the default,
- > # added to get test change early.
- > bundle2-exp = True
> EOF
initialize
@@ -430,7 +427,7 @@ diverging a remote bookmark fails
pushing to http://localhost:$HGPORT2/
searching for changes
abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
- (merge or see "hg help push" for details about pushing new heads)
+ (merge or see 'hg help push' for details about pushing new heads)
[255]
$ hg -R ../a book
@ 1:0d2164f0ce0d
@@ -446,7 +443,7 @@ Unrelated marker does not alter the deci
pushing to http://localhost:$HGPORT2/
searching for changes
abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
- (merge or see "hg help push" for details about pushing new heads)
+ (merge or see 'hg help push' for details about pushing new heads)
[255]
$ hg -R ../a book
@ 1:0d2164f0ce0d
@@ -736,7 +733,7 @@ pushing an existing but divergent bookma
searching for changes
remote has heads on branch 'default' that are not known locally: a2a606d9ff1b
abort: push creates new remote head 54694f811df9 with bookmark 'X'!
- (pull and merge or see "hg help push" for details about pushing new heads)
+ (pull and merge or see 'hg help push' for details about pushing new heads)
[255]
$ cd ../addmarks
@@ -825,7 +822,7 @@ Local push
Using ssh
---------
- $ hg push -B @ ssh --config experimental.bundle2-exp=True
+ $ hg push -B @ ssh # bundle2+
pushing to ssh://user@dummy/issue4455-dest
searching for changes
no changes found
@@ -835,7 +832,7 @@ Using ssh
$ hg -R ../issue4455-dest/ bookmarks
no bookmarks set
- $ hg push -B @ ssh --config experimental.bundle2-exp=False
+ $ hg push -B @ ssh --config devel.legacy.exchange=bundle1
pushing to ssh://user@dummy/issue4455-dest
searching for changes
no changes found
@@ -848,7 +845,7 @@ Using ssh
Using http
----------
- $ hg push -B @ http --config experimental.bundle2-exp=True
+ $ hg push -B @ http # bundle2+
pushing to http://localhost:$HGPORT/
searching for changes
no changes found
@@ -858,7 +855,7 @@ Using http
$ hg -R ../issue4455-dest/ bookmarks
no bookmarks set
- $ hg push -B @ http --config experimental.bundle2-exp=False
+ $ hg push -B @ http --config devel.legacy.exchange=bundle1
pushing to http://localhost:$HGPORT/
searching for changes
no changes found
diff --git a/tests/test-branches.t b/tests/test-branches.t
--- a/tests/test-branches.t
+++ b/tests/test-branches.t
@@ -516,6 +516,8 @@ template output:
}
]
+ $ hg branches --closed -T '{if(closed, "{branch}\n")}'
+ c
Tests of revision branch name caching
@@ -554,6 +556,18 @@ no errors when revbranchcache is not wri
$ rmdir .hg/cache/rbc-revs-v1
$ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
+no errors when wlock cannot be acquired
+
+#if unix-permissions
+ $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_
+ $ rm -f .hg/cache/branch*
+ $ chmod 555 .hg
+ $ hg head a -T '{rev}\n'
+ 5
+ $ chmod 755 .hg
+ $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
+#endif
+
recovery from invalid cache revs file with trailing data
$ echo >> .hg/cache/rbc-revs-v1
$ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
diff --git a/tests/test-bundle-type.t b/tests/test-bundle-type.t
--- a/tests/test-bundle-type.t
+++ b/tests/test-bundle-type.t
@@ -123,6 +123,6 @@ test invalid bundle type
$ cd t1
$ hg bundle -a -t garbage ../bgarbage
abort: garbage is not a recognized bundle specification
- (see "hg help bundle" for supported values for --type)
+ (see 'hg help bundle' for supported values for --type)
[255]
$ cd ..
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -279,26 +279,26 @@ packed1 is produced properly
$ hg debugbundle --spec packed.hg
none-packed1;requirements%3Dgeneraldelta%2Crevlogv1
-generaldelta requirement is listed in stream clone bundles
+generaldelta requirement is not listed in stream clone bundles unless used
- $ hg --config format.generaldelta=true init testgd
- $ cd testgd
+ $ hg --config format.usegeneraldelta=false init testnongd
+ $ cd testnongd
$ touch foo
$ hg -q commit -A -m initial
$ cd ..
- $ hg -R testgd debugcreatestreamclonebundle packedgd.hg
+ $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
writing 301 bytes for 3 files
- bundle requirements: generaldelta, revlogv1
+ bundle requirements: revlogv1
- $ f -B 64 --size --sha1 --hexdump packedgd.hg
- packedgd.hg: size=396, sha1=981f9e589799335304a5a9a44caa3623a48d2a9f
+ $ f -B 64 --size --sha1 --hexdump packednongd.hg
+ packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
- 0010: 00 00 00 00 01 2d 00 16 67 65 6e 65 72 61 6c 64 |.....-..generald|
- 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da|
- 0030: 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 03 00 01 |ta/foo.i.64.....|
+ 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
+ 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
+ 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- $ hg debugbundle --spec packedgd.hg
- none-packed1;requirements%3Dgeneraldelta%2Crevlogv1
+ $ hg debugbundle --spec packednongd.hg
+ none-packed1;requirements%3Drevlogv1
Unpacking packed1 bundles with "hg unbundle" isn't allowed
@@ -310,9 +310,51 @@ Unpacking packed1 bundles with "hg unbun
packed1 can be consumed from debug command
+(this also confirms that streamclone-ed changes are visible via
+@filecache properties to in-process procedures before closing
+transaction)
+
+ $ cat > $TESTTMP/showtip.py < from __future__ import absolute_import
+ >
+ > def showtip(ui, repo, hooktype, **kwargs):
+ > ui.warn('%s: %s\n' % (hooktype, repo['tip'].hex()[:12]))
+ >
+ > def reposetup(ui, repo):
+ > # this confirms (and ensures) that (empty) 00changelog.i
+ > # before streamclone is already cached as repo.changelog
+ > ui.setconfig('hooks', 'pretxnopen.showtip', showtip)
+ >
+ > # this confirms that streamclone-ed changes are visible to
+ > # in-process procedures before closing transaction
+ > ui.setconfig('hooks', 'pretxnclose.showtip', showtip)
+ >
+ > # this confirms that streamclone-ed changes are still visible
+ > # after closing transaction
+ > ui.setconfig('hooks', 'txnclose.showtip', showtip)
+ > EOF
+ $ cat >> $HGRCPATH < [extensions]
+ > showtip = $TESTTMP/showtip.py
+ > EOF
+
$ hg -R packed debugapplystreamclonebundle packed.hg
6 files to transfer, 2.60 KB of data
+ pretxnopen: 000000000000
+ pretxnclose: aa35859c02ea
transferred 2.60 KB in *.* seconds (* */sec) (glob)
+ txnclose: aa35859c02ea
+
+(for safety, confirm visibility of streamclone-ed changes by another
+process, too)
+
+ $ hg -R packed tip -T "{node|short}\n"
+ aa35859c02ea
+
+ $ cat >> $HGRCPATH < [extensions]
+ > showtip = !
+ > EOF
Does not work on non-empty repo
diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t
--- a/tests/test-bundle2-exchange.t
+++ b/tests/test-bundle2-exchange.t
@@ -16,7 +16,6 @@ enable obsolescence
$ cat >> $HGRCPATH << EOF
> [experimental]
> evolution=createmarkers,exchange
- > bundle2-exp=True
> bundle2-output-capture=True
> [ui]
> ssh=python "$TESTDIR/dummyssh"
@@ -970,7 +969,7 @@ Servers can disable bundle1 for clone/pu
$ hg serve -p $HGPORT -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
- $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT/ not-bundle2
+ $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
requesting all changes
abort: remote error:
incompatible Mercurial client; bundle2 required
@@ -993,7 +992,7 @@ bundle1 can still pull non-generaldelta
$ hg serve -p $HGPORT -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
- $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT/ not-bundle2-1
+ $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1
requesting all changes
adding changesets
adding manifests
@@ -1014,7 +1013,7 @@ bundle1 pull can be disabled for general
$ hg serve -p $HGPORT -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
- $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT/ not-bundle2
+ $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
requesting all changes
abort: remote error:
incompatible Mercurial client; bundle2 required
@@ -1031,7 +1030,7 @@ Verify the global server.bundle1 option
> EOF
$ hg serve -p $HGPORT -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
- $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT not-bundle2
+ $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2
requesting all changes
abort: remote error:
incompatible Mercurial client; bundle2 required
@@ -1046,7 +1045,7 @@ Verify the global server.bundle1 option
$ hg serve -p $HGPORT -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
- $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT/ not-bundle2
+ $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
requesting all changes
abort: remote error:
incompatible Mercurial client; bundle2 required
@@ -1063,7 +1062,7 @@ Verify the global server.bundle1 option
$ hg serve -p $HGPORT -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
- $ hg --config experimental.bundle2-exp=false clone http://localhost:$HGPORT/ not-bundle2-2
+ $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2
requesting all changes
adding changesets
adding manifests
@@ -1100,7 +1099,7 @@ Verify bundle1 pushes can be disabled
$ cd bundle2-only
$ echo commit > foo
$ hg commit -m commit
- $ hg --config experimental.bundle2-exp=false push
+ $ hg --config devel.legacy.exchange=bundle1 push
pushing to http://localhost:$HGPORT/
searching for changes
abort: remote error:
diff --git a/tests/test-bundle2-format.t b/tests/test-bundle2-format.t
--- a/tests/test-bundle2-format.t
+++ b/tests/test-bundle2-format.t
@@ -112,7 +112,7 @@ Create an extension to test bundle2 API
> bundled = repo.revs('%ld::%ld', revs, revs)
> headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
> headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
- > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
+ > outgoing = discovery.outgoing(repo, headcommon, headmissing)
> cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None)
> bundler.newpart('changegroup', data=cg.getchunks(),
> mandatory=False)
@@ -227,7 +227,6 @@ Create an extension to test bundle2 API
> [extensions]
> bundle2=$TESTTMP/bundle2.py
> [experimental]
- > bundle2-exp=True
> evolution=createmarkers
> [ui]
> ssh=python "$TESTDIR/dummyssh"
diff --git a/tests/test-bundle2-multiple-changegroups.t b/tests/test-bundle2-multiple-changegroups.t
--- a/tests/test-bundle2-multiple-changegroups.t
+++ b/tests/test-bundle2-multiple-changegroups.t
@@ -3,7 +3,7 @@ Create an extension to test bundle2 with
$ cat > bundle2.py < """
> """
- > from mercurial import changegroup, exchange
+ > from mercurial import changegroup, discovery, exchange
>
> def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None,
> b2caps=None, heads=None, common=None,
@@ -12,13 +12,14 @@ Create an extension to test bundle2 with
> # changegroup part we are being requested. Use the parent of each head
> # in 'heads' as intermediate heads for the first changegroup.
> intermediates = [repo[r].p1().node() for r in heads]
- > cg = changegroup.getchangegroup(repo, source, heads=intermediates,
- > common=common, bundlecaps=bundlecaps)
+ > outgoing = discovery.outgoing(repo, common, intermediates)
+ > cg = changegroup.getchangegroup(repo, source, outgoing,
+ > bundlecaps=bundlecaps)
> bundler.newpart('output', data='changegroup1')
> bundler.newpart('changegroup', data=cg.getchunks())
- > cg = changegroup.getchangegroup(repo, source, heads=heads,
- > common=common + intermediates,
- > bundlecaps=bundlecaps)
+ > outgoing = discovery.outgoing(repo, common + intermediates, heads)
+ > cg = changegroup.getchangegroup(repo, source, outgoing,
+ > bundlecaps=bundlecaps)
> bundler.newpart('output', data='changegroup2')
> bundler.newpart('changegroup', data=cg.getchunks())
>
@@ -33,8 +34,6 @@ Create an extension to test bundle2 with
> EOF
$ cat >> $HGRCPATH << EOF
- > [experimental]
- > bundle2-exp=True
> [ui]
> logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
> EOF
diff --git a/tests/test-bundle2-pushback.t b/tests/test-bundle2-pushback.t
--- a/tests/test-bundle2-pushback.t
+++ b/tests/test-bundle2-pushback.t
@@ -50,8 +50,6 @@ Enable extension
$ cat >> $HGRCPATH < [extensions]
> bundle2=$TESTTMP/bundle2.py
- > [experimental]
- > bundle2-exp = True
> EOF
Without config
diff --git a/tests/test-bundle2-remote-changegroup.t b/tests/test-bundle2-remote-changegroup.t
--- a/tests/test-bundle2-remote-changegroup.t
+++ b/tests/test-bundle2-remote-changegroup.t
@@ -8,7 +8,7 @@ Create an extension to test bundle2 remo
> Current bundle2 implementation doesn't provide a way to generate those
> parts, so they must be created by extensions.
> """
- > from mercurial import bundle2, changegroup, exchange, util
+ > from mercurial import bundle2, changegroup, discovery, exchange, util
>
> def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None,
> b2caps=None, heads=None, common=None,
@@ -22,7 +22,7 @@ Create an extension to test bundle2 remo
> part to add:
> - changegroup common_revset heads_revset
> Creates a changegroup part based, using common_revset and
- > heads_revset for changegroup.getchangegroup.
+ > heads_revset for outgoing
> - remote-changegroup url file
> Creates a remote-changegroup part for a bundle at the given
> url. Size and digest, as required by the client, are computed
@@ -63,8 +63,8 @@ Create an extension to test bundle2 remo
> _common, heads = args.split()
> common.extend(repo.lookup(r) for r in repo.revs(_common))
> heads = [repo.lookup(r) for r in repo.revs(heads)]
- > cg = changegroup.getchangegroup(repo, 'changegroup',
- > heads=heads, common=common)
+ > outgoing = discovery.outgoing(repo, common, heads)
+ > cg = changegroup.getchangegroup(repo, 'changegroup', outgoing)
> newpart('changegroup', cg.getchunks())
> else:
> raise Exception('unknown verb')
@@ -78,8 +78,6 @@ Start a simple HTTP server to serve bund
$ cat dumb.pid >> $DAEMON_PIDS
$ cat >> $HGRCPATH << EOF
- > [experimental]
- > bundle2-exp=True
> [ui]
> ssh=python "$TESTDIR/dummyssh"
> logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
diff --git a/tests/test-check-py3-commands.t b/tests/test-check-py3-commands.t
new file mode 100644
--- /dev/null
+++ b/tests/test-check-py3-commands.t
@@ -0,0 +1,14 @@
+#require py3exe
+
+This test helps in keeping a track on which commands we can run on
+Python 3 and see what kind of errors are coming up.
+The full traceback is hidden to have a stable output.
+
+ $ for cmd in version debuginstall ; do
+ > echo $cmd
+ > $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1
+ > done
+ version
+ TypeError: str expected, not bytes
+ debuginstall
+ TypeError: str expected, not bytes
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -13,164 +13,22 @@
tests/test-demandimport.py not using absolute_import
#if py3exe
- $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
- doc/hgmanpage.py: invalid syntax: invalid syntax (, line *) (glob)
- hgext/acl.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/automv.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/blackbox.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/bugzilla.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/censor.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/chgserver.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/children.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/churn.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/clonebundles.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/color.py: invalid syntax: invalid syntax (, line *) (glob)
- hgext/convert/bzr.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/common.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/convcmd.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/cvs.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/cvsps.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/darcs.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/filemap.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/git.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/gnuarch.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/hg.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/monotone.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/p4.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/subversion.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/convert/transport.py: error importing module: No module named 'svn.client' (line *) (glob)
- hgext/eol.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/extdiff.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/factotum.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/fetch.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/fsmonitor/state.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/fsmonitor/watchmanclient.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/gpg.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/graphlog.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/hgk.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/highlight/highlight.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/histedit.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/journal.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/keyword.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/basestore.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/lfcommands.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/lfutil.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/localstore.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/overrides.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/proto.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/remotestore.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/reposetup.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/storefactory.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/uisetup.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/largefiles/wirestore.py: error importing module: Parent module 'hgext.largefiles' not loaded, cannot perform relative import (line *) (glob)
- hgext/mq.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/notify.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/pager.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/patchbomb.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/purge.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/rebase.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/record.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/relink.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/schemes.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/share.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/shelve.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/strip.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/transplant.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/win32mbcs.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- hgext/win32text.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/archival.py: invalid syntax: invalid syntax (, line *) (glob)
- mercurial/bookmarks.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/branchmap.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/bundle2.py: invalid syntax: invalid syntax (, line *) (glob)
- mercurial/bundlerepo.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/byterange.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/changegroup.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/changelog.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/cmdutil.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/commands.py: invalid syntax: invalid syntax (, line *) (glob)
- mercurial/commandserver.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/config.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/context.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/copies.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/crecord.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/dagparser.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/dagutil.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/destutil.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/dirstate.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/discovery.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/dispatch.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)
- mercurial/exchange.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/extensions.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/fancyopts.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/filelog.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/filemerge.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/fileset.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/formatter.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/graphmod.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/hbisect.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/help.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/hg.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/hgweb/common.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/hgweb_mod.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/hgwebdir_mod.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/protocol.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/request.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/server.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/webcommands.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/webutil.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hgweb/wsgicgi.py: error importing module: Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
- mercurial/hook.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/httpconnection.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/httppeer.py: error importing: str expected, not bytes (error at i18n.py:*) (glob)
- mercurial/keepalive.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/localrepo.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/lock.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/mail.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/manifest.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob)
- mercurial/match.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/mdiff.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob)
- mercurial/merge.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/minirst.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/namespaces.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/obsolete.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob)
- mercurial/patch.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/pathutil.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/peer.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/pure/mpatch.py: error importing module: 'VendorImporter' object has no attribute 'find_spec' (line *) (glob)
- mercurial/pure/osutil.py: error importing module: 'VendorImporter' object has no attribute 'find_spec' (line *) (glob)
- mercurial/pure/parsers.py: error importing module: 'VendorImporter' object has no attribute 'find_spec' (line *) (glob)
- mercurial/pushkey.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/pvec.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/registrar.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/repair.py: error importing module: invalid syntax (bundle2.py, line *) (line *) (glob)
- mercurial/repoview.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/revlog.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/revset.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/scmposix.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/scmutil.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/scmwindows.py: error importing module: No module named '_winreg' (line *) (glob)
- mercurial/similar.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/simplemerge.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/sshpeer.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/sshserver.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/sslutil.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/statichttprepo.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/store.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/streamclone.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/subrepo.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/tagmerge.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/tags.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/templatefilters.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/templatekw.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/templater.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/transaction.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/ui.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/unionrepo.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/url.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/util.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/verify.py: error importing: '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
- mercurial/win32.py: error importing module: No module named 'msvcrt' (line *) (glob)
- mercurial/windows.py: error importing module: No module named '_winreg' (line *) (glob)
- mercurial/wireproto.py: error importing module: invalid syntax (bundle2.py, line *) (line *) (glob)
+ $ hg files 'set:(**.py) - grep(pygments)' | sed 's|\\|/|g' \
+ > | xargs $PYTHON3 contrib/check-py3-compat.py \
+ > | sed 's/[0-9][0-9]*)$/*)/'
+ hgext/convert/transport.py: error importing: No module named 'svn.client' (error at transport.py:*)
+ hgext/fsmonitor/pywatchman/capabilities.py: error importing: No module named 'pybser' (error at __init__.py:*)
+ hgext/fsmonitor/pywatchman/pybser.py: error importing: No module named 'pybser' (error at __init__.py:*)
+ hgext/fsmonitor/watchmanclient.py: error importing: No module named 'pybser' (error at __init__.py:*)
+ hgext/mq.py: error importing: __import__() argument 1 must be str, not bytes (error at extensions.py:*)
+ mercurial/scmwindows.py: error importing: No module named 'winreg' (error at scmwindows.py:*)
+ mercurial/win32.py: error importing: No module named 'msvcrt' (error at win32.py:*)
+ mercurial/windows.py: error importing: No module named 'msvcrt' (error at windows.py:*)
#endif
+
+#if py3exe py3pygments
+ $ hg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \
+ > | xargs $PYTHON3 contrib/check-py3-compat.py \
+ > | sed 's/[0-9][0-9]*)$/*)/'
+#endif
diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -829,7 +829,7 @@ We only get bookmarks from the remote, n
Default path should be source, not share.
$ hg -R share-dest1b config paths.default
- $TESTTMP/source1a (glob)
+ $TESTTMP/source1b (glob)
Checked out revision should be head of default branch
@@ -1060,7 +1060,12 @@ Cloning into pooled storage doesn't race
date: Thu Jan 01 00:00:00 1970 +0000
summary: 1a
- $ cat race1.log
+One repo should be new, the other should be shared from the pool. We
+don't care which is which, so we just make sure we always print the
+one containing "new pooled" first, then one one containing "existing
+pooled".
+
+ $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
(sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
requesting all changes
adding changesets
@@ -1073,10 +1078,8 @@ Cloning into pooled storage doesn't race
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
- $ cat race2.log
+ $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
(sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
- waiting for lock on repository share-destrace2 held by * (glob)
- got lock after \d+ seconds (re)
searching for changes
no changes found
adding remote bookmark bookA
diff --git a/tests/test-clonebundles.t b/tests/test-clonebundles.t
--- a/tests/test-clonebundles.t
+++ b/tests/test-clonebundles.t
@@ -61,7 +61,7 @@ Server is not running aborts
$ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
$ hg clone http://localhost:$HGPORT server-not-runner
applying clone bundle from http://localhost:$HGPORT1/bundle.hg
- error fetching bundle: * refused* (glob)
+ error fetching bundle: (.* refused.*|Protocol not supported) (re)
abort: error applying bundle
(if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
[255]
@@ -156,34 +156,32 @@ changes, clone bundles produced by new M
by old clients.
$ f --size --hexdump full.hg
- full.hg: size=418
+ full.hg: size=396
0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
- 0040: f4 d4 62 23 06 06 e6 65 40 f9 4d c1 2a 31 09 cf |..b#...e@.M.*1..|
+ 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
- 00a0: 28 00 19 40 13 0e ac fa df ab ff 7b 3f fb 92 dc |(..@.......{?...|
- 00b0: 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 ac 2f b0 a9 |..b......=ZD./..|
- 00c0: c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 25 1b 9a 1b |.f.T.&......%...|
- 00d0: 99 19 9a 5a 18 9b a6 18 19 00 dd 67 61 61 98 06 |...Z.......gaa..|
- 00e0: f4 80 49 4a 8a 65 52 92 41 9a 81 81 a5 11 17 50 |..IJ.eR.A......P|
- 00f0: 31 30 58 19 cc 80 98 25 29 b1 08 c4 37 07 79 19 |10X....%)...7.y.|
- 0100: 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb e5 9e 45 bf |..A...A.].e...E.|
- 0110: 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 61 |......+D4g.....a|
- 0120: a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 d0 d8 c2 dc |....... %.4.....|
- 0130: d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc 34 31 c5 d0 |....0.4.....41..|
- 0140: c4 24 31 c9 32 2d d1 c2 2c c5 30 25 09 e4 ee 85 |.$1.2-..,.0%....|
- 0150: 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 fe f8 ec 7b |......6.*.G4...{|
- 0160: 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 06 3b 10 14 |s7?.$b..M..@.;..|
- 0170: 36 a4 38 10 04 d8 21 01 9a b1 83 f7 e9 45 8b d2 |6.8...!......E..|
- 0180: 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 76 f1 36 25 |V....R..x...v.6%|
- 0190: 81 89 c7 ad ec 90 34 48 75 2b 89 49 bf 00 cf 72 |......4Hu+.I...r|
- 01a0: f4 7f |..|
+ 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
+ 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
+ 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
+ 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
+ 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
+ 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
+ 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
+ 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
+ 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
+ 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
+ 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
+ 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
+ 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
+ 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
+ 0180: 54 47 75 2b 89 49 b1 00 d2 8a eb 92 |TGu+.I......|
$ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
$ hg clone -U http://localhost:$HGPORT full-bundle
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -29,6 +29,111 @@
$ hg merge -q foo
$ hg commit -m 'merge' -d '1500001 0' -u 'person'
+Test arithmetic operators have the right precedence:
+
+ $ hg log -l 1 -T '{date(date, "%s") + 5 * 10} {date(date, "%s") - 2 * 3}\n'
+ 1500051 1499995
+ $ hg log -l 1 -T '{date(date, "%s") * 5 + 10} {date(date, "%s") * 3 - 2}\n'
+ 7500015 4500001
+
+Test division:
+
+ $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n'
+ (template
+ (/
+ ('integer', '5')
+ ('integer', '2'))
+ ('string', ' ')
+ (func
+ ('symbol', 'mod')
+ (list
+ ('integer', '5')
+ ('integer', '2')))
+ ('string', '\n'))
+ 2 1
+ $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n'
+ (template
+ (/
+ ('integer', '5')
+ (negate
+ ('integer', '2')))
+ ('string', ' ')
+ (func
+ ('symbol', 'mod')
+ (list
+ ('integer', '5')
+ (negate
+ ('integer', '2'))))
+ ('string', '\n'))
+ -3 -1
+ $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n'
+ (template
+ (/
+ (negate
+ ('integer', '5'))
+ ('integer', '2'))
+ ('string', ' ')
+ (func
+ ('symbol', 'mod')
+ (list
+ (negate
+ ('integer', '5'))
+ ('integer', '2')))
+ ('string', '\n'))
+ -3 1
+ $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n'
+ (template
+ (/
+ (negate
+ ('integer', '5'))
+ (negate
+ ('integer', '2')))
+ ('string', ' ')
+ (func
+ ('symbol', 'mod')
+ (list
+ (negate
+ ('integer', '5'))
+ (negate
+ ('integer', '2'))))
+ ('string', '\n'))
+ 2 -1
+
+Filters bind closer than arithmetic:
+
+ $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n'
+ (template
+ (-
+ (|
+ (func
+ ('symbol', 'revset')
+ ('string', '.'))
+ ('symbol', 'count'))
+ ('integer', '1'))
+ ('string', '\n'))
+ 0
+
+But negate binds closer still:
+
+ $ hg debugtemplate -r0 -v '{1-3|stringify}\n'
+ (template
+ (-
+ ('integer', '1')
+ (|
+ ('integer', '3')
+ ('symbol', 'stringify')))
+ ('string', '\n'))
+ hg: parse error: arithmetic only defined on integers
+ [255]
+ $ hg debugtemplate -r0 -v '{-3|stringify}\n'
+ (template
+ (|
+ (negate
+ ('integer', '3'))
+ ('symbol', 'stringify'))
+ ('string', '\n'))
+ -3
+
Second branch starting at nullrev:
$ hg update null
@@ -103,6 +208,18 @@ Test templates and style maps in files:
$ hg log -l1 -T./map-simple
8
+Test template map inheritance
+
+ $ echo "__base__ = map-cmdline.default" > map-simple
+ $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
+ $ hg log -l1 -T./map-simple
+ changeset: ***8***
+ tag: tip
+ user: test
+ date: Wed Jan 01 10:01:00 2020 +0000
+ summary: third
+
+
Template should precede style option
$ hg log -l1 --style default -T '{rev}\n'
@@ -2878,14 +2995,15 @@ Test integer literal:
$ hg debugtemplate -v '{(-4)}\n'
(template
(group
- ('integer', '-4'))
+ (negate
+ ('integer', '4')))
('string', '\n'))
-4
$ hg debugtemplate '{(-)}\n'
- hg: parse error at 2: integer literal without digits
+ hg: parse error at 3: not a prefix: )
[255]
$ hg debugtemplate '{(-a)}\n'
- hg: parse error at 2: integer literal without digits
+ hg: parse error: negation needs an integer argument
[255]
top-level integer literal is interpreted as symbol (i.e. variable name):
@@ -3202,6 +3320,11 @@ Test recursive evaluation:
hg: parse error: fill expects an integer width
[255]
+ $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
+ bcc7ff960b8e:desc to be
+ termwidth.1:wrapped desc
+ termwidth.1:to be wrapped (no-eol)
+
$ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
{node|short} (no-eol)
$ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
@@ -3323,6 +3446,27 @@ Test width argument passed to pad functi
hg: parse error: pad() expects an integer width
[255]
+Test boolean argument passed to pad function
+
+ no crash
+
+ $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n'
+ ---------0
+
+ string/literal
+
+ $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n'
+ ---------0
+ $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n'
+ 0---------
+ $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n'
+ 0---------
+
+ unknown keyword is evaluated to ''
+
+ $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n'
+ 0---------
+
Test separate function
$ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n'
@@ -3332,6 +3476,23 @@ Test separate function
$ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n'
a \x1b[0;31mb\x1b[0m c d (esc)
+Test boolean expression/literal passed to if function
+
+ $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n'
+ rev 0 is True
+ $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n'
+ literal 0 is True as well
+ $ hg log -r 0 -T '{if("", "", "empty string is False")}\n'
+ empty string is False
+ $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n'
+ empty list is False
+ $ hg log -r 0 -T '{if(true, "true is True")}\n'
+ true is True
+ $ hg log -r 0 -T '{if(false, "", "false is False")}\n'
+ false is False
+ $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n'
+ non-empty string is True
+
Test ifcontains function
$ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
@@ -3451,6 +3612,35 @@ default. join() should agree with the de
5:13207e5a10d9fd28ec424934298e176197f2c67f,
4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
+Test files function
+
+ $ hg log -T "{rev}\n{join(files('*'), '\n')}\n"
+ 2
+ a
+ aa
+ b
+ 1
+ a
+ 0
+ a
+
+ $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n"
+ 2
+ aa
+ 1
+
+ 0
+
+
+Test relpath function
+
+ $ hg log -r0 -T '{files % "{file|relpath}\n"}'
+ a
+ $ cd ..
+ $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}'
+ r/a (glob)
+ $ cd r
+
Test active bookmark templating
$ hg book foo
diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -78,7 +78,7 @@ typical client does not want echo-back m
summary summarize working directory state
update update working directory (or switch revisions)
- (use "hg help" for the full list of commands or "hg -v" for details)
+ (use 'hg help' for the full list of commands or 'hg -v' for details)
*** runcommand id --quiet
000000000000
*** runcommand id
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -120,13 +120,13 @@ No changes, just a different message:
stripping amended changeset 74609c7f506e
1 changesets found
uncompressed size of bundle content:
- 270 (changelog)
+ 254 (changelog)
163 (manifests)
129 a
saved backup bundle to $TESTTMP/.hg/strip-backup/74609c7f506e-1bfde511-amend-backup.hg (glob)
1 changesets found
uncompressed size of bundle content:
- 266 (changelog)
+ 250 (changelog)
163 (manifests)
129 a
adding branch
@@ -264,13 +264,13 @@ then, test editing custom commit message
stripping amended changeset 5f357c7560ab
1 changesets found
uncompressed size of bundle content:
- 258 (changelog)
+ 249 (changelog)
163 (manifests)
131 a
saved backup bundle to $TESTTMP/.hg/strip-backup/5f357c7560ab-e7c84ade-amend-backup.hg (glob)
1 changesets found
uncompressed size of bundle content:
- 266 (changelog)
+ 257 (changelog)
163 (manifests)
131 a
adding branch
@@ -307,13 +307,13 @@ Same, but with changes in working dir (d
stripping amended changeset 7ab3bf440b54
2 changesets found
uncompressed size of bundle content:
- 490 (changelog)
+ 464 (changelog)
322 (manifests)
249 a
saved backup bundle to $TESTTMP/.hg/strip-backup/7ab3bf440b54-8e3b5088-amend-backup.hg (glob)
1 changesets found
uncompressed size of bundle content:
- 266 (changelog)
+ 257 (changelog)
163 (manifests)
133 a
adding branch
@@ -638,7 +638,7 @@ Amend a merge changeset (with renames an
(no more unresolved files)
$ hg ci -m 'merge bar'
$ hg log --config diff.git=1 -pr .
- changeset: 23:93cd4445f720
+ changeset: 23:69c24fe01e35
tag: tip
parent: 22:30d96aeaf27b
parent: 21:1aa437659d19
@@ -653,11 +653,11 @@ Amend a merge changeset (with renames an
--- a/cc
+++ b/cc
@@ -1,1 +1,5 @@
- +<<<<<<< local: 30d96aeaf27b - test: aa
+ +<<<<<<< working copy: 30d96aeaf27b - test: aa
dd
+=======
+cc
- +>>>>>>> other: 1aa437659d19 bar - test: aazzcc
+ +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
diff --git a/z b/zz
rename from z
rename to zz
@@ -671,7 +671,7 @@ Amend a merge changeset (with renames an
$ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
HGEDITFORM=commit.amend.merge
$ hg log --config diff.git=1 -pr .
- changeset: 24:832b50f2c271
+ changeset: 24:cfa2fbef3169
tag: tip
parent: 22:30d96aeaf27b
parent: 21:1aa437659d19
@@ -686,11 +686,11 @@ Amend a merge changeset (with renames an
--- a/cc
+++ b/cc
@@ -1,1 +1,5 @@
- +<<<<<<< local: 30d96aeaf27b - test: aa
+ +<<<<<<< working copy: 30d96aeaf27b - test: aa
dd
+=======
+cc
- +>>>>>>> other: 1aa437659d19 bar - test: aazzcc
+ +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
diff --git a/z b/zz
rename from z
rename to zz
@@ -704,7 +704,7 @@ Amend a merge changeset (with renames an
$ hg mv zz z
$ hg ci --amend -m 'merge bar (undo rename)'
$ hg log --config diff.git=1 -pr .
- changeset: 26:bdafc5c72f74
+ changeset: 26:c34de68b014c
tag: tip
parent: 22:30d96aeaf27b
parent: 21:1aa437659d19
@@ -719,11 +719,11 @@ Amend a merge changeset (with renames an
--- a/cc
+++ b/cc
@@ -1,1 +1,5 @@
- +<<<<<<< local: 30d96aeaf27b - test: aa
+ +<<<<<<< working copy: 30d96aeaf27b - test: aa
dd
+=======
+cc
- +>>>>>>> other: 1aa437659d19 bar - test: aazzcc
+ +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
$ hg debugrename z
z not renamed
@@ -740,9 +740,9 @@ Amend a merge changeset (with renames du
$ echo aa >> aaa
$ hg ci -m 'merge bar again'
$ hg log --config diff.git=1 -pr .
- changeset: 28:32f19415b634
+ changeset: 28:37d40dcef03b
tag: tip
- parent: 26:bdafc5c72f74
+ parent: 26:c34de68b014c
parent: 27:4c94d5bc65f5
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@@ -775,9 +775,9 @@ Amend a merge changeset (with renames du
$ hg mv aaa aa
$ hg ci --amend -m 'merge bar again (undo rename)'
$ hg log --config diff.git=1 -pr .
- changeset: 30:1e2a06b3d312
+ changeset: 30:537c6d1b3633
tag: tip
- parent: 26:bdafc5c72f74
+ parent: 26:c34de68b014c
parent: 27:4c94d5bc65f5
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@@ -813,13 +813,13 @@ Amend a merge changeset (with manifest-l
$ hg merge -q bar --config ui.interactive=True << EOF
> c
> EOF
- local changed aa which remote deleted
+ local [working copy] changed aa which other [merge rev] deleted
use (c)hanged version, (d)elete, or leave (u)nresolved? c
$ hg ci -m 'merge bar (with conflicts)'
$ hg log --config diff.git=1 -pr .
- changeset: 33:97a298b0c59f
+ changeset: 33:7afcba911942
tag: tip
- parent: 32:3d78ce4226b8
+ parent: 32:6075d69d215d
parent: 31:67db8847a540
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@@ -829,9 +829,9 @@ Amend a merge changeset (with manifest-l
$ hg rm aa
$ hg ci --amend -m 'merge bar (with conflicts, amended)'
$ hg log --config diff.git=1 -pr .
- changeset: 35:6de0c1bde1c8
+ changeset: 35:376965e47ddd
tag: tip
- parent: 32:3d78ce4226b8
+ parent: 32:6075d69d215d
parent: 31:67db8847a540
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@@ -927,7 +927,7 @@ Test that "diff()" in committemplate wor
HG: M:
HG: A: foo
HG: R:
- HG: diff -r 6de0c1bde1c8 foo
+ HG: diff -r 376965e47ddd foo
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
@@ -941,12 +941,12 @@ Test that "diff()" in committemplate wor
HG: M:
HG: A: foo y
HG: R:
- HG: diff -r 6de0c1bde1c8 foo
+ HG: diff -r 376965e47ddd foo
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
HG: +foo
- HG: diff -r 6de0c1bde1c8 y
+ HG: diff -r 376965e47ddd y
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
@@ -959,18 +959,18 @@ Test that "diff()" in committemplate wor
HG: M:
HG: A: foo y
HG: R: a
- HG: diff -r 6de0c1bde1c8 a
+ HG: diff -r 376965e47ddd a
HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: @@ -1,2 +0,0 @@
HG: -a
HG: -a
- HG: diff -r 6de0c1bde1c8 foo
+ HG: diff -r 376965e47ddd foo
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
HG: +foo
- HG: diff -r 6de0c1bde1c8 y
+ HG: diff -r 376965e47ddd y
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
@@ -983,23 +983,23 @@ Test that "diff()" in committemplate wor
HG: M:
HG: A: foo y
HG: R: a x
- HG: diff -r 6de0c1bde1c8 a
+ HG: diff -r 376965e47ddd a
HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: @@ -1,2 +0,0 @@
HG: -a
HG: -a
- HG: diff -r 6de0c1bde1c8 foo
+ HG: diff -r 376965e47ddd foo
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
HG: +foo
- HG: diff -r 6de0c1bde1c8 x
+ HG: diff -r 376965e47ddd x
HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: @@ -1,1 +0,0 @@
HG: -x
- HG: diff -r 6de0c1bde1c8 y
+ HG: diff -r 376965e47ddd y
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
@@ -1014,23 +1014,23 @@ Test that "diff()" in committemplate wor
HG: M:
HG: A: foo y
HG: R: a x
- HG: diff -r 6de0c1bde1c8 a
+ HG: diff -r 376965e47ddd a
HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: @@ -1,2 +0,0 @@
HG: -a
HG: -a
- HG: diff -r 6de0c1bde1c8 foo
+ HG: diff -r 376965e47ddd foo
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
HG: +foo
- HG: diff -r 6de0c1bde1c8 x
+ HG: diff -r 376965e47ddd x
HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: @@ -1,1 +0,0 @@
HG: -x
- HG: diff -r 6de0c1bde1c8 y
+ HG: diff -r 376965e47ddd y
HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
HG: @@ -0,0 +1,1 @@
diff --git a/tests/test-commit-interactive-curses.t b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -37,6 +37,7 @@ Committing some changes but stopping on
> EOF
$ hg commit -i -m "a" -d "0 0"
no changes to record
+ [1]
$ hg tip
changeset: -1:000000000000
tag: tip
@@ -60,6 +61,7 @@ Committing some changes
Check that commit -i works with no changes
$ hg commit -i
no changes to record
+ [1]
Committing only one file
diff --git a/tests/test-commit-interactive.t b/tests/test-commit-interactive.t
--- a/tests/test-commit-interactive.t
+++ b/tests/test-commit-interactive.t
@@ -29,6 +29,7 @@ Select no files
examine changes to 'empty-rw'? [Ynesfdaq?] n
no changes to record
+ [1]
$ hg tip -p
changeset: -1:000000000000
@@ -1376,6 +1377,7 @@ Removing changes from patch
record this change to 'editedfile'? [Ynesfdaq?] e
no changes to record
+ [1]
$ cat editedfile
This change will not be committed
This is the second line
@@ -1487,6 +1489,7 @@ session
record this change to 'editedfile'? [Ynesfdaq?] n
no changes to record
+ [1]
random text in random positions is still an error
diff --git a/tests/test-commit-unresolved.t b/tests/test-commit-unresolved.t
--- a/tests/test-commit-unresolved.t
+++ b/tests/test-commit-unresolved.t
@@ -34,7 +34,7 @@ Correct the conflict without marking the
$ echo "ABCD" > A
$ hg commit -m "Merged"
- abort: unresolved merge conflicts (see "hg help resolve")
+ abort: unresolved merge conflicts (see 'hg help resolve')
[255]
Mark the conflict as resolved and commit
@@ -56,7 +56,7 @@ Test that if a file is removed but not m
[1]
$ hg rm --force A
$ hg commit -m merged
- abort: unresolved merge conflicts (see "hg help resolve")
+ abort: unresolved merge conflicts (see 'hg help resolve')
[255]
$ hg resolve -ma
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -232,7 +232,7 @@ Show all commands + options
branches: active, closed, template
bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
cat: output, rev, decode, include, exclude
- config: untrusted, edit, local, global
+ config: untrusted, edit, local, global, template
copy: after, force, include, exclude, dry-run
debugancestor:
debugapplystreamclonebundle:
@@ -261,7 +261,7 @@ Show all commands + options
debuglocks: force-lock, force-wlock
debugmergestate:
debugnamecomplete:
- debugobsolete: flags, record-parents, rev, index, delete, date, user
+ debugobsolete: flags, record-parents, rev, index, delete, date, user, template
debugpathcomplete: full, normal, added, removed
debugpushkey:
debugpvec:
@@ -269,7 +269,7 @@ Show all commands + options
debugrebuildfncache:
debugrename: rev
debugrevlog: changelog, manifest, dir, dump
- debugrevspec: optimize
+ debugrevspec: optimize, show-stage, no-optimized, verify-optimized
debugsetparents:
debugsub: rev
debugsuccessorssets:
@@ -278,7 +278,7 @@ Show all commands + options
debugwireargs: three, four, five, ssh, remotecmd, insecure
files: rev, print0, include, exclude, template, subrepos
graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
- grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude
+ grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, template, include, exclude
heads: rev, topo, active, closed, style, template
help: extension, command, keyword, system
identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure
@@ -301,7 +301,7 @@ Show all commands + options
tip: patch, git, style, template
unbundle: update
verify:
- version:
+ version: template
$ hg init a
$ cd a
diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -54,6 +54,36 @@ Test case sensitive configuration
Section.KeY=Case Sensitive
Section.key=lower case
+ $ hg showconfig Section -Tjson
+ [
+ {
+ "name": "Section.KeY",
+ "source": "*.hgrc:16", (glob)
+ "value": "Case Sensitive"
+ },
+ {
+ "name": "Section.key",
+ "source": "*.hgrc:17", (glob)
+ "value": "lower case"
+ }
+ ]
+ $ hg showconfig Section.KeY -Tjson
+ [
+ {
+ "name": "Section.KeY",
+ "source": "*.hgrc:16", (glob)
+ "value": "Case Sensitive"
+ }
+ ]
+ $ hg showconfig -Tjson | tail -7
+ },
+ {
+ "name": "*", (glob)
+ "source": "*", (glob)
+ "value": "*" (glob)
+ }
+ ]
+
Test "%unset"
$ cat >> $HGRCPATH <>>>>>> other: c0c68e4fe667 - test: branch1
+ >>>>>>> merge rev: c0c68e4fe667 - test: branch1
Hop we are done.
$ hg status
@@ -79,13 +79,13 @@ Verify custom conflict markers
1
2
3
- <<<<<<< local: test 2
+ <<<<<<< working copy: test 2
6
8
=======
4
5
- >>>>>>> other: test 1
+ >>>>>>> merge rev: test 1
Hop we are done.
Verify line splitting of custom conflict marker which causes multiple lines
@@ -105,13 +105,13 @@ Verify line splitting of custom conflict
1
2
3
- <<<<<<< local: test 2
+ <<<<<<< working copy: test 2
6
8
=======
4
5
- >>>>>>> other: test 1
+ >>>>>>> merge rev: test 1
Hop we are done.
Verify line trimming of custom conflict marker using multi-byte characters
@@ -144,13 +144,13 @@ Verify line trimming of custom conflict
1
2
3
- <<<<<<< local: 123456789012345678901234567890123456789012345678901234567890\xe3\x81\x82... (esc)
+ <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345...
6
8
=======
4
5
- >>>>>>> other: branch1
+ >>>>>>> merge rev: branch1
Hop we are done.
Verify basic conflict markers
@@ -170,13 +170,13 @@ Verify basic conflict markers
1
2
3
- <<<<<<< local
+ <<<<<<< working copy
6
8
=======
4
5
- >>>>>>> other
+ >>>>>>> merge rev
Hop we are done.
internal:merge3
@@ -191,7 +191,7 @@ internal:merge3
[1]
$ cat a
Small Mathematical Series.
- <<<<<<< local
+ <<<<<<< working copy
1
2
3
@@ -209,7 +209,7 @@ internal:merge3
3
4
5
- >>>>>>> other
+ >>>>>>> merge rev
Hop we are done.
Add some unconflicting changes on each head, to make sure we really
diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t
--- a/tests/test-contrib-perf.t
+++ b/tests/test-contrib-perf.t
@@ -53,6 +53,8 @@ perfstatus
perfbranchmap
benchmark the update of a branchmap
perfcca (no help text available)
+ perfchangegroupchangelog
+ Benchmark producing a changelog group for a changegroup.
perfchangeset
(no help text available)
perfctxfiles (no help text available)
@@ -105,13 +107,14 @@ perfstatus
benchmark the computation of various volatile set
perfwalk (no help text available)
- (use "hg help -v perfstatusext" to show built-in aliases and global options)
+ (use 'hg help -v perfstatusext' to show built-in aliases and global options)
$ hg perfaddremove
$ hg perfancestors
$ hg perfancestorset 2
$ hg perfannotate a
$ hg perfbranchmap
$ hg perfcca
+ $ hg perfchangegroupchangelog
$ hg perfchangeset 2
$ hg perfctxfiles 2
$ hg perfdiffwd
diff --git a/tests/test-copy-move-merge.t b/tests/test-copy-move-merge.t
--- a/tests/test-copy-move-merge.t
+++ b/tests/test-copy-move-merge.t
@@ -85,7 +85,7 @@ Test disabling copy tracing
> c
> EOF
rebasing 2:add3f11052fa "other" (tip)
- remote changed a which local deleted
+ other [source] changed a which local [dest] deleted
use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
$ cat b
diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -224,10 +224,25 @@ copy --after on an added file
foo was clean:
$ hg st -AC foo
C foo
+Trying to copy on top of an existing file fails,
+ $ hg copy -A bar foo
+ foo: not overwriting - file already committed
+ (hg copy --after --force to replace the file by recording a copy)
+same error without the --after, so the user doesn't have to go through
+two hints:
+ $ hg copy bar foo
+ foo: not overwriting - file already committed
+ (hg copy --force to replace the file by recording a copy)
but it's considered modified after a copy --after --force
$ hg copy -Af bar foo
$ hg st -AC foo
M foo
bar
+The hint for a file that exists but is not in file history doesn't
+mention --force:
+ $ touch xyzzy
+ $ hg cp bar xyzzy
+ xyzzy: not overwriting - file exists
+ (hg copy --after to record the copy)
$ cd ..
diff --git a/tests/test-debugbundle.t b/tests/test-debugbundle.t
--- a/tests/test-debugbundle.t
+++ b/tests/test-debugbundle.t
@@ -16,7 +16,7 @@ Create a test repository:
$ hg bundle --base 0 --rev tip bundle2.hg -v --type none-v2
2 changesets found
uncompressed size of bundle content:
- 372 (changelog)
+ 344 (changelog)
322 (manifests)
113 b
113 c
@@ -60,8 +60,8 @@ Verbose output:
format: id, p1, p2, cset, delta base, len(delta)
changelog
- 0e067c57feba1a5694ca4844f05588bb1bf82342 3903775176ed42b1458a6281db4a0ccf4d9f287a 0000000000000000000000000000000000000000 0e067c57feba1a5694ca4844f05588bb1bf82342 3903775176ed42b1458a6281db4a0ccf4d9f287a 80
- 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 0000000000000000000000000000000000000000 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 80
+ 0e067c57feba1a5694ca4844f05588bb1bf82342 3903775176ed42b1458a6281db4a0ccf4d9f287a 0000000000000000000000000000000000000000 0e067c57feba1a5694ca4844f05588bb1bf82342 0000000000000000000000000000000000000000 66
+ 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0e067c57feba1a5694ca4844f05588bb1bf82342 0000000000000000000000000000000000000000 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0000000000000000000000000000000000000000 66
manifest
686dbf0aeca417636fa26a9121c681eabbb15a20 8515d4bfda768e04af4c13a69a72e28c7effbea7 0000000000000000000000000000000000000000 0e067c57feba1a5694ca4844f05588bb1bf82342 8515d4bfda768e04af4c13a69a72e28c7effbea7 55
diff --git a/tests/test-debugextensions.t b/tests/test-debugextensions.t
--- a/tests/test-debugextensions.t
+++ b/tests/test-debugextensions.t
@@ -4,6 +4,10 @@
$ cat > extwithoutinfos.py < EOF
+ $ cat > extwithinfos.py < testedwith = '3.0 3.1 3.2.1'
+ > buglink = 'https://example.org/bts'
+ > EOF
$ cat >> $HGRCPATH < [extensions]
@@ -13,11 +17,13 @@
> rebase=
> mq=
> ext1 = $debugpath
+ > ext2 = `pwd`/extwithinfos.py
> EOF
$ hg debugextensions
color
ext1 (untested!)
+ ext2 (3.2.1!)
histedit
mq
patchbomb
@@ -26,58 +32,82 @@
$ hg debugextensions -v
color
location: */hgext/color.py* (glob)
- tested with: internal
+ bundled: yes
ext1
location: */extwithoutinfos.py* (glob)
+ bundled: no
+ ext2
+ location: */extwithinfos.py* (glob)
+ bundled: no
+ tested with: 3.0 3.1 3.2.1
+ bug reporting: https://example.org/bts
histedit
location: */hgext/histedit.py* (glob)
- tested with: internal
+ bundled: yes
mq
location: */hgext/mq.py* (glob)
- tested with: internal
+ bundled: yes
patchbomb
location: */hgext/patchbomb.py* (glob)
- tested with: internal
+ bundled: yes
rebase
location: */hgext/rebase.py* (glob)
- tested with: internal
+ bundled: yes
$ hg debugextensions -Tjson | sed 's|\\\\|/|g'
[
{
"buglink": "",
+ "bundled": true,
"name": "color",
"source": "*/hgext/color.py*", (glob)
- "testedwith": "internal"
+ "testedwith": []
},
{
"buglink": "",
+ "bundled": false,
"name": "ext1",
"source": "*/extwithoutinfos.py*", (glob)
- "testedwith": ""
+ "testedwith": []
},
{
- "buglink": "",
- "name": "histedit",
- "source": "*/hgext/histedit.py*", (glob)
- "testedwith": "internal"
+ "buglink": "https://example.org/bts",
+ "bundled": false,
+ "name": "ext2",
+ "source": "*/extwithinfos.py*", (glob)
+ "testedwith": ["3.0", "3.1", "3.2.1"]
},
{
"buglink": "",
+ "bundled": true,
+ "name": "histedit",
+ "source": "*/hgext/histedit.py*", (glob)
+ "testedwith": []
+ },
+ {
+ "buglink": "",
+ "bundled": true,
"name": "mq",
"source": "*/hgext/mq.py*", (glob)
- "testedwith": "internal"
+ "testedwith": []
},
{
"buglink": "",
+ "bundled": true,
"name": "patchbomb",
"source": "*/hgext/patchbomb.py*", (glob)
- "testedwith": "internal"
+ "testedwith": []
},
{
"buglink": "",
+ "bundled": true,
"name": "rebase",
"source": "*/hgext/rebase.py*", (glob)
- "testedwith": "internal"
+ "testedwith": []
}
]
+
+ $ hg debugextensions -T '{ifcontains("3.1", testedwith, "{name}\n")}'
+ ext2
+ $ hg debugextensions \
+ > -T '{ifcontains("3.2", testedwith, "no substring match: {name}\n")}'
diff --git a/tests/test-default-push.t b/tests/test-default-push.t
--- a/tests/test-default-push.t
+++ b/tests/test-default-push.t
@@ -19,7 +19,7 @@ Push should provide a hint when both 'de
$ cd c
$ hg push --config paths.default=
abort: default repository not configured!
- (see the "path" section in "hg help config")
+ (see 'hg help config.paths')
[255]
$ cd ..
diff --git a/tests/test-demandimport.py b/tests/test-demandimport.py
--- a/tests/test-demandimport.py
+++ b/tests/test-demandimport.py
@@ -4,6 +4,14 @@ from mercurial import demandimport
demandimport.enable()
import os
+import subprocess
+import sys
+
+# Only run if demandimport is allowed
+if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'],
+ 'demandimport']):
+ sys.exit(80)
+
if os.name != 'nt':
try:
import distutils.msvc9compiler
@@ -55,8 +63,18 @@ print("re =", f(re))
print("re.stderr =", f(re.stderr))
print("re =", f(re))
+import contextlib
+print("contextlib =", f(contextlib))
+try:
+ from contextlib import unknownattr
+ print('no demandmod should be created for attribute of non-package '
+ 'module:\ncontextlib.unknownattr =', f(unknownattr))
+except ImportError as inst:
+ print('contextlib.unknownattr = ImportError: %s' % inst)
+
demandimport.disable()
os.environ['HGDEMANDIMPORT'] = 'disable'
+# this enable call should not actually enable demandimport!
demandimport.enable()
from mercurial import node
print("node =", f(node))
diff --git a/tests/test-demandimport.py.out b/tests/test-demandimport.py.out
--- a/tests/test-demandimport.py.out
+++ b/tests/test-demandimport.py.out
@@ -16,4 +16,6 @@ fred =
re =
re.stderr = ', mode 'w' at 0x?>
re =
+contextlib =
+contextlib.unknownattr = ImportError: cannot import name unknownattr
node =
diff --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t
--- a/tests/test-devel-warnings.t
+++ b/tests/test-devel-warnings.t
@@ -91,10 +91,11 @@
*/mercurial/dispatch.py:* in run (glob)
*/mercurial/dispatch.py:* in dispatch (glob)
*/mercurial/dispatch.py:* in _runcatch (glob)
+ */mercurial/dispatch.py:* in callcatch (glob)
+ */mercurial/dispatch.py:* in _runcatchfunc (glob)
*/mercurial/dispatch.py:* in _dispatch (glob)
*/mercurial/dispatch.py:* in runcommand (glob)
*/mercurial/dispatch.py:* in _runcommand (glob)
- */mercurial/dispatch.py:* in checkargs (glob)
*/mercurial/dispatch.py:* in (glob)
*/mercurial/util.py:* in check (glob)
$TESTTMP/buggylocking.py:* in buggylocking (glob)
@@ -125,10 +126,11 @@
*/mercurial/dispatch.py:* in run (glob)
*/mercurial/dispatch.py:* in dispatch (glob)
*/mercurial/dispatch.py:* in _runcatch (glob)
+ */mercurial/dispatch.py:* in callcatch (glob)
+ */mercurial/dispatch.py:* in _runcatchfunc (glob)
*/mercurial/dispatch.py:* in _dispatch (glob)
*/mercurial/dispatch.py:* in runcommand (glob)
*/mercurial/dispatch.py:* in _runcommand (glob)
- */mercurial/dispatch.py:* in checkargs (glob)
*/mercurial/dispatch.py:* in (glob)
*/mercurial/util.py:* in check (glob)
$TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
@@ -147,10 +149,11 @@
*/mercurial/dispatch.py:* in run (glob)
*/mercurial/dispatch.py:* in dispatch (glob)
*/mercurial/dispatch.py:* in _runcatch (glob)
+ */mercurial/dispatch.py:* in callcatch (glob)
+ */mercurial/dispatch.py:* in _runcatchfunc (glob)
*/mercurial/dispatch.py:* in _dispatch (glob)
*/mercurial/dispatch.py:* in runcommand (glob)
*/mercurial/dispatch.py:* in _runcommand (glob)
- */mercurial/dispatch.py:* in checkargs (glob)
*/mercurial/dispatch.py:* in (glob)
*/mercurial/util.py:* in check (glob)
$TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
diff --git a/tests/test-diff-change.t b/tests/test-diff-change.t
--- a/tests/test-diff-change.t
+++ b/tests/test-diff-change.t
@@ -50,6 +50,13 @@ as pairs even if x == y, but not for "f(
@@ -1,1 +1,1 @@
-third
+wdir
+ $ hg diff -r '(2:2)' --nodates
+ diff -r bf5ff72eb7e0 file.txt
+ --- a/file.txt
+ +++ b/file.txt
+ @@ -1,1 +1,1 @@
+ -third
+ +wdir
$ hg diff -r 2::2 --nodates
diff -r bf5ff72eb7e0 file.txt
--- a/file.txt
diff --git a/tests/test-diff-unified.t b/tests/test-diff-unified.t
--- a/tests/test-diff-unified.t
+++ b/tests/test-diff-unified.t
@@ -333,4 +333,20 @@ showfunc diff
+ return a + b + c + e;
}
+If [diff] git is set to true, but the user says --no-git, we should
+*not* get git diffs
+ $ hg diff --nodates --config diff.git=1 --no-git
+ diff -r f2c7c817fa55 f1
+ --- a/f1
+ +++ b/f1
+ @@ -2,6 +2,6 @@
+ int a = 0;
+ int b = 1;
+ int c = 2;
+ - int d = 3;
+ - return a + b + c + d;
+ + int e = 3;
+ + return a + b + c + e;
+ }
+
$ cd ..
diff --git a/tests/test-dispatch.t b/tests/test-dispatch.t
--- a/tests/test-dispatch.t
+++ b/tests/test-dispatch.t
@@ -27,7 +27,7 @@ Missing arg:
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
- (use "hg cat -h" to show more help)
+ (use 'hg cat -h' to show more help)
[255]
[defaults]
diff --git a/tests/test-excessive-merge.t b/tests/test-excessive-merge.t
--- a/tests/test-excessive-merge.t
+++ b/tests/test-excessive-merge.t
@@ -69,7 +69,7 @@
1 60 62 ..... 1 96155394af80 5e0375449e74 000000000000 (re)
2 122 62 ..... 2 92cc4c306b19 5e0375449e74 000000000000 (re)
3 184 69 ..... 3 e16a66a37edd 92cc4c306b19 96155394af80 (re)
- 4 253 29 ..... 4 2ee31f665a86 96155394af80 92cc4c306b19 (re)
+ 4 253 69 ..... 4 2ee31f665a86 96155394af80 92cc4c306b19 (re)
revision 1
$ hg manifest --debug 1
diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t
--- a/tests/test-extdiff.t
+++ b/tests/test-extdiff.t
@@ -31,10 +31,12 @@ Should diff cloned directories:
$ hg help falabala
hg falabala [OPTION]... [FILE]...
- use 'echo' to diff repository (or selected files)
+ use external program to diff repository (or selected files)
Show differences between revisions for the specified files, using the
- 'echo' program.
+ following program:
+
+ 'echo'
When two revision arguments are given, then changes are shown between
those revisions. If only one revision is specified then that revision is
@@ -397,15 +399,16 @@ Test handling of non-ASCII paths in gene
$ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy
abort: no matches
- (try "hg help" for a list of topics)
+ (try 'hg help' for a list of topics)
[255]
$ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null
$ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy
abort: no matches
- (try "hg help" for a list of topics)
+ (try 'hg help' for a list of topics)
[255]
- $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td | grep "^use"
- use '\xa5\xa5' to diff repository (or selected files)
+ $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \
+ > | grep "^ '"
+ '\xa5\xa5'
diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -249,7 +249,7 @@ Check absolute/relative import of extens
$TESTTMP/a (glob)
#endif
-#if absimport
+#if demandimport absimport
Examine whether module loading is delayed until actual refering, even
though module is imported with "absolute_import" feature.
@@ -432,6 +432,36 @@ Examine module importing.
REL: this is absextroot.xsub1.xsub2.called.func()
REL: this relimporter imports 'this is absextroot.relimportee'
+Examine whether sub-module is imported relatively as expected.
+
+See also issue5208 for detail about example case on Python 3.x.
+
+ $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py
+ $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found
+
+ $ cat > $TESTTMP/notexist.py < text = 'notexist.py at root is loaded unintentionally\n'
+ > EOF
+
+ $ cat > $TESTTMP/checkrelativity.py < from mercurial import cmdutil
+ > cmdtable = {}
+ > command = cmdutil.command(cmdtable)
+ >
+ > # demand import avoids failure of importing notexist here
+ > import extlibroot.lsub1.lsub2.notexist
+ >
+ > @command('checkrelativity', [], norepo=True)
+ > def checkrelativity(ui, *args, **opts):
+ > try:
+ > ui.write(extlibroot.lsub1.lsub2.notexist.text)
+ > return 1 # unintentional success
+ > except ImportError:
+ > pass # intentional failure
+ > EOF
+
+ $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity)
+
#endif
$ cd ..
@@ -562,7 +592,7 @@ Asking for help about a deprecated exten
graphlog command to view revision graphs from a shell (DEPRECATED)
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
Extension module help vs command help:
@@ -586,7 +616,7 @@ Extension module help vs command help:
compared to the working directory, and, when no revisions are specified,
the working directory files are compared to its parent.
- (use "hg help -e extdiff" to show help for the extdiff extension)
+ (use 'hg help -e extdiff' to show help for the extdiff extension)
options ([+] can be repeated):
@@ -666,7 +696,7 @@ Extension module help vs command help:
extdiff use external program to diff repository (or selected files)
- (use "hg help -v -e extdiff" to show built-in aliases and global options)
+ (use 'hg help -v -e extdiff' to show built-in aliases and global options)
@@ -718,7 +748,7 @@ Test help topic with same name as extens
A range acts as a closed interval. This means that a range of 3:5 gives 3,
4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
- use "hg help -c multirevs" to see help for the multirevs command
+ use 'hg help -c multirevs' to see help for the multirevs command
@@ -740,7 +770,7 @@ Test help topic with same name as extens
multirevs command
- (use "hg multirevs -h" to show more help)
+ (use 'hg multirevs -h' to show more help)
[255]
@@ -800,7 +830,7 @@ Make sure that user is asked to enter '-
dodo Does nothing
foofoo Writes 'Foo foo'
- (use "hg help -v -e dodo" to show built-in aliases and global options)
+ (use 'hg help -v -e dodo' to show built-in aliases and global options)
Make sure that '-v -e' prints list of built-in aliases along with
extension help itself
@@ -841,7 +871,7 @@ Make sure that single '-v' option shows
Does nothing
- (use "hg help -e dodo" to show help for the dodo extension)
+ (use 'hg help -e dodo' to show help for the dodo extension)
options:
@@ -903,7 +933,7 @@ along with extension help
beep Writes 'Beep beep'
something Does something
- (use "hg help -v dudu" to show built-in aliases and global options)
+ (use 'hg help -v dudu' to show built-in aliases and global options)
In case when extension name doesn't match any of its commands,
help options '-v' and '-v -e' should be equivalent
@@ -981,7 +1011,7 @@ Disabled extension commands:
patchbomb command to send changesets as (a series of) patch emails
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
$ hg qdel
@@ -990,7 +1020,7 @@ Disabled extension commands:
mq manage a stack of patches
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
[255]
@@ -1000,7 +1030,7 @@ Disabled extension commands:
churn command to display statistics about repository history
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
[255]
@@ -1010,12 +1040,12 @@ Disabled extensions:
$ hg help churn
churn extension - command to display statistics about repository history
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
$ hg help patchbomb
patchbomb extension - command to send changesets as (a series of) patch emails
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
Broken disabled extension and command:
@@ -1035,7 +1065,7 @@ Broken disabled extension and command:
$ hg --config extensions.path=./path.py help broken
broken extension - (no help text available)
- (use "hg help extensions" for information on enabling extensions)
+ (use 'hg help extensions' for information on enabling extensions)
$ cat > hgext/forest.py < /dev/null
warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
abort: no such help topic: foo
- (try "hg help --keyword foo")
+ (try 'hg help --keyword foo')
[255]
$ cat > throw.py <> throw.py
$ rm -f throw.pyc throw.pyo
- $ hg version -v --config extensions.throw=throw.py
+ $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
Mercurial Distributed SCM (version *) (glob)
(see https://mercurial-scm.org for more information)
@@ -1205,6 +1235,43 @@ Test version number support in 'hg versi
Enabled extensions:
throw external 1.twentythree
+ strip internal
+
+ $ hg version -q --config extensions.throw=throw.py
+ Mercurial Distributed SCM (version *) (glob)
+
+Test JSON output of version:
+
+ $ hg version -Tjson
+ [
+ {
+ "extensions": [],
+ "ver": "*" (glob)
+ }
+ ]
+
+ $ hg version --config extensions.throw=throw.py -Tjson
+ [
+ {
+ "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}],
+ "ver": "3.2.2"
+ }
+ ]
+
+ $ hg version --config extensions.strip= -Tjson
+ [
+ {
+ "extensions": [{"bundled": true, "name": "strip", "ver": null}],
+ "ver": "*" (glob)
+ }
+ ]
+
+Test template output of version:
+
+ $ hg version --config extensions.throw=throw.py --config extensions.strip= \
+ > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}'
+ throw 1.twentythree (external)
+ strip (internal)
Refuse to load extensions with minimum version requirements
diff --git a/tests/test-extensions-wrapfunction.py b/tests/test-extensions-wrapfunction.py
new file mode 100644
--- /dev/null
+++ b/tests/test-extensions-wrapfunction.py
@@ -0,0 +1,39 @@
+from __future__ import absolute_import, print_function
+
+from mercurial import extensions
+
+def genwrapper(x):
+ def f(orig, *args, **kwds):
+ return [x] + orig(*args, **kwds)
+ f.x = x
+ return f
+
+def getid(wrapper):
+ return getattr(wrapper, 'x', '-')
+
+wrappers = [genwrapper(i) for i in range(5)]
+
+class dummyclass(object):
+ def getstack(self):
+ return ['orig']
+
+dummy = dummyclass()
+
+def batchwrap(wrappers):
+ for w in wrappers:
+ extensions.wrapfunction(dummy, 'getstack', w)
+ print('wrap %d: %s' % (getid(w), dummy.getstack()))
+
+def batchunwrap(wrappers):
+ for w in wrappers:
+ result = None
+ try:
+ result = extensions.unwrapfunction(dummy, 'getstack', w)
+ msg = str(dummy.getstack())
+ except (ValueError, IndexError) as e:
+ msg = e.__class__.__name__
+ print('unwrap %s: %s: %s' % (getid(w), getid(result), msg))
+
+batchwrap(wrappers + [wrappers[0]])
+batchunwrap([(wrappers[i] if i >= 0 else None)
+ for i in [3, None, 0, 4, 0, 2, 1, None]])
diff --git a/tests/test-extensions-wrapfunction.py.out b/tests/test-extensions-wrapfunction.py.out
new file mode 100644
--- /dev/null
+++ b/tests/test-extensions-wrapfunction.py.out
@@ -0,0 +1,14 @@
+wrap 0: [0, 'orig']
+wrap 1: [1, 0, 'orig']
+wrap 2: [2, 1, 0, 'orig']
+wrap 3: [3, 2, 1, 0, 'orig']
+wrap 4: [4, 3, 2, 1, 0, 'orig']
+wrap 0: [0, 4, 3, 2, 1, 0, 'orig']
+unwrap 3: 3: [0, 4, 2, 1, 0, 'orig']
+unwrap -: 0: [4, 2, 1, 0, 'orig']
+unwrap 0: 0: [4, 2, 1, 'orig']
+unwrap 4: 4: [2, 1, 'orig']
+unwrap 0: -: ValueError
+unwrap 2: 2: [1, 'orig']
+unwrap 1: 1: ['orig']
+unwrap -: -: IndexError
diff --git a/tests/test-filecache.py b/tests/test-filecache.py
--- a/tests/test-filecache.py
+++ b/tests/test-filecache.py
@@ -179,6 +179,56 @@ def setbeforeget(repo):
print("* file y created")
print(repo.cached)
+def antiambiguity():
+ filename = 'ambigcheck'
+
+ # try some times, because reproduction of ambiguity depends on
+ # "filesystem time"
+ for i in xrange(5):
+ fp = open(filename, 'w')
+ fp.write('FOO')
+ fp.close()
+
+ oldstat = os.stat(filename)
+ if oldstat.st_ctime != oldstat.st_mtime:
+ # subsequent changing never causes ambiguity
+ continue
+
+ repetition = 3
+
+ # repeat changing via checkambigatclosing, to examine whether
+ # st_mtime is advanced multiple times as expecetd
+ for i in xrange(repetition):
+ # explicit closing
+ fp = scmutil.checkambigatclosing(open(filename, 'a'))
+ fp.write('FOO')
+ fp.close()
+
+ # implicit closing by "with" statement
+ with scmutil.checkambigatclosing(open(filename, 'a')) as fp:
+ fp.write('BAR')
+
+ newstat = os.stat(filename)
+ if oldstat.st_ctime != newstat.st_ctime:
+ # timestamp ambiguity was naturally avoided while repetition
+ continue
+
+ # st_mtime should be advanced "repetition * 2" times, because
+ # all changes occured at same time (in sec)
+ expected = (oldstat.st_mtime + repetition * 2) & 0x7fffffff
+ if newstat.st_mtime != expected:
+ print("'newstat.st_mtime %s is not %s (as %s + %s * 2)" %
+ (newstat.st_mtime, expected, oldstat.st_mtime, repetition))
+
+ # no more examination is needed regardless of result
+ break
+ else:
+ # This platform seems too slow to examine anti-ambiguity
+ # of file timestamp (or test happened to be executed at
+ # bad timing). Exit silently in this case, because running
+ # on other faster platforms can detect problems
+ pass
+
print('basic:')
print()
basic(fakerepo())
@@ -191,3 +241,7 @@ print()
print('setbeforeget:')
print()
setbeforeget(fakerepo())
+print()
+print('antiambiguity:')
+print()
+antiambiguity()
diff --git a/tests/test-filecache.py.out b/tests/test-filecache.py.out
--- a/tests/test-filecache.py.out
+++ b/tests/test-filecache.py.out
@@ -58,3 +58,6 @@ string 2 set externally
* file y created
creating
string from function
+
+antiambiguity:
+
diff --git a/tests/test-getbundle.t b/tests/test-getbundle.t
--- a/tests/test-getbundle.t
+++ b/tests/test-getbundle.t
@@ -170,7 +170,7 @@ Get branch and merge:
$ hg debuggetbundle repo bundle -t bundle2
$ hg debugbundle bundle
Stream params: {}
- changegroup -- "sortdict([('version', '01'), ('nbchanges', '18')])"
+ changegroup -- "sortdict([('version', '01')])"
7704483d56b2a7b5db54dcee7c62378ac629b348
29a4d1f17bd3f0779ca0525bebb1cfb51067c738
713346a995c363120712aed1aee7e04afd867638
diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t
--- a/tests/test-globalopts.t
+++ b/tests/test-globalopts.t
@@ -361,7 +361,7 @@ Testing -h/--help:
templating Template Usage
urls URL Paths
- (use "hg help -v" to show built-in aliases and global options)
+ (use 'hg help -v' to show built-in aliases and global options)
@@ -444,7 +444,7 @@ Testing -h/--help:
templating Template Usage
urls URL Paths
- (use "hg help -v" to show built-in aliases and global options)
+ (use 'hg help -v' to show built-in aliases and global options)
Not tested: --debugger
diff --git a/tests/test-glog-topological.t b/tests/test-glog-topological.t
--- a/tests/test-glog-topological.t
+++ b/tests/test-glog-topological.t
@@ -60,6 +60,20 @@ later.
o 0
+(display nodes filtered by log options)
+
+ $ hg log -G -r 'sort(all(), topo)' -k '.3'
+ o 8
+ |
+ o 3
+ |
+ ~
+ o 7
+ |
+ o 6
+ |
+ ~
+
(revset skipping nodes)
$ hg log -G --rev 'sort(not (2+6), topo)'
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -1455,12 +1455,13 @@ glog always reorders nodes which explain
(group
(group
(or
- (func
- ('symbol', 'user')
- ('string', 'test'))
- (func
- ('symbol', 'user')
- ('string', 'not-a-user')))))
+ (list
+ (func
+ ('symbol', 'user')
+ ('string', 'test'))
+ (func
+ ('symbol', 'user')
+ ('string', 'not-a-user'))))))
$ testlog -b not-a-branch
abort: unknown revision 'not-a-branch'!
abort: unknown revision 'not-a-branch'!
@@ -1470,26 +1471,28 @@ glog always reorders nodes which explain
(group
(group
(or
- (func
- ('symbol', 'branch')
- ('string', 'default'))
- (func
- ('symbol', 'branch')
- ('string', 'branch'))
- (func
- ('symbol', 'branch')
- ('string', 'branch')))))
+ (list
+ (func
+ ('symbol', 'branch')
+ ('string', 'default'))
+ (func
+ ('symbol', 'branch')
+ ('string', 'branch'))
+ (func
+ ('symbol', 'branch')
+ ('string', 'branch'))))))
$ testlog -k expand -k merge
[]
(group
(group
(or
- (func
- ('symbol', 'keyword')
- ('string', 'expand'))
- (func
- ('symbol', 'keyword')
- ('string', 'merge')))))
+ (list
+ (func
+ ('symbol', 'keyword')
+ ('string', 'expand'))
+ (func
+ ('symbol', 'keyword')
+ ('string', 'merge'))))))
$ testlog --only-merges
[]
(group
@@ -1520,17 +1523,19 @@ glog always reorders nodes which explain
(not
(group
(or
- ('string', '31')
- (func
- ('symbol', 'ancestors')
- ('string', '31')))))
+ (list
+ ('string', '31')
+ (func
+ ('symbol', 'ancestors')
+ ('string', '31'))))))
(not
(group
(or
- ('string', '32')
- (func
- ('symbol', 'ancestors')
- ('string', '32'))))))))
+ (list
+ ('string', '32')
+ (func
+ ('symbol', 'ancestors')
+ ('string', '32')))))))))
Dedicated repo for --follow and paths filtering. The g is crafted to
have 2 filelog topological heads in a linear changeset graph.
@@ -1587,12 +1592,13 @@ have 2 filelog topological heads in a li
(group
(group
(or
- (func
- ('symbol', 'filelog')
- ('string', 'a'))
- (func
- ('symbol', 'filelog')
- ('string', 'b')))))
+ (list
+ (func
+ ('symbol', 'filelog')
+ ('string', 'a'))
+ (func
+ ('symbol', 'filelog')
+ ('string', 'b'))))))
Test falling back to slow path for non-existing files
@@ -1744,12 +1750,13 @@ Test --follow and multiple files
(group
(group
(or
- (func
- ('symbol', 'follow')
- ('string', 'g'))
- (func
- ('symbol', 'follow')
- ('string', 'e')))))
+ (list
+ (func
+ ('symbol', 'follow')
+ ('string', 'g'))
+ (func
+ ('symbol', 'follow')
+ ('string', 'e'))))))
$ cat log.nodes
nodetag 4
nodetag 3
diff --git a/tests/test-gpg.t b/tests/test-gpg.t
--- a/tests/test-gpg.t
+++ b/tests/test-gpg.t
@@ -7,8 +7,25 @@ Test the GPG extension
> gpg=
>
> [gpg]
- > cmd=gpg --no-permission-warning --no-secmem-warning --no-auto-check-trustdb --homedir "$TESTDIR/gpg"
+ > cmd=gpg --no-permission-warning --no-secmem-warning --no-auto-check-trustdb
> EOF
+ $ GNUPGHOME="$TESTTMP/gpg"; export GNUPGHOME
+ $ cp -R "$TESTDIR/gpg" "$GNUPGHOME"
+
+Start gpg-agent, which is required by GnuPG v2
+
+#if gpg21
+ $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \
+ > >> $DAEMON_PIDS
+#endif
+
+and migrate secret keys
+
+#if gpg2
+ $ gpg --no-permission-warning --no-secmem-warning --list-secret-keys \
+ > > /dev/null 2>&1
+#endif
+
$ hg init r
$ cd r
$ echo foo > foo
@@ -36,12 +53,4 @@ Test the GPG extension
e63c23eaa88a is signed by:
hgtest
-verify that this test has not modified the trustdb.gpg file back in
-the main hg working dir
- $ md5sum.py "$TESTDIR/gpg/trustdb.gpg"
- f6b9c78c65fa9536e7512bb2ceb338ae */gpg/trustdb.gpg (glob)
-
-don't leak any state to next test run
- $ rm -f "$TESTDIR/gpg/random_seed"
-
$ cd ..
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -179,6 +179,11 @@ Graft out of order, skipping a merge and
committing changelog
grafting 5:97f8bfe72746 "5"
searching for copies back to rev 1
+ unmatched files in other (from topological common ancestor):
+ c
+ all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'c' -> dst: 'b' *
+ checking for directory renames
resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
@@ -193,6 +198,11 @@ Graft out of order, skipping a merge and
scanning for duplicate grafts
grafting 4:9c233e8e184d "4"
searching for copies back to rev 1
+ unmatched files in other (from topological common ancestor):
+ c
+ all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+ src: 'c' -> dst: 'b' *
+ checking for directory renames
resolving manifests
branchmerge: True, force: True, partial: False
ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
@@ -253,7 +263,7 @@ Continue without resolve should fail:
$ hg graft -c
grafting 4:9c233e8e184d "4"
- abort: unresolved merge conflicts (see "hg help resolve")
+ abort: unresolved merge conflicts (see 'hg help resolve')
[255]
Fix up:
@@ -427,8 +437,8 @@ Graft with --log
$ hg graft 3 --log -u foo
grafting 3:4c60f11aa304 "3"
warning: can't find ancestor for 'c' copied from 'b'!
- $ hg log --template '{rev} {parents} {desc}\n' -r tip
- 14 1:5d205f8b35b6 3
+ $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
+ 14:0c921c65ef1e 1:5d205f8b35b6 3
(grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
Resolve conflicted graft
@@ -620,7 +630,7 @@ Test simple destination
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
- changeset: 14:f64defefacee
+ changeset: 14:0c921c65ef1e
parent: 1:5d205f8b35b6
user: foo
date: Thu Jan 01 00:00:00 1970 +0000
@@ -842,3 +852,431 @@ Graft to duplicate a commit twice
|/
o 0
+Graft from behind a move or rename
+==================================
+
+NOTE: This is affected by issue5343, and will need updating when it's fixed
+
+Possible cases during a regular graft (when ca is between cta and c2):
+
+name | c1<-cta | cta<->ca | ca->c2
+A.0 | | |
+A.1 | X | |
+A.2 | | X |
+A.3 | | | X
+A.4 | X | X |
+A.5 | X | | X
+A.6 | | X | X
+A.7 | X | X | X
+
+A.0 is trivial, and doesn't need copy tracking.
+For A.1, a forward rename is recorded in the c1 pass, to be followed later.
+In A.2, the rename is recorded in the c2 pass and followed backwards.
+A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
+In A.4, both passes of checkcopies record incomplete renames, which are
+then joined in mergecopies to record a rename to be followed.
+In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
+records an incomplete divergence. The incomplete rename is then joined to the
+appropriate side of the incomplete divergence, and the result is recorded as a
+divergence. The code doesn't distinguish at all between these two cases, since
+the end result of them is the same: an incomplete divergence joined with an
+incomplete rename into a divergence.
+Finally, A.6 records a divergence entirely in the c2 pass.
+
+A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
+A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
+A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
+incomplete divergence, which is in fact complete. This is handled later in
+mergecopies.
+A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
+a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
+the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
+case, a<-b<-c->a is treated the same as a<-b<-b->a).
+
+f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
+same name on both branches, then the rename is backed out on one branch, and
+the backout is grafted to the other branch. This creates a challenging rename
+sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
+source, respectively. Since rename detection will run on the c1 side for such a
+sequence (as for technical reasons, we split the c1 and c2 sides not at the
+graft CA, but rather at the topological CA), it will pick up a false rename,
+and cause a spurious merge conflict. This false rename is always exactly the
+reverse of the true rename that would be detected on the c2 side, so we can
+correct for it by detecting this condition and reversing as necessary.
+
+First, set up the repository with commits to be grafted
+
+ $ hg init ../graftmove
+ $ cd ../graftmove
+ $ echo c1a > f1a
+ $ echo c2a > f2a
+ $ echo c3a > f3a
+ $ echo c4a > f4a
+ $ echo c5a > f5a
+ $ hg ci -qAm A0
+ $ hg mv f1a f1b
+ $ hg mv f3a f3b
+ $ hg mv f5a f5b
+ $ hg ci -qAm B0
+ $ echo c1c > f1b
+ $ hg mv f2a f2c
+ $ hg mv f5b f5a
+ $ echo c5c > f5a
+ $ hg ci -qAm C0
+ $ hg mv f3b f3d
+ $ echo c4d > f4a
+ $ hg ci -qAm D0
+ $ hg log -G
+ @ changeset: 3:b69f5839d2d9
+ | tag: tip
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: D0
+ |
+ o changeset: 2:f58c7e2b28fa
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: C0
+ |
+ o changeset: 1:3d7bba921b5d
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: B0
+ |
+ o changeset: 0:11f7a1b56675
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: A0
+
+
+Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
+two renames actually converge to the same name (thus no actual divergence).
+
+ $ hg up -q 'desc("A0")'
+ $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
+ grafting 2:f58c7e2b28fa "C0"
+ merging f1a and f1b to f1a
+ merging f5a
+ warning: can't find ancestor for 'f5a' copied from 'f5b'!
+ $ hg status --change .
+ M f1a
+ M f5a
+ A f2c
+ R f2a
+ $ hg cat f1a
+ c1c
+ $ hg cat f1b
+ f1b: no such file in rev c9763722f9bd
+ [1]
+
+Test the cases A.0 (f4x) and A.6 (f3x)
+
+ $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
+ grafting 3:b69f5839d2d9 "D0"
+ note: possible conflict - f3b was renamed multiple times to:
+ f3d
+ f3a
+ warning: can't find ancestor for 'f3d' copied from 'f3b'!
+
+Set up the repository for some further tests
+
+ $ hg up -q "min(desc("A0"))"
+ $ hg mv f1a f1e
+ $ echo c2e > f2a
+ $ hg mv f3a f3e
+ $ hg mv f4a f4e
+ $ hg mv f5a f5b
+ $ hg ci -qAm "E0"
+ $ hg log -G
+ @ changeset: 6:6bd1736cab86
+ | tag: tip
+ | parent: 0:11f7a1b56675
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: E0
+ |
+ | o changeset: 5:560daee679da
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: D1
+ | |
+ | o changeset: 4:c9763722f9bd
+ |/ parent: 0:11f7a1b56675
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: C1
+ |
+ | o changeset: 3:b69f5839d2d9
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: D0
+ | |
+ | o changeset: 2:f58c7e2b28fa
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: C0
+ | |
+ | o changeset: 1:3d7bba921b5d
+ |/ user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: B0
+ |
+ o changeset: 0:11f7a1b56675
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: A0
+
+
+Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
+and A.3 with a local content change to be preserved (f2x).
+
+ $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
+ grafting 2:f58c7e2b28fa "C0"
+ merging f1e and f1b to f1e
+ merging f2a and f2c to f2c
+ merging f5b and f5a to f5a
+
+Test the cases A.1 (f4x) and A.7 (f3x).
+
+ $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
+ grafting 3:b69f5839d2d9 "D0"
+ note: possible conflict - f3b was renamed multiple times to:
+ f3e
+ f3d
+ merging f4e and f4a to f4e
+ warning: can't find ancestor for 'f3d' copied from 'f3b'!
+
+Check the results of the grafts tested
+
+ $ hg log -CGv --patch --git
+ @ changeset: 8:93ee502e8b0a
+ | tag: tip
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | files: f3d f4e
+ | description:
+ | D2
+ |
+ |
+ | diff --git a/f3d b/f3d
+ | new file mode 100644
+ | --- /dev/null
+ | +++ b/f3d
+ | @@ -0,0 +1,1 @@
+ | +c3a
+ | diff --git a/f4e b/f4e
+ | --- a/f4e
+ | +++ b/f4e
+ | @@ -1,1 +1,1 @@
+ | -c4a
+ | +c4d
+ |
+ o changeset: 7:539cf145f496
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | files: f1e f2a f2c f5a f5b
+ | copies: f2c (f2a) f5a (f5b)
+ | description:
+ | C2
+ |
+ |
+ | diff --git a/f1e b/f1e
+ | --- a/f1e
+ | +++ b/f1e
+ | @@ -1,1 +1,1 @@
+ | -c1a
+ | +c1c
+ | diff --git a/f2a b/f2c
+ | rename from f2a
+ | rename to f2c
+ | diff --git a/f5b b/f5a
+ | rename from f5b
+ | rename to f5a
+ | --- a/f5b
+ | +++ b/f5a
+ | @@ -1,1 +1,1 @@
+ | -c5a
+ | +c5c
+ |
+ o changeset: 6:6bd1736cab86
+ | parent: 0:11f7a1b56675
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
+ | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
+ | description:
+ | E0
+ |
+ |
+ | diff --git a/f1a b/f1e
+ | rename from f1a
+ | rename to f1e
+ | diff --git a/f2a b/f2a
+ | --- a/f2a
+ | +++ b/f2a
+ | @@ -1,1 +1,1 @@
+ | -c2a
+ | +c2e
+ | diff --git a/f3a b/f3e
+ | rename from f3a
+ | rename to f3e
+ | diff --git a/f4a b/f4e
+ | rename from f4a
+ | rename to f4e
+ | diff --git a/f5a b/f5b
+ | rename from f5a
+ | rename to f5b
+ |
+ | o changeset: 5:560daee679da
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | files: f3d f4a
+ | | description:
+ | | D1
+ | |
+ | |
+ | | diff --git a/f3d b/f3d
+ | | new file mode 100644
+ | | --- /dev/null
+ | | +++ b/f3d
+ | | @@ -0,0 +1,1 @@
+ | | +c3a
+ | | diff --git a/f4a b/f4a
+ | | --- a/f4a
+ | | +++ b/f4a
+ | | @@ -1,1 +1,1 @@
+ | | -c4a
+ | | +c4d
+ | |
+ | o changeset: 4:c9763722f9bd
+ |/ parent: 0:11f7a1b56675
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | files: f1a f2a f2c f5a
+ | copies: f2c (f2a)
+ | description:
+ | C1
+ |
+ |
+ | diff --git a/f1a b/f1a
+ | --- a/f1a
+ | +++ b/f1a
+ | @@ -1,1 +1,1 @@
+ | -c1a
+ | +c1c
+ | diff --git a/f2a b/f2c
+ | rename from f2a
+ | rename to f2c
+ | diff --git a/f5a b/f5a
+ | --- a/f5a
+ | +++ b/f5a
+ | @@ -1,1 +1,1 @@
+ | -c5a
+ | +c5c
+ |
+ | o changeset: 3:b69f5839d2d9
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | files: f3b f3d f4a
+ | | copies: f3d (f3b)
+ | | description:
+ | | D0
+ | |
+ | |
+ | | diff --git a/f3b b/f3d
+ | | rename from f3b
+ | | rename to f3d
+ | | diff --git a/f4a b/f4a
+ | | --- a/f4a
+ | | +++ b/f4a
+ | | @@ -1,1 +1,1 @@
+ | | -c4a
+ | | +c4d
+ | |
+ | o changeset: 2:f58c7e2b28fa
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | files: f1b f2a f2c f5a f5b
+ | | copies: f2c (f2a) f5a (f5b)
+ | | description:
+ | | C0
+ | |
+ | |
+ | | diff --git a/f1b b/f1b
+ | | --- a/f1b
+ | | +++ b/f1b
+ | | @@ -1,1 +1,1 @@
+ | | -c1a
+ | | +c1c
+ | | diff --git a/f2a b/f2c
+ | | rename from f2a
+ | | rename to f2c
+ | | diff --git a/f5b b/f5a
+ | | rename from f5b
+ | | rename to f5a
+ | | --- a/f5b
+ | | +++ b/f5a
+ | | @@ -1,1 +1,1 @@
+ | | -c5a
+ | | +c5c
+ | |
+ | o changeset: 1:3d7bba921b5d
+ |/ user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | files: f1a f1b f3a f3b f5a f5b
+ | copies: f1b (f1a) f3b (f3a) f5b (f5a)
+ | description:
+ | B0
+ |
+ |
+ | diff --git a/f1a b/f1b
+ | rename from f1a
+ | rename to f1b
+ | diff --git a/f3a b/f3b
+ | rename from f3a
+ | rename to f3b
+ | diff --git a/f5a b/f5b
+ | rename from f5a
+ | rename to f5b
+ |
+ o changeset: 0:11f7a1b56675
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ files: f1a f2a f3a f4a f5a
+ description:
+ A0
+
+
+ diff --git a/f1a b/f1a
+ new file mode 100644
+ --- /dev/null
+ +++ b/f1a
+ @@ -0,0 +1,1 @@
+ +c1a
+ diff --git a/f2a b/f2a
+ new file mode 100644
+ --- /dev/null
+ +++ b/f2a
+ @@ -0,0 +1,1 @@
+ +c2a
+ diff --git a/f3a b/f3a
+ new file mode 100644
+ --- /dev/null
+ +++ b/f3a
+ @@ -0,0 +1,1 @@
+ +c3a
+ diff --git a/f4a b/f4a
+ new file mode 100644
+ --- /dev/null
+ +++ b/f4a
+ @@ -0,0 +1,1 @@
+ +c4a
+ diff --git a/f5a b/f5a
+ new file mode 100644
+ --- /dev/null
+ +++ b/f5a
+ @@ -0,0 +1,1 @@
+ +c5a
+
+ $ hg cat f2c
+ c2e
diff --git a/tests/test-grep.t b/tests/test-grep.t
--- a/tests/test-grep.t
+++ b/tests/test-grep.t
@@ -40,6 +40,61 @@ simple with color
\x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc)
\x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc)
+simple templated
+
+ $ hg grep port \
+ > -T '{file}:{rev}:{node|short}:{texts % "{if(matched, text|upper, text)}"}\n'
+ port:4:914fa752cdea:exPORT
+ port:4:914fa752cdea:vaPORTight
+ port:4:914fa752cdea:imPORT/exPORT
+
+simple JSON (no "change" field)
+
+ $ hg grep -Tjson port
+ [
+ {
+ "date": [4.0, 0],
+ "file": "port",
+ "line_number": 1,
+ "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
+ "rev": 4,
+ "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ },
+ {
+ "date": [4.0, 0],
+ "file": "port",
+ "line_number": 2,
+ "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
+ "rev": 4,
+ "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
+ "user": "spam"
+ },
+ {
+ "date": [4.0, 0],
+ "file": "port",
+ "line_number": 3,
+ "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
+ "rev": 4,
+ "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ }
+ ]
+
+simple JSON without matching lines
+
+ $ hg grep -Tjson -l port
+ [
+ {
+ "date": [4.0, 0],
+ "file": "port",
+ "line_number": 1,
+ "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
+ "rev": 4,
+ "user": "spam"
+ }
+ ]
+
all
$ hg grep --traceback --all -nu port port
@@ -53,6 +108,102 @@ all
port:1:2:+:eggs:export
port:0:1:+:spam:import
+all JSON
+
+ $ hg grep --all -Tjson port port
+ [
+ {
+ "change": "-",
+ "date": [4.0, 0],
+ "file": "port",
+ "line_number": 4,
+ "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c",
+ "rev": 4,
+ "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ },
+ {
+ "change": "+",
+ "date": [3.0, 0],
+ "file": "port",
+ "line_number": 4,
+ "node": "95040cfd017d658c536071c6290230a613c4c2a6",
+ "rev": 3,
+ "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
+ "user": "eggs"
+ },
+ {
+ "change": "-",
+ "date": [2.0, 0],
+ "file": "port",
+ "line_number": 1,
+ "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
+ "rev": 2,
+ "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ },
+ {
+ "change": "-",
+ "date": [2.0, 0],
+ "file": "port",
+ "line_number": 2,
+ "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
+ "rev": 2,
+ "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ },
+ {
+ "change": "+",
+ "date": [2.0, 0],
+ "file": "port",
+ "line_number": 1,
+ "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
+ "rev": 2,
+ "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ },
+ {
+ "change": "+",
+ "date": [2.0, 0],
+ "file": "port",
+ "line_number": 2,
+ "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
+ "rev": 2,
+ "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}],
+ "user": "spam"
+ },
+ {
+ "change": "+",
+ "date": [2.0, 0],
+ "file": "port",
+ "line_number": 3,
+ "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47",
+ "rev": 2,
+ "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ },
+ {
+ "change": "+",
+ "date": [1.0, 0],
+ "file": "port",
+ "line_number": 2,
+ "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587",
+ "rev": 1,
+ "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}],
+ "user": "eggs"
+ },
+ {
+ "change": "+",
+ "date": [0.0, 0],
+ "file": "port",
+ "line_number": 1,
+ "node": "f31323c9217050ba245ee8b537c713ec2e8ab226",
+ "rev": 0,
+ "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}],
+ "user": "spam"
+ }
+ ]
+
other
$ hg grep -l port port
@@ -111,6 +262,12 @@ follow
color:2:-:orange
color:1:+:orange
+test substring match: '^' should only match at the beginning
+
+ $ hg grep '^.' --config extensions.color= --color debug
+ [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lack
+ [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|o]range
+ [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lue
match in last "line" without newline
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -23,7 +23,7 @@ Short help:
summary summarize working directory state
update update working directory (or switch revisions)
- (use "hg help" for the full list of commands or "hg -v" for details)
+ (use 'hg help' for the full list of commands or 'hg -v' for details)
$ hg -q
add add the specified files on the next commit
@@ -123,7 +123,7 @@ Short help:
templating Template Usage
urls URL Paths
- (use "hg help -v" to show built-in aliases and global options)
+ (use 'hg help -v' to show built-in aliases and global options)
$ hg -q help
add add the specified files on the next commit
@@ -332,7 +332,7 @@ Test short command list with verbose opt
-h --help display help and exit
--hidden consider hidden changesets
- (use "hg help" for the full list of commands)
+ (use 'hg help' for the full list of commands)
$ hg add -h
hg add [OPTION]... [FILE]...
@@ -467,7 +467,7 @@ Test help option with version option
-S --subrepos recurse into subrepositories
-n --dry-run do not perform actions, just print output
- (use "hg add -h" to show more help)
+ (use 'hg add -h' to show more help)
[255]
Test ambiguous command help
@@ -478,7 +478,7 @@ Test ambiguous command help
add add the specified files on the next commit
addremove add all new files, delete all missing files
- (use "hg help -v ad" to show built-in aliases and global options)
+ (use 'hg help -v ad' to show built-in aliases and global options)
Test command without options
@@ -622,7 +622,7 @@ Test command without options
$ hg help foo
abort: no such help topic: foo
- (try "hg help --keyword foo")
+ (try 'hg help --keyword foo')
[255]
$ hg skjdfks
@@ -649,7 +649,7 @@ Test command without options
summary summarize working directory state
update update working directory (or switch revisions)
- (use "hg help" for the full list of commands or "hg -v" for details)
+ (use 'hg help' for the full list of commands or 'hg -v' for details)
[255]
@@ -842,7 +842,7 @@ Test that default list of commands omits
templating Template Usage
urls URL Paths
- (use "hg help -v" to show built-in aliases and global options)
+ (use 'hg help -v' to show built-in aliases and global options)
Test list of internal help commands
@@ -921,7 +921,7 @@ Test list of internal help commands
debugwireargs
(no help text available)
- (use "hg help -v debug" to show built-in aliases and global options)
+ (use 'hg help -v debug' to show built-in aliases and global options)
internals topic renders index of available sub-topics
@@ -929,16 +929,17 @@ internals topic renders index of availab
Technical implementation topics
"""""""""""""""""""""""""""""""
- bundles container for exchange of repository data
- changegroups representation of revlog data
- requirements repository requirements
- revlogs revision storage mechanism
+ bundles Bundles
+ changegroups Changegroups
+ requirements Repository Requirements
+ revlogs Revision Logs
+ wireprotocol Wire Protocol
sub-topics can be accessed
$ hg help internals.changegroups
- Changegroups
- ============
+ Changegroups
+ """"""""""""
Changegroups are representations of repository revlog data, specifically
the changelog, manifest, and filelogs.
@@ -974,7 +975,7 @@ sub-topics can be accessed
this an *empty chunk*.
Delta Groups
- ------------
+ ============
A *delta group* expresses the content of a revlog as a series of deltas,
or patches against previous revisions.
@@ -1050,21 +1051,21 @@ sub-topics can be accessed
which can result in smaller deltas and more efficient encoding of data.
Changeset Segment
- -----------------
+ =================
The *changeset segment* consists of a single *delta group* holding
changelog data. It is followed by an *empty chunk* to denote the boundary
to the *manifests segment*.
Manifest Segment
- ----------------
+ ================
The *manifest segment* consists of a single *delta group* holding manifest
data. It is followed by an *empty chunk* to denote the boundary to the
*filelogs segment*.
Filelogs Segment
- ----------------
+ ================
The *filelogs* segment consists of multiple sub-segments, each
corresponding to an individual file whose data is being described:
@@ -1103,7 +1104,7 @@ Test list of commands with command with
nohelp (no help text available)
- (use "hg help -v helpext" to show built-in aliases and global options)
+ (use 'hg help -v helpext' to show built-in aliases and global options)
test deprecated and experimental options are hidden in command help
@@ -1249,12 +1250,12 @@ Last item in help config.*:
$ hg help config.`hg help config|grep '^ "'| \
> tail -1|sed 's![ "]*!!g'`| \
- > grep "hg help -c config" > /dev/null
+ > grep 'hg help -c config' > /dev/null
[1]
note to use help -c for general hg help config:
- $ hg help config |grep "hg help -c config" > /dev/null
+ $ hg help config |grep 'hg help -c config' > /dev/null
Test templating help
@@ -1329,7 +1330,7 @@ Test -e / -c / -k combinations
Extension Commands:
$ hg help -c schemes
abort: no such help topic: schemes
- (try "hg help --keyword schemes")
+ (try 'hg help --keyword schemes')
[255]
$ hg help -e schemes |head -1
schemes extension - extend schemes with shortcuts to repository swarms
@@ -1344,7 +1345,7 @@ Test -e / -c / -k combinations
$ hg help -e -c commit > /dev/null
$ hg help -e commit > /dev/null
abort: no such help topic: commit
- (try "hg help --keyword commit")
+ (try 'hg help --keyword commit')
[255]
Test keyword search help
@@ -1386,14 +1387,14 @@ Test unfound topic
$ hg help nonexistingtopicthatwillneverexisteverever
abort: no such help topic: nonexistingtopicthatwillneverexisteverever
- (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
+ (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
[255]
Test unfound keyword
$ hg help --keyword nonexistingwordthatwillneverexisteverever
abort: no matches
- (try "hg help" for a list of topics)
+ (try 'hg help' for a list of topics)
[255]
Test omit indicating for help
@@ -1550,6 +1551,9 @@ Test section lookup
$ hg help template.files
files List of strings. All files modified, added, or removed by
this changeset.
+ files(pattern)
+ All files of the current changeset matching the pattern. See
+ 'hg help patterns'.
Test section lookup by translated message
@@ -1588,7 +1592,7 @@ such str.lower().
> subsequent section
> ------------------
>
- > This should be hidden at "hg help ambiguous" with section name.
+ > This should be hidden at 'hg help ambiguous' with section name.
> '''
> """ % (escape(upper), escape(lower)))
> EOF
@@ -1623,6 +1627,17 @@ such str.lower().
> ambiguous = !
> EOF
+Show help content of disabled extensions
+
+ $ cat >> $HGRCPATH <