{author|user}@{rev}
+ title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}
|
{linenumber}
@@ -129,7 +129,7 @@
{changesetlink}'
changesetparentdiff = '
parent {rev}
- {changesetlink} {ifeq(node, basenode, '(current diff)', \'({difffrom})\')}'
+ {changesetlink} {ifeq(node, basenode, '(current diff)', '({difffrom})')}'
difffrom = 'diff'
filerevbranch = 'branch{name|escape}'
filerevparent = '
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/monoblue/shortlog.tmpl
--- a/mercurial/templates/monoblue/shortlog.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/monoblue/shortlog.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -26,8 +26,8 @@
bookmarks
branches
files
- {archives%archiveentry}
- help
+ {archives%archiveentry}
+ help
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/monoblue/summary.tmpl
--- a/mercurial/templates/monoblue/summary.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/monoblue/summary.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -26,7 +26,7 @@
bookmarks
branches
files
- help
+ help
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/monoblue/tags.tmpl
--- a/mercurial/templates/monoblue/tags.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/monoblue/tags.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -26,7 +26,7 @@
bookmarks
branches
files
- help
+ help
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/bookmarks.tmpl
--- a/mercurial/templates/paper/bookmarks.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/bookmarks.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -23,7 +23,6 @@
-
@@ -42,10 +41,12 @@
+
bookmark |
node |
+
{entries%bookmarkentry}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/branches.tmpl
--- a/mercurial/templates/paper/branches.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/branches.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -23,7 +23,6 @@
-
@@ -42,10 +41,12 @@
+
branch |
node |
+
{entries % branchentry}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/changeset.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -48,7 +48,8 @@
date |
- {date|rfc822date} |
+ {date|rfc822date} |
+
parents |
{ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} |
@@ -68,8 +69,7 @@
[+]
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/fileannotate.tmpl
--- a/mercurial/templates/paper/fileannotate.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/fileannotate.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -68,10 +68,12 @@
+
rev |
line source |
+
{annotate%annotateline}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/filelog.tmpl
--- a/mercurial/templates/paper/filelog.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/filelog.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -35,7 +35,6 @@
-
+
age |
author |
description |
+
{entries%filelogentry}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/graph.tmpl
--- a/mercurial/templates/paper/graph.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/graph.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -28,7 +28,6 @@
-
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/index.tmpl
--- a/mercurial/templates/paper/index.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/index.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -12,6 +12,7 @@
Mercurial {pathdef%breadcrumb}
+
Name |
Description |
@@ -20,6 +21,7 @@
|
|
+
{entries%indexentry}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/manifest.tmpl
--- a/mercurial/templates/paper/manifest.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/manifest.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -39,11 +39,13 @@
+
name |
size |
permissions |
+
[up] |
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/search.tmpl
--- a/mercurial/templates/paper/search.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/search.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -43,11 +43,13 @@
+
age |
author |
description |
+
{entries}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/shortlog.tmpl
--- a/mercurial/templates/paper/shortlog.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/shortlog.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -30,7 +30,6 @@
-
+
age |
author |
description |
+
{entries%shortlogentry}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/paper/tags.tmpl
--- a/mercurial/templates/paper/tags.tmpl Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/paper/tags.tmpl Thu Apr 02 16:51:00 2015 -0500
@@ -23,7 +23,6 @@
-
@@ -42,10 +41,12 @@
+
tag |
node |
+
{entries%tagentry}
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/templates/static/style-paper.css Thu Apr 02 16:51:00 2015 -0500
@@ -60,6 +60,10 @@
border: 0;
}
+div.atom-logo {
+ margin-top: 10px;
+}
+
.atom-logo img{
width: 14px;
height: 14px;
@@ -104,6 +108,9 @@
.minusline { color: #dc143c; } /* crimson */
.atline { color: purple; }
+.diffstat-table {
+ margin-top: 1em;
+}
.diffstat-file {
white-space: nowrap;
font-size: 90%;
@@ -232,8 +239,9 @@
.sourcelines > span {
display: inline-block;
+ box-sizing: border-box;
width: 100%;
- padding: 1px 0px;
+ padding: 1px 0px 1px 5em;
counter-increment: lineno;
}
@@ -244,8 +252,8 @@
-ms-user-select: none;
user-select: none;
display: inline-block;
+ margin-left: -5em;
width: 4em;
- margin-right: 1em;
font-size: smaller;
color: #999;
text-align: right;
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/transaction.py
--- a/mercurial/transaction.py Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/transaction.py Thu Apr 02 16:51:00 2015 -0500
@@ -83,7 +83,7 @@
class transaction(object):
def __init__(self, report, opener, vfsmap, journalname, undoname=None,
- after=None, createmode=None):
+ after=None, createmode=None, validator=None):
"""Begin a new transaction
Begins a new transaction that allows rolling back writes in the event of
@@ -107,6 +107,12 @@
self.journal = journalname
self.undoname = undoname
self._queue = []
+ # A callback to validate transaction content before closing it.
+ # should raise exception is anything is wrong.
+ # target user is repository hooks.
+ if validator is None:
+ validator = lambda tr: None
+ self.validator = validator
# a dict of arguments to be passed to hooks
self.hookargs = {}
self.file = opener.open(self.journal, "w")
@@ -378,6 +384,7 @@
def close(self):
'''commit the transaction'''
if self.count == 1:
+ self.validator(self) # will raise exception if needed
self._generatefiles()
categories = sorted(self._finalizecallback)
for cat in categories:
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/ui.py
--- a/mercurial/ui.py Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/ui.py Thu Apr 02 16:51:00 2015 -0500
@@ -531,10 +531,14 @@
if util.hasscheme(loc) or os.path.isdir(os.path.join(loc, '.hg')):
return loc
- path = self.config('paths', loc)
- if not path and default is not None:
- path = self.config('paths', default)
- return path or loc
+ p = self.paths.getpath(loc, default=default)
+ if p:
+ return p.loc
+ return loc
+
+ @util.propertycache
+ def paths(self):
+ return paths(self)
def pushbuffer(self, error=False):
"""install a buffer to capture standard output of the ui object
@@ -923,3 +927,48 @@
ui.write(ui.label(s, 'label')).
'''
return msg
+
+class paths(dict):
+ """Represents a collection of paths and their configs.
+
+ Data is initially derived from ui instances and the config files they have
+ loaded.
+ """
+ def __init__(self, ui):
+ dict.__init__(self)
+
+ for name, loc in ui.configitems('paths'):
+ # No location is the same as not existing.
+ if not loc:
+ continue
+ self[name] = path(name, rawloc=loc)
+
+ def getpath(self, name, default=None):
+ """Return a ``path`` for the specified name, falling back to a default.
+
+ Returns the first of ``name`` or ``default`` that is present, or None
+ if neither is present.
+ """
+ try:
+ return self[name]
+ except KeyError:
+ if default is not None:
+ try:
+ return self[default]
+ except KeyError:
+ pass
+
+ return None
+
+class path(object):
+ """Represents an individual path and its configuration."""
+
+ def __init__(self, name, rawloc=None):
+ """Construct a path from its config options.
+
+ ``name`` is the symbolic name of the path.
+ ``rawloc`` is the raw location, as defined in the config.
+ """
+ self.name = name
+ # We'll do more intelligent things with rawloc in the future.
+ self.loc = rawloc
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/unionrepo.py
--- a/mercurial/unionrepo.py Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/unionrepo.py Thu Apr 02 16:51:00 2015 -0500
@@ -160,8 +160,11 @@
def baserevdiff(self, rev1, rev2):
return filelog.filelog.revdiff(self, rev1, rev2)
- def _file(self, f):
- self._repo.file(f)
+ def iscensored(self, rev):
+ """Check if a revision is censored."""
+ if rev <= self.repotiprev:
+ return filelog.filelog.iscensored(self, rev)
+ return self.revlog2.iscensored(rev)
class unionpeer(localrepo.localpeer):
def canpush(self):
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/util.h
--- a/mercurial/util.h Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/util.h Thu Apr 02 16:51:00 2015 -0500
@@ -172,6 +172,22 @@
(d[3]));
}
+static inline int16_t getbeint16(const char *c)
+{
+ const unsigned char *d = (const unsigned char *)c;
+
+ return ((d[0] << 8) |
+ (d[1]));
+}
+
+static inline uint16_t getbeuint16(const char *c)
+{
+ const unsigned char *d = (const unsigned char *)c;
+
+ return ((d[0] << 8) |
+ (d[1]));
+}
+
static inline void putbe32(uint32_t x, char *c)
{
c[0] = (x >> 24) & 0xff;
@@ -180,4 +196,27 @@
c[3] = (x) & 0xff;
}
+static inline double getbefloat64(const char *c)
+{
+ const unsigned char *d = (const unsigned char *)c;
+ double ret;
+ int i;
+ uint64_t t = 0;
+ for (i = 0; i < 8; i++) {
+ t = (t<<8) + d[i];
+ }
+ memcpy(&ret, &t, sizeof(t));
+ return ret;
+}
+
+#define MIN(a, b) (((a)<(b))?(a):(b))
+/* VC9 doesn't include bool and lacks stdbool.h based on my searching */
+#ifdef _MSC_VER
+#define true 1
+#define false 0
+typedef unsigned char bool;
+#else
+#include
+#endif
+
#endif /* _HG_UTIL_H_ */
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/util.py
--- a/mercurial/util.py Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/util.py Thu Apr 02 16:51:00 2015 -0500
@@ -359,8 +359,10 @@
def __iter__(self):
return self._list.__iter__()
def update(self, src):
- for k in src:
- self[k] = src[k]
+ if isinstance(src, dict):
+ src = src.iteritems()
+ for k, v in src:
+ self[k] = v
def clear(self):
dict.clear(self)
self._list = []
@@ -737,20 +739,27 @@
except shutil.Error, inst:
raise Abort(str(inst))
-def copyfiles(src, dst, hardlink=None):
- """Copy a directory tree using hardlinks if possible"""
+def copyfiles(src, dst, hardlink=None, progress=lambda t, pos: None):
+ """Copy a directory tree using hardlinks if possible."""
+ num = 0
if hardlink is None:
hardlink = (os.stat(src).st_dev ==
os.stat(os.path.dirname(dst)).st_dev)
+ if hardlink:
+ topic = _('linking')
+ else:
+ topic = _('copying')
- num = 0
if os.path.isdir(src):
os.mkdir(dst)
for name, kind in osutil.listdir(src):
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
- hardlink, n = copyfiles(srcname, dstname, hardlink)
+ def nprog(t, pos):
+ if pos is not None:
+ return progress(t, pos + num)
+ hardlink, n = copyfiles(srcname, dstname, hardlink, progress=nprog)
num += n
else:
if hardlink:
@@ -762,6 +771,8 @@
else:
shutil.copy(src, dst)
num += 1
+ progress(topic, num)
+ progress(topic, None)
return hardlink, num
@@ -1352,11 +1363,11 @@
formats = defaultdateformats
date = date.strip()
- if date == _('now'):
+ if date == 'now' or date == _('now'):
return makedate()
- if date == _('today'):
+ if date == 'today' or date == _('today'):
date = datetime.date.today().strftime('%b %d')
- elif date == _('yesterday'):
+ elif date == 'yesterday' or date == _('yesterday'):
date = (datetime.date.today() -
datetime.timedelta(days=1)).strftime('%b %d')
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/verify.py
--- a/mercurial/verify.py Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/verify.py Thu Apr 02 16:51:00 2015 -0500
@@ -169,7 +169,7 @@
for f, fn in mf.readdelta(n).iteritems():
if not f:
err(lr, _("file without name in manifest"))
- elif f != "/dev/null":
+ elif f != "/dev/null": # ignore this in very old repos
filenodes.setdefault(_normpath(f), {}).setdefault(fn, lr)
except Exception, inst:
exc(lr, _("reading manifest delta %s") % short(n), inst)
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/win32.py
--- a/mercurial/win32.py Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/win32.py Thu Apr 02 16:51:00 2015 -0500
@@ -279,7 +279,7 @@
buf = ctypes.create_string_buffer(size + 1)
len = _kernel32.GetModuleFileNameA(None, ctypes.byref(buf), size)
if len == 0:
- raise ctypes.WinError()
+ raise ctypes.WinError() # Note: WinError is a function
elif len == size:
raise ctypes.WinError(_ERROR_INSUFFICIENT_BUFFER)
return buf.value
diff -r e1842ef61edb -r d7cf8102bf09 mercurial/windows.py
--- a/mercurial/windows.py Thu Apr 02 21:29:05 2015 +0900
+++ b/mercurial/windows.py Thu Apr 02 16:51:00 2015 -0500
@@ -26,14 +26,22 @@
unlink = win32.unlink
umask = 0022
+_SEEK_END = 2 # os.SEEK_END was introduced in Python 2.5
-# wrap osutil.posixfile to provide friendlier exceptions
def posixfile(name, mode='r', buffering=-1):
+ '''Open a file with even more POSIX-like semantics'''
try:
- return osutil.posixfile(name, mode, buffering)
+ fp = osutil.posixfile(name, mode, buffering) # may raise WindowsError
+
+ # The position when opening in append mode is implementation defined, so
+ # make it consistent with other platforms, which position at EOF.
+ if 'a' in mode:
+ fp.seek(0, _SEEK_END)
+
+ return fp
except WindowsError, err:
+ # convert to a friendlier exception
raise IOError(err.errno, '%s: %s' % (name, err.strerror))
-posixfile.__doc__ = osutil.posixfile.__doc__
class winstdout(object):
'''stdout on windows misbehaves if sent through a pipe'''
diff -r e1842ef61edb -r d7cf8102bf09 setup.py
--- a/setup.py Thu Apr 02 21:29:05 2015 +0900
+++ b/setup.py Thu Apr 02 16:51:00 2015 -0500
@@ -63,6 +63,8 @@
raise SystemExit(
"Couldn't import standard bz2 (incomplete Python install).")
+ispypy = "PyPy" in sys.version
+
import os, stat, subprocess, time
import re
import shutil
@@ -276,7 +278,7 @@
class hgdist(Distribution):
- pure = 0
+ pure = ispypy
global_options = Distribution.global_options + \
[('pure', None, "use pure (slow) Python "
@@ -491,6 +493,7 @@
Extension('mercurial.mpatch', ['mercurial/mpatch.c'],
depends=common_depends),
Extension('mercurial.parsers', ['mercurial/dirs.c',
+ 'mercurial/manifest.c',
'mercurial/parsers.c',
'mercurial/pathencode.c'],
depends=common_depends),
@@ -555,7 +558,7 @@
if py2exeloaded:
extra['console'] = [
{'script':'hg',
- 'copyright':'Copyright (C) 2005-2010 Matt Mackall and others',
+ 'copyright':'Copyright (C) 2005-2015 Matt Mackall and others',
'product_version':version}]
# sub command of 'build' because 'py2exe' does not handle sub_commands
build.sub_commands.insert(0, ('build_hgextindex', None))
diff -r e1842ef61edb -r d7cf8102bf09 tests/get-with-headers.py
--- a/tests/get-with-headers.py Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/get-with-headers.py Thu Apr 02 16:51:00 2015 -0500
@@ -6,6 +6,14 @@
import httplib, sys
try:
+ import json
+except ImportError:
+ try:
+ import simplejson as json
+ except ImportError:
+ json = None
+
+try:
import msvcrt, os
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
@@ -20,6 +28,10 @@
if '--headeronly' in sys.argv:
sys.argv.remove('--headeronly')
headeronly = True
+formatjson = False
+if '--json' in sys.argv:
+ sys.argv.remove('--json')
+ formatjson = True
reasons = {'Not modified': 'Not Modified'} # python 2.4
@@ -44,7 +56,23 @@
if not headeronly:
print
data = response.read()
- sys.stdout.write(data)
+
+ # Pretty print JSON. This also has the beneficial side-effect
+ # of verifying emitted JSON is well-formed.
+ if formatjson:
+ if not json:
+ print 'no json module not available'
+ print 'did you forget a #require json?'
+ sys.exit(1)
+
+ # json.dumps() will print trailing newlines. Eliminate them
+ # to make tests easier to write.
+ data = json.loads(data)
+ lines = json.dumps(data, sort_keys=True, indent=2).splitlines()
+ for line in lines:
+ print line.rstrip()
+ else:
+ sys.stdout.write(data)
if twice and response.getheader('ETag', None):
tag = response.getheader('ETag')
diff -r e1842ef61edb -r d7cf8102bf09 tests/hghave.py
--- a/tests/hghave.py Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/hghave.py Thu Apr 02 16:51:00 2015 -0500
@@ -320,6 +320,11 @@
except ImportError:
return False
+@check("defaultcacerts", "can verify SSL certs by system's CA certs store")
+def has_defaultcacerts():
+ from mercurial import sslutil
+ return sslutil._defaultcacerts() != '!'
+
@check("windows", "Windows")
def has_windows():
return os.name == 'nt'
diff -r e1842ef61edb -r d7cf8102bf09 tests/run-tests.py
--- a/tests/run-tests.py Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/run-tests.py Thu Apr 02 16:51:00 2015 -0500
@@ -76,6 +76,8 @@
if sys.version_info < (2, 5):
subprocess._cleanup = lambda: None
+wifexited = getattr(os, "WIFEXITED", lambda x: False)
+
closefds = os.name == 'posix'
def Popen4(cmd, wd, timeout, env=None):
processlock.acquire()
@@ -170,6 +172,8 @@
help="shortcut for --with-hg=/../hg")
parser.add_option("--loop", action="store_true",
help="loop tests repeatedly")
+ parser.add_option("--runs-per-test", type="int", dest="runs_per_test",
+ help="run each test N times (default=1)", default=1)
parser.add_option("-n", "--nodiff", action="store_true",
help="skip showing test changes")
parser.add_option("-p", "--port", type="int",
@@ -258,6 +262,10 @@
parser.error("sorry, coverage options do not work when --local "
"is specified")
+ if options.anycoverage and options.with_hg:
+ parser.error("sorry, coverage options do not work when --with-hg "
+ "is specified")
+
global verbose
if options.verbose:
verbose = ''
@@ -459,7 +467,14 @@
# Remove any previous output files.
if os.path.exists(self.errpath):
- os.remove(self.errpath)
+ try:
+ os.remove(self.errpath)
+ except OSError, e:
+ # We might have raced another test to clean up a .err
+ # file, so ignore ENOENT when removing a previous .err
+ # file.
+ if e.errno != errno.ENOENT:
+ raise
def run(self, result):
"""Run this test and report results against a TestResult instance."""
@@ -528,14 +543,13 @@
This will return a tuple describing the result of the test.
"""
- replacements = self._getreplacements()
env = self._getenv()
self._daemonpids.append(env['DAEMON_PIDS'])
self._createhgrc(env['HGRCPATH'])
vlog('# Test', self.name)
- ret, out = self._run(replacements, env)
+ ret, out = self._run(env)
self._finished = True
self._ret = ret
self._out = out
@@ -608,7 +622,7 @@
vlog("# Ret was:", self._ret)
- def _run(self, replacements, env):
+ def _run(self, env):
# This should be implemented in child classes to run tests.
raise SkipTest('unknown test type')
@@ -707,6 +721,55 @@
# Failed is denoted by AssertionError (by default at least).
raise AssertionError(msg)
+ def _runcommand(self, cmd, env, normalizenewlines=False):
+ """Run command in a sub-process, capturing the output (stdout and
+ stderr).
+
+ Return a tuple (exitcode, output). output is None in debug mode.
+ """
+ if self._debug:
+ proc = subprocess.Popen(cmd, shell=True, cwd=self._testtmp,
+ env=env)
+ ret = proc.wait()
+ return (ret, None)
+
+ proc = Popen4(cmd, self._testtmp, self._timeout, env)
+ def cleanup():
+ terminate(proc)
+ ret = proc.wait()
+ if ret == 0:
+ ret = signal.SIGTERM << 8
+ killdaemons(env['DAEMON_PIDS'])
+ return ret
+
+ output = ''
+ proc.tochild.close()
+
+ try:
+ output = proc.fromchild.read()
+ except KeyboardInterrupt:
+ vlog('# Handling keyboard interrupt')
+ cleanup()
+ raise
+
+ ret = proc.wait()
+ if wifexited(ret):
+ ret = os.WEXITSTATUS(ret)
+
+ if proc.timeout:
+ ret = 'timeout'
+
+ if ret:
+ killdaemons(env['DAEMON_PIDS'])
+
+ for s, r in self._getreplacements():
+ output = re.sub(s, r, output)
+
+ if normalizenewlines:
+ output = output.replace('\r\n', '\n')
+
+ return ret, output.splitlines(True)
+
class PythonTest(Test):
"""A Python-based test."""
@@ -714,14 +777,13 @@
def refpath(self):
return os.path.join(self._testdir, '%s.out' % self.name)
- def _run(self, replacements, env):
+ def _run(self, env):
py3kswitch = self._py3kwarnings and ' -3' or ''
cmd = '%s%s "%s"' % (PYTHON, py3kswitch, self.path)
vlog("# Running", cmd)
- if os.name == 'nt':
- replacements.append((r'\r\n', '\n'))
- result = run(cmd, self._testtmp, replacements, env,
- debug=self._debug, timeout=self._timeout)
+ normalizenewlines = os.name == 'nt'
+ result = self._runcommand(cmd, env,
+ normalizenewlines=normalizenewlines)
if self._aborted:
raise KeyboardInterrupt()
@@ -751,7 +813,7 @@
def refpath(self):
return os.path.join(self._testdir, self.name)
- def _run(self, replacements, env):
+ def _run(self, env):
f = open(self.path, 'rb')
lines = f.readlines()
f.close()
@@ -768,8 +830,7 @@
cmd = '%s "%s"' % (self._shell, fname)
vlog("# Running", cmd)
- exitcode, output = run(cmd, self._testtmp, replacements, env,
- debug=self._debug, timeout=self._timeout)
+ exitcode, output = self._runcommand(cmd, env)
if self._aborted:
raise KeyboardInterrupt()
@@ -1062,49 +1123,6 @@
def _stringescape(s):
return TTest.ESCAPESUB(TTest._escapef, s)
-
-wifexited = getattr(os, "WIFEXITED", lambda x: False)
-def run(cmd, wd, replacements, env, debug=False, timeout=None):
- """Run command in a sub-process, capturing the output (stdout and stderr).
- Return a tuple (exitcode, output). output is None in debug mode."""
- if debug:
- proc = subprocess.Popen(cmd, shell=True, cwd=wd, env=env)
- ret = proc.wait()
- return (ret, None)
-
- proc = Popen4(cmd, wd, timeout, env)
- def cleanup():
- terminate(proc)
- ret = proc.wait()
- if ret == 0:
- ret = signal.SIGTERM << 8
- killdaemons(env['DAEMON_PIDS'])
- return ret
-
- output = ''
- proc.tochild.close()
-
- try:
- output = proc.fromchild.read()
- except KeyboardInterrupt:
- vlog('# Handling keyboard interrupt')
- cleanup()
- raise
-
- ret = proc.wait()
- if wifexited(ret):
- ret = os.WEXITSTATUS(ret)
-
- if proc.timeout:
- ret = 'timeout'
-
- if ret:
- killdaemons(env['DAEMON_PIDS'])
-
- for s, r in replacements:
- output = re.sub(s, r, output)
- return ret, output.splitlines(True)
-
iolock = threading.RLock()
class SkipTest(Exception):
@@ -1140,8 +1158,6 @@
self.warned = []
self.times = []
- self._started = {}
- self._stopped = {}
# Data stored for the benefit of generating xunit reports.
self.successes = []
self.faildata = {}
@@ -1263,21 +1279,18 @@
# child's processes along with real elapsed time taken by a process.
# This module has one limitation. It can only work for Linux user
# and not for Windows.
- self._started[test.name] = os.times()
+ test.started = os.times()
def stopTest(self, test, interrupted=False):
super(TestResult, self).stopTest(test)
- self._stopped[test.name] = os.times()
+ test.stopped = os.times()
- starttime = self._started[test.name]
- endtime = self._stopped[test.name]
+ starttime = test.started
+ endtime = test.stopped
self.times.append((test.name, endtime[2] - starttime[2],
endtime[3] - starttime[3], endtime[4] - starttime[4]))
- del self._started[test.name]
- del self._stopped[test.name]
-
if interrupted:
iolock.acquire()
self.stream.writeln('INTERRUPTED: %s (after %d seconds)' % (
@@ -1288,7 +1301,8 @@
"""Custom unittest TestSuite that knows how to execute Mercurial tests."""
def __init__(self, testdir, jobs=1, whitelist=None, blacklist=None,
- retest=False, keywords=None, loop=False,
+ retest=False, keywords=None, loop=False, runs_per_test=1,
+ loadtest=None,
*args, **kwargs):
"""Create a new instance that can run tests with a configuration.
@@ -1323,13 +1337,21 @@
self._retest = retest
self._keywords = keywords
self._loop = loop
+ self._runs_per_test = runs_per_test
+ self._loadtest = loadtest
def run(self, result):
# We have a number of filters that need to be applied. We do this
# here instead of inside Test because it makes the running logic for
# Test simpler.
tests = []
+ num_tests = [0]
for test in self._tests:
+ def get():
+ num_tests[0] += 1
+ if getattr(test, 'should_reload', False):
+ return self._loadtest(test.name, num_tests[0])
+ return test
if not os.path.exists(test.path):
result.addSkip(test, "Doesn't exist")
continue
@@ -1356,8 +1378,8 @@
if ignored:
continue
-
- tests.append(test)
+ for _ in xrange(self._runs_per_test):
+ tests.append(get())
runtests = list(tests)
done = queue.Queue()
@@ -1373,24 +1395,44 @@
done.put(('!', test, 'run-test raised an error, see traceback'))
raise
+ stoppedearly = False
+
try:
while tests or running:
if not done.empty() or running == self._jobs or not tests:
try:
done.get(True, 1)
+ running -= 1
if result and result.shouldStop:
+ stoppedearly = True
break
except queue.Empty:
continue
- running -= 1
if tests and not running == self._jobs:
test = tests.pop(0)
if self._loop:
- tests.append(test)
+ if getattr(test, 'should_reload', False):
+ num_tests[0] += 1
+ tests.append(
+ self._loadtest(test.name, num_tests[0]))
+ else:
+ tests.append(test)
t = threading.Thread(target=job, name=test.name,
args=(test, result))
t.start()
running += 1
+
+ # If we stop early we still need to wait on started tests to
+ # finish. Otherwise, there is a race between the test completing
+ # and the test's cleanup code running. This could result in the
+ # test reporting incorrect.
+ if stoppedearly:
+ while running:
+ try:
+ done.get(True, 1)
+ running -= 1
+ except queue.Empty:
+ continue
except KeyboardInterrupt:
for test in runtests:
test.abort()
@@ -1451,7 +1493,11 @@
t = doc.createElement('testcase')
t.setAttribute('name', tc)
t.setAttribute('time', '%.3f' % timesd[tc])
- cd = doc.createCDATASection(cdatasafe(err))
+ # createCDATASection expects a unicode or it will convert
+ # using default conversion rules, which will fail if
+ # string isn't ASCII.
+ err = cdatasafe(err).decode('utf-8', 'replace')
+ cd = doc.createCDATASection(err)
t.appendChild(cd)
s.appendChild(t)
xuf.write(doc.toprettyxml(indent=' ', encoding='utf-8'))
@@ -1545,6 +1591,7 @@
def __init__(self):
self.options = None
+ self._hgroot = None
self._testdir = None
self._hgtmp = None
self._installdir = None
@@ -1729,7 +1776,8 @@
retest=self.options.retest,
keywords=self.options.keywords,
loop=self.options.loop,
- tests=tests)
+ runs_per_test=self.options.runs_per_test,
+ tests=tests, loadtest=self._gettest)
verbosity = 1
if self.options.verbose:
verbosity = 2
@@ -1769,14 +1817,16 @@
refpath = os.path.join(self._testdir, test)
tmpdir = os.path.join(self._hgtmp, 'child%d' % count)
- return testcls(refpath, tmpdir,
- keeptmpdir=self.options.keep_tmpdir,
- debug=self.options.debug,
- timeout=self.options.timeout,
- startport=self.options.port + count * 3,
- extraconfigopts=self.options.extra_config_opt,
- py3kwarnings=self.options.py3k_warnings,
- shell=self.options.shell)
+ t = testcls(refpath, tmpdir,
+ keeptmpdir=self.options.keep_tmpdir,
+ debug=self.options.debug,
+ timeout=self.options.timeout,
+ startport=self.options.port + count * 3,
+ extraconfigopts=self.options.extra_config_opt,
+ py3kwarnings=self.options.py3k_warnings,
+ shell=self.options.shell)
+ t.should_reload = True
+ return t
def _cleanup(self):
"""Clean up state from this test invocation."""
@@ -1836,7 +1886,10 @@
compiler = ''
if self.options.compiler:
compiler = '--compiler ' + self.options.compiler
- pure = self.options.pure and "--pure" or ""
+ if self.options.pure:
+ pure = "--pure"
+ else:
+ pure = ""
py3 = ''
if sys.version_info[0] == 3:
py3 = '--c2to3'
@@ -1844,6 +1897,7 @@
# Run installer in hg root
script = os.path.realpath(sys.argv[0])
hgroot = os.path.dirname(os.path.dirname(script))
+ self._hgroot = hgroot
os.chdir(hgroot)
nohome = '--home=""'
if os.name == 'nt':
@@ -1863,6 +1917,17 @@
'prefix': self._installdir, 'libdir': self._pythondir,
'bindir': self._bindir,
'nohome': nohome, 'logfile': installerrs})
+
+ # setuptools requires install directories to exist.
+ def makedirs(p):
+ try:
+ os.makedirs(p)
+ except OSError, e:
+ if e.errno != errno.EEXIST:
+ raise
+ makedirs(self._pythondir)
+ makedirs(self._bindir)
+
vlog("# Running", cmd)
if os.system(cmd) == 0:
if not self.options.verbose:
@@ -1870,7 +1935,7 @@
else:
f = open(installerrs, 'rb')
for line in f:
- print line
+ sys.stdout.write(line)
f.close()
sys.exit(1)
os.chdir(self._testdir)
@@ -1912,8 +1977,14 @@
rc = os.path.join(self._testdir, '.coveragerc')
vlog('# Installing coverage rc to %s' % rc)
os.environ['COVERAGE_PROCESS_START'] = rc
- fn = os.path.join(self._installdir, '..', '.coverage')
- os.environ['COVERAGE_FILE'] = fn
+ covdir = os.path.join(self._installdir, '..', 'coverage')
+ try:
+ os.mkdir(covdir)
+ except OSError, e:
+ if e.errno != errno.EEXIST:
+ raise
+
+ os.environ['COVERAGE_DIR'] = covdir
def _checkhglib(self, verb):
"""Ensure that the 'mercurial' package imported by python is
@@ -1946,27 +2017,31 @@
def _outputcoverage(self):
"""Produce code coverage output."""
+ from coverage import coverage
+
vlog('# Producing coverage report')
- os.chdir(self._pythondir)
+ # chdir is the easiest way to get short, relative paths in the
+ # output.
+ os.chdir(self._hgroot)
+ covdir = os.path.join(self._installdir, '..', 'coverage')
+ cov = coverage(data_file=os.path.join(covdir, 'cov'))
- def covrun(*args):
- cmd = 'coverage %s' % ' '.join(args)
- vlog('# Running: %s' % cmd)
- os.system(cmd)
+ # Map install directory paths back to source directory.
+ cov.config.paths['srcdir'] = ['.', self._pythondir]
- covrun('-c')
- omit = ','.join(os.path.join(x, '*') for x in
- [self._bindir, self._testdir])
- covrun('-i', '-r', '"--omit=%s"' % omit) # report
+ cov.combine()
+
+ omit = [os.path.join(x, '*') for x in [self._bindir, self._testdir]]
+ cov.report(ignore_errors=True, omit=omit)
+
if self.options.htmlcov:
htmldir = os.path.join(self._testdir, 'htmlcov')
- covrun('-i', '-b', '"--directory=%s"' % htmldir,
- '"--omit=%s"' % omit)
+ cov.html_report(directory=htmldir, omit=omit)
if self.options.annotate:
adir = os.path.join(self._testdir, 'annotated')
if not os.path.isdir(adir):
os.mkdir(adir)
- covrun('-i', '-a', '"--directory=%s"' % adir, '"--omit=%s"' % omit)
+ cov.annotate(directory=adir, omit=omit)
def _findprogram(self, program):
"""Search PATH for a executable program"""
diff -r e1842ef61edb -r d7cf8102bf09 tests/seq.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/seq.py Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+#
+# A portable replacement for 'seq'
+#
+# Usage:
+# seq STOP [1, STOP] stepping by 1
+# seq START STOP [START, STOP] stepping by 1
+# seq START STEP STOP [START, STOP] stepping by STEP
+
+import sys
+
+start = 1
+if len(sys.argv) > 2:
+ start = int(sys.argv[1])
+
+step = 1
+if len(sys.argv) > 3:
+ step = int(sys.argv[2])
+
+stop = int(sys.argv[-1]) + 1
+
+for i in xrange(start, stop, step):
+ print i
diff -r e1842ef61edb -r d7cf8102bf09 tests/sitecustomize.py
--- a/tests/sitecustomize.py Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/sitecustomize.py Thu Apr 02 16:51:00 2015 -0500
@@ -1,5 +1,16 @@
-try:
- import coverage
- getattr(coverage, 'process_startup', lambda: None)()
-except ImportError:
- pass
+import os
+
+if os.environ.get('COVERAGE_PROCESS_START'):
+ try:
+ import coverage
+ import random
+
+ # uuid is better, but not available in Python 2.4.
+ covpath = os.path.join(os.environ['COVERAGE_DIR'],
+ 'cov.%s' % random.randrange(0, 1000000000000))
+ cov = coverage.coverage(data_file=covpath, auto_data=True)
+ cov._warn_no_data = False
+ cov._warn_unimported_source = False
+ cov.start()
+ except ImportError:
+ pass
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-addremove.t
--- a/tests/test-addremove.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-addremove.t Thu Apr 02 16:51:00 2015 -0500
@@ -30,12 +30,12 @@
adding foo
$ hg forget foo
#if windows
- $ hg -v addremove nonexistant
- nonexistant: The system cannot find the file specified
+ $ hg -v addremove nonexistent
+ nonexistent: The system cannot find the file specified
[1]
#else
- $ hg -v addremove nonexistant
- nonexistant: No such file or directory
+ $ hg -v addremove nonexistent
+ nonexistent: No such file or directory
[1]
#endif
$ cd ..
@@ -88,13 +88,13 @@
$ rm c
#if windows
- $ hg ci -A -m "c" nonexistant
- nonexistant: The system cannot find the file specified
+ $ hg ci -A -m "c" nonexistent
+ nonexistent: The system cannot find the file specified
abort: failed to mark all new/missing files as added/removed
[255]
#else
- $ hg ci -A -m "c" nonexistant
- nonexistant: No such file or directory
+ $ hg ci -A -m "c" nonexistent
+ nonexistent: No such file or directory
abort: failed to mark all new/missing files as added/removed
[255]
#endif
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-alias.t
--- a/tests/test-alias.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-alias.t Thu Apr 02 16:51:00 2015 -0500
@@ -360,9 +360,11 @@
sub
$ hg --cwd .. subalias > /dev/null
hg: unknown command 'subalias'
+ (did you mean one of idalias?)
[255]
$ hg -R .. subalias > /dev/null
hg: unknown command 'subalias'
+ (did you mean one of idalias?)
[255]
@@ -370,12 +372,18 @@
$ hg mainalias > /dev/null
hg: unknown command 'mainalias'
+ (did you mean one of idalias?)
[255]
$ hg -R .. mainalias
main
$ hg --cwd .. mainalias
main
+typos get useful suggestions
+ $ hg --cwd .. manalias
+ hg: unknown command 'manalias'
+ (did you mean one of idalias, mainalias, manifest?)
+ [255]
shell aliases with escaped $ chars
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-annotate.t
--- a/tests/test-annotate.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-annotate.t Thu Apr 02 16:51:00 2015 -0500
@@ -398,6 +398,88 @@
20: 4 baz:4
16: 5
+annotate clean file
+
+ $ hg annotate -ncr "wdir()" foo
+ 11 472b18db256d : foo
+
+annotate modified file
+
+ $ echo foofoo >> foo
+ $ hg annotate -r "wdir()" foo
+ 11 : foo
+ 20+: foofoo
+
+ $ hg annotate -cr "wdir()" foo
+ 472b18db256d : foo
+ b6bedd5477e7+: foofoo
+
+ $ hg annotate -ncr "wdir()" foo
+ 11 472b18db256d : foo
+ 20 b6bedd5477e7+: foofoo
+
+ $ hg annotate --debug -ncr "wdir()" foo
+ 11 472b18db256d1e8282064eab4bfdaf48cbfe83cd : foo
+ 20 b6bedd5477e797f25e568a6402d4697f3f895a72+: foofoo
+
+ $ hg annotate -udr "wdir()" foo
+ test Thu Jan 01 00:00:00 1970 +0000: foo
+ test [A-Za-z0-9:+ ]+: foofoo (re)
+
+ $ hg annotate -ncr "wdir()" -Tjson foo
+ [
+ {
+ "line": "foo\n",
+ "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd",
+ "rev": 11
+ },
+ {
+ "line": "foofoo\n",
+ "node": null,
+ "rev": null
+ }
+ ]
+
+annotate added file
+
+ $ echo bar > bar
+ $ hg add bar
+ $ hg annotate -ncr "wdir()" bar
+ 20 b6bedd5477e7+: bar
+
+annotate renamed file
+
+ $ hg rename foo renamefoo2
+ $ hg annotate -ncr "wdir()" renamefoo2
+ 11 472b18db256d : foo
+ 20 b6bedd5477e7+: foofoo
+
+annotate missing file
+
+ $ rm baz
+#if windows
+ $ hg annotate -ncr "wdir()" baz
+ abort: $TESTTMP\repo\baz: The system cannot find the file specified
+ [255]
+#else
+ $ hg annotate -ncr "wdir()" baz
+ abort: No such file or directory: $TESTTMP/repo/baz
+ [255]
+#endif
+
+annotate removed file
+
+ $ hg rm baz
+#if windows
+ $ hg annotate -ncr "wdir()" baz
+ abort: $TESTTMP\repo\baz: The system cannot find the file specified
+ [255]
+#else
+ $ hg annotate -ncr "wdir()" baz
+ abort: No such file or directory: $TESTTMP/repo/baz
+ [255]
+#endif
+
Test annotate with whitespace options
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-bookmarks-pushpull.t Thu Apr 02 16:51:00 2015 -0500
@@ -164,6 +164,40 @@
Z 2:0d2164f0ce0d
foo -1:000000000000
* foobar 1:9b140be10808
+
+(test that too many divergence of bookmark)
+
+ $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
+ $ hg pull ../a
+ pulling from ../a
+ searching for changes
+ no changes found
+ warning: failed to assign numbered name to divergent bookmark X
+ divergent bookmark @ stored as @1
+ $ hg bookmarks | grep '^ X' | grep -v ':000000000000'
+ X 1:9b140be10808
+ X@foo 2:0d2164f0ce0d
+
+(test that remotely diverged bookmarks are reused if they aren't changed)
+
+ $ hg bookmarks | grep '^ @'
+ @ 1:9b140be10808
+ @1 2:0d2164f0ce0d
+ @foo 2:0d2164f0ce0d
+ $ hg pull ../a
+ pulling from ../a
+ searching for changes
+ no changes found
+ warning: failed to assign numbered name to divergent bookmark X
+ divergent bookmark @ stored as @1
+ $ hg bookmarks | grep '^ @'
+ @ 1:9b140be10808
+ @1 2:0d2164f0ce0d
+ @foo 2:0d2164f0ce0d
+
+ $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
+ $ hg bookmarks -d "@1"
+
$ hg push -f ../a
pushing to ../a
searching for changes
@@ -460,6 +494,13 @@
$ hg -R ../b id -r W
cc978a373a53 tip W
+Check summary output for incoming/outgoing bookmarks
+
+ $ hg bookmarks -d X
+ $ hg bookmarks -d Y
+ $ hg summary --remote | grep '^remote:'
+ remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob)
+
$ cd ..
pushing an unchanged bookmark should result in no changes
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-branches.t
--- a/tests/test-branches.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-branches.t Thu Apr 02 16:51:00 2015 -0500
@@ -547,11 +547,22 @@
0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
0070: f8 94 c2 56 80 00 00 03 |...V....|
+
+#if unix-permissions no-root
+no errors when revbranchcache is not writable
+
+ $ echo >> .hg/cache/rbc-revs-v1
+ $ chmod a-w .hg/cache/rbc-revs-v1
+ $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n'
+ 5
+ $ chmod a+w .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
+ 5
truncating cache/rbc-revs-v1 to 120
- 5
$ f --size .hg/cache/rbc-revs*
.hg/cache/rbc-revs-v1: size=120
recovery from invalid cache file with partial last record
@@ -560,8 +571,8 @@
$ f --size .hg/cache/rbc-revs*
.hg/cache/rbc-revs-v1: size=119
$ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
+ 5
truncating cache/rbc-revs-v1 to 112
- 5
$ f --size .hg/cache/rbc-revs*
.hg/cache/rbc-revs-v1: size=120
recovery from invalid cache file with missing record - no truncation
@@ -579,11 +590,11 @@
$ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
$ f --size .hg/cache/rbc-revs*
.hg/cache/rbc-revs-v1: size=120
- $ hg log -r 'branch(.)' -T '{rev} '
- 3 4 8 9 10 11 12 13 (no-eol)
+ $ hg log -r 'branch(.)' -T '{rev} ' --debug
+ 3 4 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 8
$ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
- truncating cache/rbc-revs-v1 to 8
5
+ truncating cache/rbc-revs-v1 to 104
$ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
.hg/cache/rbc-revs-v1: size=120
0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-bundle-type.t
--- a/tests/test-bundle-type.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-bundle-type.t Thu Apr 02 16:51:00 2015 -0500
@@ -87,6 +87,7 @@
$ hg init tgarbage
$ cd tgarbage
$ hg pull ../bgarbage
+ pulling from ../bgarbage
abort: ../bgarbage: not a Mercurial bundle
[255]
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-bundle2-exchange.t
--- a/tests/test-bundle2-exchange.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-bundle2-exchange.t Thu Apr 02 16:51:00 2015 -0500
@@ -25,10 +25,9 @@
> [phases]
> publish=False
> [hooks]
- > changegroup = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" changegroup"
- > b2x-pretransactionclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
- > b2x-transactionclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
- > b2x-transactionclose.env = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" b2x-transactionclose"
+ > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
+ > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
+ > txnclose.env = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" txnclose"
> pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
> EOF
@@ -39,13 +38,19 @@
$ touch a
$ hg add a
$ hg commit -m 'a'
+ pre-close-tip:3903775176ed draft
+ postclose-tip:3903775176ed draft
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=commit
$ hg unbundle $TESTDIR/bundles/rebase.hg
adding changesets
adding manifests
adding file changes
added 8 changesets with 7 changes to 7 files (+3 heads)
- changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=unbundle HG_URL=bundle:*/rebase.hg (glob)
+ pre-close-tip:02de42196ebe draft
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNNAME=unbundle
+ bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ cd ..
@@ -56,11 +61,20 @@
Add more obsolescence information
$ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
+ pre-close-tip:02de42196ebe draft
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
$ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
+ pre-close-tip:02de42196ebe draft
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
clone --pull
$ hg -R main phase --public cd010b8cd998
+ pre-close-tip:000000000000 public
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
$ hg clone main other --pull --rev 9520eea781bc
adding changesets
adding manifests
@@ -69,8 +83,8 @@
1 new obsolescence markers
pre-close-tip:9520eea781bc draft
postclose-tip:9520eea781bc draft
- b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
- changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
+ file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R other log -G
@@ -84,6 +98,9 @@
pull
$ hg -R main phase --public 9520eea781bc
+ pre-close-tip:000000000000 public
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
$ hg -R other pull -r 24b6387c8c8c
pulling from $TESTTMP/main (glob)
searching for changes
@@ -94,8 +111,8 @@
1 new obsolescence markers
pre-close-tip:24b6387c8c8c draft
postclose-tip:24b6387c8c8c draft
- b2x-transactionclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
- changegroup hook: HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
+ file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg -R other log -G
o 2:24b6387c8c8c draft Nicolas Dumazet F
@@ -111,12 +128,16 @@
pull empty (with phase movement)
$ hg -R main phase --public 24b6387c8c8c
+ pre-close-tip:000000000000 public
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
$ hg -R other pull -r 24b6387c8c8c
pulling from $TESTTMP/main (glob)
no changes found
pre-close-tip:000000000000 public
postclose-tip:24b6387c8c8c public
- b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
+ txnclose hook: HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
+ file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
$ hg -R other log -G
o 2:24b6387c8c8c public Nicolas Dumazet F
|
@@ -135,7 +156,8 @@
no changes found
pre-close-tip:24b6387c8c8c public
postclose-tip:24b6387c8c8c public
- b2x-transactionclose hook: HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
+ txnclose hook: HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNNAME=pull
+ file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
$ hg -R other log -G
o 2:24b6387c8c8c public Nicolas Dumazet F
|
@@ -151,14 +173,29 @@
$ hg -R main bookmark --rev eea13746799a book_eea1
$ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
+ pre-close-tip:02de42196ebe draft
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
$ hg -R main bookmark --rev 02de42196ebe book_02de
$ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
+ pre-close-tip:02de42196ebe draft book_02de
+ postclose-tip:02de42196ebe draft book_02de
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
$ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
$ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
+ pre-close-tip:02de42196ebe draft book_02de
+ postclose-tip:02de42196ebe draft book_02de
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
$ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
$ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
+ pre-close-tip:02de42196ebe draft book_02de
+ postclose-tip:02de42196ebe draft book_02de
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
$ hg -R main bookmark --rev 32af7686d403 book_32af
$ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
+ pre-close-tip:02de42196ebe draft book_02de
+ postclose-tip:02de42196ebe draft book_02de
+ txnclose hook: HG_NEW_OBSMARKERS=1 HG_TXNNAME=debugobsolete
$ hg -R other bookmark --rev cd010b8cd998 book_eea1
$ hg -R other bookmark --rev cd010b8cd998 book_02de
@@ -167,6 +204,9 @@
$ hg -R other bookmark --rev cd010b8cd998 book_32af
$ hg -R main phase --public eea13746799a
+ pre-close-tip:000000000000 public
+ postclose-tip:02de42196ebe draft book_02de
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
push
$ hg -R main push other --rev eea13746799a --bookmark book_eea1
@@ -180,8 +220,7 @@
lock: free
wlock: free
postclose-tip:eea13746799a public book_eea1
- b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_URL=push
- changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_SOURCE=push HG_URL=push
+ txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNNAME=unbundle HG_URL=push
remote: adding changesets
remote: adding manifests
remote: adding file changes
@@ -190,7 +229,8 @@
updating bookmark book_eea1
pre-close-tip:02de42196ebe draft book_02de
postclose-tip:02de42196ebe draft book_02de
- b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=file:$TESTTMP/other
+ txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
+ file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob)
$ hg -R other log -G
o 3:eea13746799a public Nicolas Dumazet book_eea1 G
|\
@@ -218,8 +258,8 @@
updating bookmark book_02de
pre-close-tip:02de42196ebe draft book_02de
postclose-tip:02de42196ebe draft book_02de
- b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
- changegroup hook: HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
+ txnclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
+ ssh://user@dummy/main HG_URL=ssh://user@dummy/main
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg -R other debugobsolete
1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
@@ -243,8 +283,8 @@
updating bookmark book_42cc
pre-close-tip:42ccdea3bb16 draft book_42cc
postclose-tip:42ccdea3bb16 draft book_42cc
- b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
- changegroup hook: HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
+ txnclose hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNNAME=pull
+ http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/
(run 'hg heads .' to see heads, 'hg merge' to merge)
$ cat main-error.log
$ hg -R other debugobsolete
@@ -270,11 +310,11 @@
remote: lock: free
remote: wlock: free
remote: postclose-tip:5fddd98957c8 draft book_5fdd
- remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
- remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
+ remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNNAME=unbundle HG_URL=remote:ssh:127.0.0.1
pre-close-tip:02de42196ebe draft book_02de
postclose-tip:02de42196ebe draft book_02de
- b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=ssh://user@dummy/other
+ txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
+ ssh://user@dummy/other HG_URL=ssh://user@dummy/other
$ hg -R other log -G
o 6:5fddd98957c8 draft Nicolas Dumazet book_5fdd C
|
@@ -304,6 +344,9 @@
$ cat other.pid >> $DAEMON_PIDS
$ hg -R main phase --public 32af7686d403
+ pre-close-tip:000000000000 public
+ postclose-tip:02de42196ebe draft book_02de
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=phase
$ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
pushing to http://localhost:$HGPORT2/
searching for changes
@@ -315,7 +358,8 @@
updating bookmark book_32af
pre-close-tip:02de42196ebe draft book_02de
postclose-tip:02de42196ebe draft book_02de
- b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=http://localhost:$HGPORT2/
+ txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
+ http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
$ cat other-error.log
Check final content.
@@ -400,6 +444,9 @@
$ echo 'I' > I
$ hg add I
$ hg ci -m 'I'
+ pre-close-tip:e7ec4e813ba6 draft
+ postclose-tip:e7ec4e813ba6 draft
+ txnclose hook: HG_TXNNAME=commit
$ hg id
e7ec4e813ba6 tip
$ cd ..
@@ -501,7 +548,7 @@
> [failpush]
> reason =
> [hooks]
- > b2x-pretransactionclose.failpush = false
+ > pretxnclose.failpush = false
> EOF
$ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
@@ -514,13 +561,13 @@
pre-close-tip:e7ec4e813ba6 draft
transaction abort!
rollback completed
- abort: b2x-pretransactionclose.failpush hook exited with status 1
+ abort: pretxnclose.failpush hook exited with status 1
[255]
$ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
pushing to ssh://user@dummy/other
searching for changes
- abort: b2x-pretransactionclose.failpush hook exited with status 1
+ abort: pretxnclose.failpush hook exited with status 1
remote: pre-close-tip:e7ec4e813ba6 draft
remote: transaction abort!
remote: rollback completed
@@ -529,7 +576,7 @@
$ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
pushing to http://localhost:$HGPORT2/
searching for changes
- abort: b2x-pretransactionclose.failpush hook exited with status 1
+ abort: pretxnclose.failpush hook exited with status 1
[255]
(check that no 'pending' files remain)
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-cat.t
--- a/tests/test-cat.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-cat.t Thu Apr 02 16:51:00 2015 -0500
@@ -22,10 +22,22 @@
$ hg cat -r 1 b
1
-Test fileset
+Test multiple files
$ echo 3 > c
$ hg ci -Am addmore c
+ $ hg cat b c
+ 1
+ 3
+ $ hg cat .
+ 1
+ 3
+ $ hg cat . c
+ 1
+ 3
+
+Test fileset
+
$ hg cat 'set:not(b) or a'
3
$ hg cat 'set:c or b'
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-censor.t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-censor.t Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,480 @@
+ $ cat >> $HGRCPATH < [extensions]
+ > censor=
+ > EOF
+ $ cp $HGRCPATH $HGRCPATH.orig
+
+Create repo with unimpeachable content
+
+ $ hg init r
+ $ cd r
+ $ echo 'Initially untainted file' > target
+ $ echo 'Normal file here' > bystander
+ $ hg add target bystander
+ $ hg ci -m init
+
+Clone repo so we can test pull later
+
+ $ cd ..
+ $ hg clone r rpull
+ updating to branch default
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cd r
+
+Introduce content which will ultimately require censorship. Name the first
+censored node C1, second C2, and so on
+
+ $ echo 'Tainted file' > target
+ $ echo 'Passwords: hunter2' >> target
+ $ hg ci -m taint target
+ $ C1=`hg id --debug -i`
+
+ $ echo 'hunter3' >> target
+ $ echo 'Normal file v2' > bystander
+ $ hg ci -m moretaint target bystander
+ $ C2=`hg id --debug -i`
+
+Add a new sanitized versions to correct our mistake. Name the first head H1,
+the second head H2, and so on
+
+ $ echo 'Tainted file is now sanitized' > target
+ $ hg ci -m sanitized target
+ $ H1=`hg id --debug -i`
+
+ $ hg update -r $C2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo 'Tainted file now super sanitized' > target
+ $ hg ci -m 'super sanitized' target
+ created new head
+ $ H2=`hg id --debug -i`
+
+Verify target contents before censorship at each revision
+
+ $ hg cat -r $H1 target
+ Tainted file is now sanitized
+ $ hg cat -r $H2 target
+ Tainted file now super sanitized
+ $ hg cat -r $C2 target
+ Tainted file
+ Passwords: hunter2
+ hunter3
+ $ hg cat -r $C1 target
+ Tainted file
+ Passwords: hunter2
+ $ hg cat -r 0 target
+ Initially untainted file
+
+Try to censor revision with too large of a tombstone message
+
+ $ hg censor -r $C1 -t 'blah blah blah blah blah blah blah blah bla' target
+ abort: censor tombstone must be no longer than censored data
+ [255]
+
+Censor revision with 2 offenses
+
+ $ hg censor -r $C2 -t "remove password" target
+ $ hg cat -r $H1 target
+ Tainted file is now sanitized
+ $ hg cat -r $H2 target
+ Tainted file now super sanitized
+ $ hg cat -r $C2 target
+ abort: censored node: 1e0247a9a4b7
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg cat -r $C1 target
+ Tainted file
+ Passwords: hunter2
+ $ hg cat -r 0 target
+ Initially untainted file
+
+Censor revision with 1 offense
+
+ $ hg censor -r $C1 target
+ $ hg cat -r $H1 target
+ Tainted file is now sanitized
+ $ hg cat -r $H2 target
+ Tainted file now super sanitized
+ $ hg cat -r $C2 target
+ abort: censored node: 1e0247a9a4b7
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg cat -r $C1 target
+ abort: censored node: 613bc869fceb
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg cat -r 0 target
+ Initially untainted file
+
+Can only checkout target at uncensored revisions, -X is workaround for --all
+
+ $ hg revert -r $C2 target
+ abort: censored node: 1e0247a9a4b7
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg revert -r $C1 target
+ abort: censored node: 613bc869fceb
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg revert -r $C1 --all
+ reverting bystander
+ reverting target
+ abort: censored node: 613bc869fceb
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg revert -r $C1 --all -X target
+ $ cat target
+ Tainted file now super sanitized
+ $ hg revert -r 0 --all
+ reverting target
+ $ cat target
+ Initially untainted file
+ $ hg revert -r $H2 --all
+ reverting bystander
+ reverting target
+ $ cat target
+ Tainted file now super sanitized
+
+Uncensored file can be viewed at any revision
+
+ $ hg cat -r $H1 bystander
+ Normal file v2
+ $ hg cat -r $C2 bystander
+ Normal file v2
+ $ hg cat -r $C1 bystander
+ Normal file here
+ $ hg cat -r 0 bystander
+ Normal file here
+
+Can update to children of censored revision
+
+ $ hg update -r $H1
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Tainted file is now sanitized
+ $ hg update -r $H2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Tainted file now super sanitized
+
+Set censor policy to abort in trusted $HGRC so hg verify fails
+
+ $ cp $HGRCPATH.orig $HGRCPATH
+ $ cat >> $HGRCPATH < [censor]
+ > policy = abort
+ > EOF
+
+Repo fails verification due to censorship
+
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ target@1: censored file data
+ target@2: censored file data
+ 2 files, 5 changesets, 7 total revisions
+ 2 integrity errors encountered!
+ (first damaged changeset appears to be 1)
+ [1]
+
+Cannot update to revision with censored data
+
+ $ hg update -r $C2
+ abort: censored node: 1e0247a9a4b7
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg update -r $C1
+ abort: censored node: 613bc869fceb
+ (set censor.policy to ignore errors)
+ [255]
+ $ hg update -r 0
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg update -r $H2
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Set censor policy to ignore in trusted $HGRC so hg verify passes
+
+ $ cp $HGRCPATH.orig $HGRCPATH
+ $ cat >> $HGRCPATH < [censor]
+ > policy = ignore
+ > EOF
+
+Repo passes verification with warnings with explicit config
+
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 2 files, 5 changesets, 7 total revisions
+
+May update to revision with censored data with explicit config
+
+ $ hg update -r $C2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ $ hg update -r $C1
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ $ hg update -r 0
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Initially untainted file
+ $ hg update -r $H2
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Tainted file now super sanitized
+
+Can merge in revision with censored data. Test requires one branch of history
+with the file censored, but we can't censor at a head, so advance H1.
+
+ $ hg update -r $H1
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ C3=$H1
+ $ echo 'advanced head H1' > target
+ $ hg ci -m 'advance head H1' target
+ $ H1=`hg id --debug -i`
+ $ hg censor -r $C3 target
+ $ hg update -r $H2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg merge -r $C3
+ merging target
+ 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+Revisions present in repository heads may not be censored
+
+ $ hg update -C -r $H2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg censor -r $H2 target
+ abort: cannot censor file in heads (78a8fc215e79)
+ (clean/delete and commit first)
+ [255]
+ $ echo 'twiddling thumbs' > bystander
+ $ hg ci -m 'bystander commit'
+ $ H2=`hg id --debug -i`
+ $ hg censor -r "$H2^" target
+ abort: cannot censor file in heads (efbe78065929)
+ (clean/delete and commit first)
+ [255]
+
+Cannot censor working directory
+
+ $ echo 'seriously no passwords' > target
+ $ hg ci -m 'extend second head arbitrarily' target
+ $ H2=`hg id --debug -i`
+ $ hg update -r "$H2^"
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg censor -r . target
+ abort: cannot censor working directory
+ (clean/delete/update first)
+ [255]
+ $ hg update -r $H2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Can re-add file after being deleted + censored
+
+ $ C4=$H2
+ $ hg rm target
+ $ hg ci -m 'delete target so it may be censored'
+ $ H2=`hg id --debug -i`
+ $ hg censor -r $C4 target
+ $ hg cat -r $C4 target
+ $ hg cat -r "$H2^^" target
+ Tainted file now super sanitized
+ $ echo 'fresh start' > target
+ $ hg add target
+ $ hg ci -m reincarnated target
+ $ H2=`hg id --debug -i`
+ $ hg cat -r $H2 target
+ fresh start
+ $ hg cat -r "$H2^" target
+ target: no such file in rev 452ec1762369
+ [1]
+ $ hg cat -r $C4 target
+ $ hg cat -r "$H2^^^" target
+ Tainted file now super sanitized
+
+Can censor after revlog has expanded to no longer permit inline storage
+
+ $ for x in `python $TESTDIR/seq.py 0 50000`
+ > do
+ > echo "Password: hunter$x" >> target
+ > done
+ $ hg ci -m 'add 100k passwords'
+ $ H2=`hg id --debug -i`
+ $ C5=$H2
+ $ hg revert -r "$H2^" target
+ $ hg ci -m 'cleaned 100k passwords'
+ $ H2=`hg id --debug -i`
+ $ hg censor -r $C5 target
+ $ hg cat -r $C5 target
+ $ hg cat -r $H2 target
+ fresh start
+
+Repo with censored nodes can be cloned and cloned nodes are censored
+
+ $ cd ..
+ $ hg clone r rclone
+ updating to branch default
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cd rclone
+ $ hg cat -r $H1 target
+ advanced head H1
+ $ hg cat -r $H2~5 target
+ Tainted file now super sanitized
+ $ hg cat -r $C2 target
+ $ hg cat -r $C1 target
+ $ hg cat -r 0 target
+ Initially untainted file
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 2 files, 12 changesets, 13 total revisions
+
+Repo cloned before tainted content introduced can pull censored nodes
+
+ $ cd ../rpull
+ $ hg cat -r tip target
+ Initially untainted file
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 2 files, 1 changesets, 2 total revisions
+ $ hg pull -r $H1 -r $H2
+ pulling from $TESTTMP/r (glob)
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 11 changesets with 11 changes to 2 files (+1 heads)
+ (run 'hg heads' to see heads, 'hg merge' to merge)
+ $ hg update 4
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Tainted file now super sanitized
+ $ hg cat -r $H1 target
+ advanced head H1
+ $ hg cat -r $H2~5 target
+ Tainted file now super sanitized
+ $ hg cat -r $C2 target
+ $ hg cat -r $C1 target
+ $ hg cat -r 0 target
+ Initially untainted file
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 2 files, 12 changesets, 13 total revisions
+
+Censored nodes can be pushed if they censor previously unexchanged nodes
+
+ $ echo 'Passwords: hunter2hunter2' > target
+ $ hg ci -m 're-add password from clone' target
+ created new head
+ $ H3=`hg id --debug -i`
+ $ REV=$H3
+ $ echo 'Re-sanitized; nothing to see here' > target
+ $ hg ci -m 're-sanitized' target
+ $ H2=`hg id --debug -i`
+ $ CLEANREV=$H2
+ $ hg cat -r $REV target
+ Passwords: hunter2hunter2
+ $ hg censor -r $REV target
+ $ hg cat -r $REV target
+ $ hg cat -r $CLEANREV target
+ Re-sanitized; nothing to see here
+ $ hg push -f -r $H2
+ pushing to $TESTTMP/r (glob)
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 2 changesets with 2 changes to 1 files (+1 heads)
+
+ $ cd ../r
+ $ hg cat -r $REV target
+ $ hg cat -r $CLEANREV target
+ Re-sanitized; nothing to see here
+ $ hg update $CLEANREV
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Re-sanitized; nothing to see here
+
+Censored nodes can be bundled up and unbundled in another repo
+
+ $ hg bundle --base 0 ../pwbundle
+ 13 changesets found
+ $ cd ../rclone
+ $ hg unbundle ../pwbundle
+ adding changesets
+ adding manifests
+ adding file changes
+ added 2 changesets with 2 changes to 2 files (+1 heads)
+ (run 'hg heads .' to see heads, 'hg merge' to merge)
+ $ hg cat -r $REV target
+ $ hg cat -r $CLEANREV target
+ Re-sanitized; nothing to see here
+ $ hg update $CLEANREV
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Re-sanitized; nothing to see here
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 2 files, 14 changesets, 15 total revisions
+
+Censored nodes can be imported on top of censored nodes, consecutively
+
+ $ hg init ../rimport
+ $ hg bundle --base 1 ../rimport/splitbundle
+ 12 changesets found
+ $ cd ../rimport
+ $ hg pull -r $H1 -r $H2 ../r
+ pulling from ../r
+ adding changesets
+ adding manifests
+ adding file changes
+ added 8 changesets with 10 changes to 2 files (+1 heads)
+ (run 'hg heads' to see heads, 'hg merge' to merge)
+ $ hg unbundle splitbundle
+ adding changesets
+ adding manifests
+ adding file changes
+ added 6 changesets with 5 changes to 2 files (+1 heads)
+ (run 'hg heads .' to see heads, 'hg merge' to merge)
+ $ hg update $H2
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat target
+ Re-sanitized; nothing to see here
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 2 files, 14 changesets, 15 total revisions
+ $ cd ../r
+
+Can import bundle where first revision of a file is censored
+
+ $ hg init ../rinit
+ $ hg censor -r 0 target
+ $ hg bundle -r 0 --base null ../rinit/initbundle
+ 1 changesets found
+ $ cd ../rinit
+ $ hg unbundle initbundle
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 2 changes to 2 files
+ (run 'hg update' to get a working copy)
+ $ hg cat -r 0 target
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-children.t
--- a/tests/test-children.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-children.t Thu Apr 02 16:51:00 2015 -0500
@@ -122,4 +122,12 @@
summary: 2
+should be compatible with templater (don't pass fctx to displayer)
+ $ hg children file0 -Tdefault
+ changeset: 2:8f5eea5023c2
+ user: test
+ date: Thu Jan 01 00:00:02 1970 +0000
+ summary: 2
+
+
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-churn.t
--- a/tests/test-churn.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-churn.t Thu Apr 02 16:51:00 2015 -0500
@@ -171,4 +171,27 @@
El Ni\xc3\xb1o 1 *************** (esc)
with space 1 ***************
+Test --template argument, with backwards compatiblity
+
+ $ hg churn -t '{author|user}'
+ user1 4 ***************************************************************
+ user3 3 ***********************************************
+ user2 2 ********************************
+ nino 1 ****************
+ with 1 ****************
+ 0
+ user4 0
+ $ hg churn -T '{author|user}'
+ user1 4 ***************************************************************
+ user3 3 ***********************************************
+ user2 2 ********************************
+ nino 1 ****************
+ with 1 ****************
+ 0
+ user4 0
+ $ hg churn -t 'alltogether'
+ alltogether 11 *********************************************************
+ $ hg churn -T 'alltogether'
+ alltogether 11 *********************************************************
+
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-clone.t
--- a/tests/test-clone.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-clone.t Thu Apr 02 16:51:00 2015 -0500
@@ -65,6 +65,14 @@
#if hardlink
$ hg --debug clone -U . ../c
+ linking: 1
+ linking: 2
+ linking: 3
+ linking: 4
+ linking: 5
+ linking: 6
+ linking: 7
+ linking: 8
linked 8 files
#else
$ hg --debug clone -U . ../c
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-command-template.t
--- a/tests/test-command-template.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-command-template.t Thu Apr 02 16:51:00 2015 -0500
@@ -47,6 +47,9 @@
fourth (second)
$ hg log -T '{file_copies % "{source} -> {name}\n"}' -r .
second -> fourth
+ $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7
+ 8 t
+ 7 f
Quoting for ui.logtemplate
@@ -1868,6 +1871,16 @@
o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1
+Upper/lower filters:
+
+ $ hg log -r0 --template '{branch|upper}\n'
+ DEFAULT
+ $ hg log -r0 --template '{author|lower}\n'
+ user name
+ $ hg log -r0 --template '{date|upper}\n'
+ abort: template filter 'upper' is not compatible with keyword 'date'
+ [255]
+
Error on syntax:
$ echo 'x = "f' >> t
@@ -1905,6 +1918,11 @@
hg: parse error: unknown function 'foo'
[255]
+Pass generator object created by template function to filter
+
+ $ hg log -l 1 --template '{if(author, author)|user}\n'
+ test
+
Test diff function:
$ hg diff -c 8
@@ -2290,6 +2308,14 @@
$ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
no
+Test get function:
+
+ $ hg log -r 0 --template '{get(extras, "branch")}\n'
+ default
+ $ hg log -r 0 --template '{get(files, "should_fail")}\n'
+ hg: parse error: get() expects a dict as first argument
+ [255]
+
Test shortest(node) function:
$ echo b > b
@@ -2393,6 +2419,10 @@
2 bar foo
1 baz
0
+ $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n"
+ 2 t
+ 1 f
+ 0 f
Test stringify on sub expressions
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-commit-amend.t
--- a/tests/test-commit-amend.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-commit-amend.t Thu Apr 02 16:51:00 2015 -0500
@@ -1096,7 +1096,7 @@
$ hg ci -m add
$
$ hg debugrename newdirname/newfile.py
- newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
+ newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def (glob)
$ hg status -C --change .
A newdirname/newfile.py
$ hg status -C --rev 1
@@ -1115,7 +1115,7 @@
$ echo a >> newdirname/commonfile.py
$ hg ci --amend -m bug
$ hg debugrename newdirname/newfile.py
- newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
+ newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def (glob)
$ hg debugindex newdirname/newfile.py
rev offset length base linkrev nodeid p1 p2
0 0 88 0 3 34a4d536c0c0 000000000000 000000000000
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-commit-interactive-curses.t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-commit-interactive-curses.t Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,203 @@
+Set up a repo
+
+ $ cat <> $HGRCPATH
+ > [ui]
+ > interactive = true
+ > [experimental]
+ > crecord = true
+ > crecordtest = testModeCommands
+ > EOF
+
+ $ hg init a
+ $ cd a
+
+Committing some changes but stopping on the way
+
+ $ echo "a" > a
+ $ hg add a
+ $ cat <testModeCommands
+ > TOGGLE
+ > X
+ > EOF
+ $ hg commit -i -m "a" -d "0 0"
+ no changes to record
+ $ hg tip
+ changeset: -1:000000000000
+ tag: tip
+ user:
+ date: Thu Jan 01 00:00:00 1970 +0000
+
+
+Committing some changes
+
+ $ cat <testModeCommands
+ > X
+ > EOF
+ $ hg commit -i -m "a" -d "0 0"
+ $ hg tip
+ changeset: 0:cb9a9f314b8b
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: a
+
+Committing only one file
+
+ $ echo "a" >> a
+ >>> open('b', 'wb').write("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
+ $ hg add b
+ $ cat <testModeCommands
+ > TOGGLE
+ > KEY_DOWN
+ > X
+ > EOF
+ $ hg commit -i -m "one file" -d "0 0"
+ $ hg tip
+ changeset: 1:fb2705a663ea
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: one file
+
+ $ hg cat -r tip a
+ a
+ $ cat a
+ a
+ a
+
+Committing only one hunk
+
+- Untoggle all the hunks, go down to the second file
+- unfold it
+- go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
+- toggle the second hunk
+- commit
+
+ $ echo "x" > c
+ $ cat b >> c
+ $ echo "y" >> c
+ $ mv c b
+ $ cat <testModeCommands
+ > A
+ > KEY_DOWN
+ > f
+ > KEY_DOWN
+ > KEY_DOWN
+ > KEY_DOWN
+ > KEY_DOWN
+ > TOGGLE
+ > X
+ > EOF
+ $ hg commit -i -m "one hunk" -d "0 0"
+ $ hg tip
+ changeset: 2:7d10dfe755a8
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: one hunk
+
+ $ hg cat -r tip b
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ y
+ $ cat b
+ x
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ y
+ $ hg commit -m "other hunks"
+ $ hg tip
+ changeset: 3:a6735021574d
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: other hunks
+
+ $ hg cat -r tip b
+ x
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ y
+
+Editing patch of newly added file
+
+ $ cat > editor.sh << '__EOF__'
+ > cat "$1" | sed "s/first/very/g" > tt
+ > mv tt "$1"
+ > __EOF__
+ $ cat > newfile << '__EOF__'
+ > This is the first line
+ > This is the second line
+ > This is the third line
+ > __EOF__
+ $ hg add newfile
+ $ cat <testModeCommands
+ > f
+ > KEY_DOWN
+ > KEY_DOWN
+ > KEY_DOWN
+ > e
+ > X
+ > EOF
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new
+ $ hg tip
+ changeset: 4:6a0a43e9eff5
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:23 1970 +0000
+ summary: edit-patch-new
+
+ $ hg cat -r tip newfile
+ This is the very line
+ This is the second line
+ This is the third line
+
+ $ cat newfile
+ This is the first line
+ This is the second line
+ This is the third line
+
+Newly added files can be selected with the curses interface
+
+ $ hg update -C .
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo "hello" > x
+ $ hg add x
+ $ cat <testModeCommands
+ > TOGGLE
+ > TOGGLE
+ > X
+ > EOF
+ $ hg st
+ A x
+ ? editor.sh
+ ? testModeCommands
+ $ hg commit -i -m "newly added file" -d "0 0"
+ $ hg st
+ ? editor.sh
+ ? testModeCommands
+
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-commit-interactive.t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-commit-interactive.t Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,1434 @@
+Set up a repo
+
+ $ cat <> $HGRCPATH
+ > [ui]
+ > interactive = true
+ > [extensions]
+ > record =
+ > EOF
+
+ $ hg init a
+ $ cd a
+
+Select no files
+
+ $ touch empty-rw
+ $ hg add empty-rw
+
+ $ hg commit -i empty-rw< n
+ > EOF
+ diff --git a/empty-rw b/empty-rw
+ new file mode 100644
+ examine changes to 'empty-rw'? [Ynesfdaq?] n
+
+ no changes to record
+
+ $ hg tip -p
+ changeset: -1:000000000000
+ tag: tip
+ user:
+ date: Thu Jan 01 00:00:00 1970 +0000
+
+
+
+Select files but no hunks
+
+ $ hg commit -i empty-rw< y
+ > n
+ > EOF
+ diff --git a/empty-rw b/empty-rw
+ new file mode 100644
+ examine changes to 'empty-rw'? [Ynesfdaq?] y
+
+ abort: empty commit message
+ [255]
+
+ $ hg tip -p
+ changeset: -1:000000000000
+ tag: tip
+ user:
+ date: Thu Jan 01 00:00:00 1970 +0000
+
+
+
+Record empty file
+
+ $ hg commit -i -d '0 0' -m empty empty-rw< y
+ > y
+ > EOF
+ diff --git a/empty-rw b/empty-rw
+ new file mode 100644
+ examine changes to 'empty-rw'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 0:c0708cf4e46e
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: empty
+
+
+
+Summary shows we updated to the new cset
+
+ $ hg summary
+ parent: 0:c0708cf4e46e tip
+ empty
+ branch: default
+ commit: (clean)
+ update: (current)
+
+Rename empty file
+
+ $ hg mv empty-rw empty-rename
+ $ hg commit -i -d '1 0' -m rename< y
+ > EOF
+ diff --git a/empty-rw b/empty-rename
+ rename from empty-rw
+ rename to empty-rename
+ examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 1:d695e8dcb197
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: rename
+
+
+
+Copy empty file
+
+ $ hg cp empty-rename empty-copy
+ $ hg commit -i -d '2 0' -m copy< y
+ > EOF
+ diff --git a/empty-rename b/empty-copy
+ copy from empty-rename
+ copy to empty-copy
+ examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 2:1d4b90bea524
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:02 1970 +0000
+ summary: copy
+
+
+
+Delete empty file
+
+ $ hg rm empty-copy
+ $ hg commit -i -d '3 0' -m delete< y
+ > EOF
+ diff --git a/empty-copy b/empty-copy
+ deleted file mode 100644
+ examine changes to 'empty-copy'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 3:b39a238f01a1
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:03 1970 +0000
+ summary: delete
+
+
+
+Add binary file
+
+ $ hg bundle --base -2 tip.bundle
+ 1 changesets found
+ $ hg add tip.bundle
+ $ hg commit -i -d '4 0' -m binary< y
+ > EOF
+ diff --git a/tip.bundle b/tip.bundle
+ new file mode 100644
+ this is a binary file
+ examine changes to 'tip.bundle'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 4:ad816da3711e
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:04 1970 +0000
+ summary: binary
+
+ diff -r b39a238f01a1 -r ad816da3711e tip.bundle
+ Binary file tip.bundle has changed
+
+
+Change binary file
+
+ $ hg bundle --base -2 tip.bundle
+ 1 changesets found
+ $ hg commit -i -d '5 0' -m binary-change< y
+ > EOF
+ diff --git a/tip.bundle b/tip.bundle
+ this modifies a binary file (all or nothing)
+ examine changes to 'tip.bundle'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 5:dccd6f3eb485
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:05 1970 +0000
+ summary: binary-change
+
+ diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
+ Binary file tip.bundle has changed
+
+
+Rename and change binary file
+
+ $ hg mv tip.bundle top.bundle
+ $ hg bundle --base -2 top.bundle
+ 1 changesets found
+ $ hg commit -i -d '6 0' -m binary-change-rename< y
+ > EOF
+ diff --git a/tip.bundle b/top.bundle
+ rename from tip.bundle
+ rename to top.bundle
+ this modifies a binary file (all or nothing)
+ examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 6:7fa44105f5b3
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:06 1970 +0000
+ summary: binary-change-rename
+
+ diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
+ Binary file tip.bundle has changed
+ diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
+ Binary file top.bundle has changed
+
+
+Add plain file
+
+ $ for i in 1 2 3 4 5 6 7 8 9 10; do
+ > echo $i >> plain
+ > done
+
+ $ hg add plain
+ $ hg commit -i -d '7 0' -m plain plain< y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ new file mode 100644
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -0,0 +1,10 @@
+ +1
+ +2
+ +3
+ +4
+ +5
+ +6
+ +7
+ +8
+ +9
+ +10
+ record this change to 'plain'? [Ynesfdaq?] y
+
+ $ hg tip -p
+ changeset: 7:11fb457c1be4
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:07 1970 +0000
+ summary: plain
+
+ diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+ +++ b/plain Thu Jan 01 00:00:07 1970 +0000
+ @@ -0,0 +1,10 @@
+ +1
+ +2
+ +3
+ +4
+ +5
+ +6
+ +7
+ +8
+ +9
+ +10
+
+Modify end of plain file with username unset
+
+ $ echo 11 >> plain
+ $ unset HGUSER
+ $ hg commit -i --config ui.username= -d '8 0' -m end plain
+ abort: no username supplied
+ (use "hg config --edit" to set your username)
+ [255]
+
+
+Modify end of plain file, also test that diffopts are accounted for
+
+ $ HGUSER="test"
+ $ export HGUSER
+ $ hg commit -i --config diff.showfunc=true -d '8 0' -m end plain < y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 1 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -8,3 +8,4 @@ 7
+ 8
+ 9
+ 10
+ +11
+ record this change to 'plain'? [Ynesfdaq?] y
+
+
+Modify end of plain file, no EOL
+
+ $ hg tip --template '{node}' >> plain
+ $ hg commit -i -d '9 0' -m noeol plain < y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 1 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -9,3 +9,4 @@
+ 9
+ 10
+ 11
+ +7264f99c5f5ff3261504828afa4fb4d406c3af54
+ \ No newline at end of file
+ record this change to 'plain'? [Ynesfdaq?] y
+
+
+Modify end of plain file, add EOL
+
+ $ echo >> plain
+ $ echo 1 > plain2
+ $ hg add plain2
+ $ hg commit -i -d '10 0' -m eol plain plain2 < y
+ > y
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 1 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -9,4 +9,4 @@
+ 9
+ 10
+ 11
+ -7264f99c5f5ff3261504828afa4fb4d406c3af54
+ \ No newline at end of file
+ +7264f99c5f5ff3261504828afa4fb4d406c3af54
+ record change 1/2 to 'plain'? [Ynesfdaq?] y
+
+ diff --git a/plain2 b/plain2
+ new file mode 100644
+ examine changes to 'plain2'? [Ynesfdaq?] y
+
+ @@ -0,0 +1,1 @@
+ +1
+ record change 2/2 to 'plain2'? [Ynesfdaq?] y
+
+Modify beginning, trim end, record both, add another file to test
+changes numbering
+
+ $ rm plain
+ $ for i in 2 2 3 4 5 6 7 8 9 10; do
+ > echo $i >> plain
+ > done
+ $ echo 2 >> plain2
+
+ $ hg commit -i -d '10 0' -m begin-and-end plain plain2 < y
+ > y
+ > y
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 2 hunks, 3 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -1,4 +1,4 @@
+ -1
+ +2
+ 2
+ 3
+ 4
+ record change 1/3 to 'plain'? [Ynesfdaq?] y
+
+ @@ -8,5 +8,3 @@
+ 8
+ 9
+ 10
+ -11
+ -7264f99c5f5ff3261504828afa4fb4d406c3af54
+ record change 2/3 to 'plain'? [Ynesfdaq?] y
+
+ diff --git a/plain2 b/plain2
+ 1 hunks, 1 lines changed
+ examine changes to 'plain2'? [Ynesfdaq?] y
+
+ @@ -1,1 +1,2 @@
+ 1
+ +2
+ record change 3/3 to 'plain2'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 11:21df83db12b8
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:10 1970 +0000
+ summary: begin-and-end
+
+ diff -r ddb8b281c3ff -r 21df83db12b8 plain
+ --- a/plain Thu Jan 01 00:00:10 1970 +0000
+ +++ b/plain Thu Jan 01 00:00:10 1970 +0000
+ @@ -1,4 +1,4 @@
+ -1
+ +2
+ 2
+ 3
+ 4
+ @@ -8,5 +8,3 @@
+ 8
+ 9
+ 10
+ -11
+ -7264f99c5f5ff3261504828afa4fb4d406c3af54
+ diff -r ddb8b281c3ff -r 21df83db12b8 plain2
+ --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
+ +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
+ @@ -1,1 +1,2 @@
+ 1
+ +2
+
+
+Trim beginning, modify end
+
+ $ rm plain
+ > for i in 4 5 6 7 8 9 10.new; do
+ > echo $i >> plain
+ > done
+
+Record end
+
+ $ hg commit -i -d '11 0' -m end-only plain < y
+ > n
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 2 hunks, 4 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -1,9 +1,6 @@
+ -2
+ -2
+ -3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ record change 1/2 to 'plain'? [Ynesfdaq?] n
+
+ @@ -4,7 +1,7 @@
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ -10
+ +10.new
+ record change 2/2 to 'plain'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 12:99337501826f
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:11 1970 +0000
+ summary: end-only
+
+ diff -r 21df83db12b8 -r 99337501826f plain
+ --- a/plain Thu Jan 01 00:00:10 1970 +0000
+ +++ b/plain Thu Jan 01 00:00:11 1970 +0000
+ @@ -7,4 +7,4 @@
+ 7
+ 8
+ 9
+ -10
+ +10.new
+
+
+Record beginning
+
+ $ hg commit -i -d '12 0' -m begin-only plain < y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 3 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -1,6 +1,3 @@
+ -2
+ -2
+ -3
+ 4
+ 5
+ 6
+ record this change to 'plain'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 13:bbd45465d540
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:12 1970 +0000
+ summary: begin-only
+
+ diff -r 99337501826f -r bbd45465d540 plain
+ --- a/plain Thu Jan 01 00:00:11 1970 +0000
+ +++ b/plain Thu Jan 01 00:00:12 1970 +0000
+ @@ -1,6 +1,3 @@
+ -2
+ -2
+ -3
+ 4
+ 5
+ 6
+
+
+Add to beginning, trim from end
+
+ $ rm plain
+ $ for i in 1 2 3 4 5 6 7 8 9; do
+ > echo $i >> plain
+ > done
+
+Record end
+
+ $ hg commit -i --traceback -d '13 0' -m end-again plain< y
+ > n
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 2 hunks, 4 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -1,6 +1,9 @@
+ +1
+ +2
+ +3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ record change 1/2 to 'plain'? [Ynesfdaq?] n
+
+ @@ -1,7 +4,6 @@
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ -10.new
+ record change 2/2 to 'plain'? [Ynesfdaq?] y
+
+
+Add to beginning, middle, end
+
+ $ rm plain
+ $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
+ > echo $i >> plain
+ > done
+
+Record beginning, middle, and test that format-breaking diffopts are ignored
+
+ $ hg commit -i --config diff.noprefix=True -d '14 0' -m middle-only plain < y
+ > y
+ > y
+ > n
+ > EOF
+ diff --git a/plain b/plain
+ 3 hunks, 7 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -1,2 +1,5 @@
+ +1
+ +2
+ +3
+ 4
+ 5
+ record change 1/3 to 'plain'? [Ynesfdaq?] y
+
+ @@ -1,6 +4,8 @@
+ 4
+ 5
+ +5.new
+ +5.reallynew
+ 6
+ 7
+ 8
+ 9
+ record change 2/3 to 'plain'? [Ynesfdaq?] y
+
+ @@ -3,4 +8,6 @@
+ 6
+ 7
+ 8
+ 9
+ +10
+ +11
+ record change 3/3 to 'plain'? [Ynesfdaq?] n
+
+
+ $ hg tip -p
+ changeset: 15:f34a7937ec33
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:14 1970 +0000
+ summary: middle-only
+
+ diff -r 82c065d0b850 -r f34a7937ec33 plain
+ --- a/plain Thu Jan 01 00:00:13 1970 +0000
+ +++ b/plain Thu Jan 01 00:00:14 1970 +0000
+ @@ -1,5 +1,10 @@
+ +1
+ +2
+ +3
+ 4
+ 5
+ +5.new
+ +5.reallynew
+ 6
+ 7
+ 8
+
+
+Record end
+
+ $ hg commit -i -d '15 0' -m end-only plain < y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 2 lines changed
+ examine changes to 'plain'? [Ynesfdaq?] y
+
+ @@ -9,3 +9,5 @@
+ 7
+ 8
+ 9
+ +10
+ +11
+ record this change to 'plain'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 16:f9900b71a04c
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:15 1970 +0000
+ summary: end-only
+
+ diff -r f34a7937ec33 -r f9900b71a04c plain
+ --- a/plain Thu Jan 01 00:00:14 1970 +0000
+ +++ b/plain Thu Jan 01 00:00:15 1970 +0000
+ @@ -9,3 +9,5 @@
+ 7
+ 8
+ 9
+ +10
+ +11
+
+
+ $ mkdir subdir
+ $ cd subdir
+ $ echo a > a
+ $ hg ci -d '16 0' -Amsubdir
+ adding subdir/a
+
+ $ echo a >> a
+ $ hg commit -i -d '16 0' -m subdir-change a < y
+ > y
+ > EOF
+ diff --git a/subdir/a b/subdir/a
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/a'? [Ynesfdaq?] y
+
+ @@ -1,1 +1,2 @@
+ a
+ +a
+ record this change to 'subdir/a'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 18:61be427a9deb
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:16 1970 +0000
+ summary: subdir-change
+
+ diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
+ --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
+ +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
+ @@ -1,1 +1,2 @@
+ a
+ +a
+
+
+ $ echo a > f1
+ $ echo b > f2
+ $ hg add f1 f2
+
+ $ hg ci -mz -d '17 0'
+
+ $ echo a >> f1
+ $ echo b >> f2
+
+Help, quit
+
+ $ hg commit -i < ?
+ > q
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] ?
+
+ y - yes, record this change
+ n - no, skip this change
+ e - edit this change manually
+ s - skip remaining changes to this file
+ f - record remaining changes to this file
+ d - done, skip remaining changes and files
+ a - record all changes to all remaining files
+ q - quit, recording no changes
+ ? - ? (display help)
+ examine changes to 'subdir/f1'? [Ynesfdaq?] q
+
+ abort: user quit
+ [255]
+
+Skip
+
+ $ hg commit -i < s
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] s
+
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
+ [255]
+
+No
+
+ $ hg commit -i < n
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] n
+
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
+ [255]
+
+f, quit
+
+ $ hg commit -i < f
+ > q
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] f
+
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynesfdaq?] q
+
+ abort: user quit
+ [255]
+
+s, all
+
+ $ hg commit -i -d '18 0' -mx < s
+ > a
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] s
+
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynesfdaq?] a
+
+
+ $ hg tip -p
+ changeset: 20:b3df3dda369a
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:18 1970 +0000
+ summary: x
+
+ diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
+ --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
+ +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
+ @@ -1,1 +1,2 @@
+ b
+ +b
+
+
+f
+
+ $ hg commit -i -d '19 0' -my < f
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] f
+
+
+ $ hg tip -p
+ changeset: 21:38ec577f126b
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:19 1970 +0000
+ summary: y
+
+ diff -r b3df3dda369a -r 38ec577f126b subdir/f1
+ --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
+ +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
+ @@ -1,1 +1,2 @@
+ a
+ +a
+
+
+#if execbit
+
+Preserve chmod +x
+
+ $ chmod +x f1
+ $ echo a >> f1
+ $ hg commit -i -d '20 0' -mz < y
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ old mode 100644
+ new mode 100755
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -1,2 +1,3 @@
+ a
+ a
+ +a
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+
+ $ hg tip --config diff.git=True -p
+ changeset: 22:3261adceb075
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:20 1970 +0000
+ summary: z
+
+ diff --git a/subdir/f1 b/subdir/f1
+ old mode 100644
+ new mode 100755
+ --- a/subdir/f1
+ +++ b/subdir/f1
+ @@ -1,2 +1,3 @@
+ a
+ a
+ +a
+
+
+Preserve execute permission on original
+
+ $ echo b >> f1
+ $ hg commit -i -d '21 0' -maa < y
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -1,3 +1,4 @@
+ a
+ a
+ a
+ +b
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+
+ $ hg tip --config diff.git=True -p
+ changeset: 23:b429867550db
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:21 1970 +0000
+ summary: aa
+
+ diff --git a/subdir/f1 b/subdir/f1
+ --- a/subdir/f1
+ +++ b/subdir/f1
+ @@ -1,3 +1,4 @@
+ a
+ a
+ a
+ +b
+
+
+Preserve chmod -x
+
+ $ chmod -x f1
+ $ echo c >> f1
+ $ hg commit -i -d '22 0' -mab < y
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ old mode 100755
+ new mode 100644
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -2,3 +2,4 @@
+ a
+ a
+ b
+ +c
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+
+ $ hg tip --config diff.git=True -p
+ changeset: 24:0b082130c20a
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:22 1970 +0000
+ summary: ab
+
+ diff --git a/subdir/f1 b/subdir/f1
+ old mode 100755
+ new mode 100644
+ --- a/subdir/f1
+ +++ b/subdir/f1
+ @@ -2,3 +2,4 @@
+ a
+ a
+ b
+ +c
+
+
+#else
+
+Slightly bogus tests to get almost same repo structure as when x bit is used
+- but with different hashes.
+
+Mock "Preserve chmod +x"
+
+ $ echo a >> f1
+ $ hg commit -i -d '20 0' -mz < y
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -1,2 +1,3 @@
+ a
+ a
+ +a
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+
+ $ hg tip --config diff.git=True -p
+ changeset: 22:0d463bd428f5
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:20 1970 +0000
+ summary: z
+
+ diff --git a/subdir/f1 b/subdir/f1
+ --- a/subdir/f1
+ +++ b/subdir/f1
+ @@ -1,2 +1,3 @@
+ a
+ a
+ +a
+
+
+Mock "Preserve execute permission on original"
+
+ $ echo b >> f1
+ $ hg commit -i -d '21 0' -maa < y
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -1,3 +1,4 @@
+ a
+ a
+ a
+ +b
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+
+ $ hg tip --config diff.git=True -p
+ changeset: 23:0eab41a3e524
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:21 1970 +0000
+ summary: aa
+
+ diff --git a/subdir/f1 b/subdir/f1
+ --- a/subdir/f1
+ +++ b/subdir/f1
+ @@ -1,3 +1,4 @@
+ a
+ a
+ a
+ +b
+
+
+Mock "Preserve chmod -x"
+
+ $ chmod -x f1
+ $ echo c >> f1
+ $ hg commit -i -d '22 0' -mab < y
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -2,3 +2,4 @@
+ a
+ a
+ b
+ +c
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+
+ $ hg tip --config diff.git=True -p
+ changeset: 24:f4f718f27b7c
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:22 1970 +0000
+ summary: ab
+
+ diff --git a/subdir/f1 b/subdir/f1
+ --- a/subdir/f1
+ +++ b/subdir/f1
+ @@ -2,3 +2,4 @@
+ a
+ a
+ b
+ +c
+
+
+#endif
+
+ $ cd ..
+
+
+Abort early when a merge is in progress
+
+ $ hg up 4
+ 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
+
+ $ touch iwillmergethat
+ $ hg add iwillmergethat
+
+ $ hg branch thatbranch
+ marked working directory as branch thatbranch
+ (branches are permanent and global, did you want a bookmark?)
+
+ $ hg ci -m'new head'
+
+ $ hg up default
+ 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
+
+ $ hg merge thatbranch
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ hg commit -i -m'will abort'
+ abort: cannot partially commit a merge (use "hg commit" instead)
+ [255]
+
+ $ hg up -C
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+Editing patch (and ignoring trailing text)
+
+ $ cat > editor.sh << '__EOF__'
+ > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
+ > trailing\nditto' "$1" > tmp
+ > mv tmp "$1"
+ > __EOF__
+ $ cat > editedfile << '__EOF__'
+ > This is the first line
+ > This is the second line
+ > This is the third line
+ > __EOF__
+ $ hg add editedfile
+ $ hg commit -medit-patch-1
+ $ cat > editedfile << '__EOF__'
+ > This line has changed
+ > This change will be committed
+ > This is the third line
+ > __EOF__
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-2 < y
+ > e
+ > EOF
+ diff --git a/editedfile b/editedfile
+ 1 hunks, 2 lines changed
+ examine changes to 'editedfile'? [Ynesfdaq?] y
+
+ @@ -1,3 +1,3 @@
+ -This is the first line
+ -This is the second line
+ +This line has changed
+ +This change will be committed
+ This is the third line
+ record this change to 'editedfile'? [Ynesfdaq?] e
+
+ $ cat editedfile
+ This line has changed
+ This change will be committed
+ This is the third line
+ $ hg cat -r tip editedfile
+ This is the first line
+ This change will be committed
+ This is the third line
+ $ hg revert editedfile
+
+Trying to edit patch for whole file
+
+ $ echo "This is the fourth line" >> editedfile
+ $ hg commit -i < e
+ > q
+ > EOF
+ diff --git a/editedfile b/editedfile
+ 1 hunks, 1 lines changed
+ examine changes to 'editedfile'? [Ynesfdaq?] e
+
+ cannot edit patch for whole file
+ examine changes to 'editedfile'? [Ynesfdaq?] q
+
+ abort: user quit
+ [255]
+ $ hg revert editedfile
+
+Removing changes from patch
+
+ $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
+ $ mv tmp editedfile
+ $ echo "This line has been added" >> editedfile
+ $ cat > editor.sh << '__EOF__'
+ > sed -e 's/^[-+]/ /' "$1" > tmp
+ > mv tmp "$1"
+ > __EOF__
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y
+ > e
+ > EOF
+ diff --git a/editedfile b/editedfile
+ 1 hunks, 3 lines changed
+ examine changes to 'editedfile'? [Ynesfdaq?] y
+
+ @@ -1,3 +1,3 @@
+ -This is the first line
+ -This change will be committed
+ -This is the third line
+ +This change will not be committed
+ +This is the second line
+ +This line has been added
+ record this change to 'editedfile'? [Ynesfdaq?] e
+
+ no changes to record
+ $ cat editedfile
+ This change will not be committed
+ This is the second line
+ This line has been added
+ $ hg cat -r tip editedfile
+ This is the first line
+ This change will be committed
+ This is the third line
+ $ hg revert editedfile
+
+Invalid patch
+
+ $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
+ $ mv tmp editedfile
+ $ echo "This line has been added" >> editedfile
+ $ cat > editor.sh << '__EOF__'
+ > sed s/This/That/ "$1" > tmp
+ > mv tmp "$1"
+ > __EOF__
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y
+ > e
+ > EOF
+ diff --git a/editedfile b/editedfile
+ 1 hunks, 3 lines changed
+ examine changes to 'editedfile'? [Ynesfdaq?] y
+
+ @@ -1,3 +1,3 @@
+ -This is the first line
+ -This change will be committed
+ -This is the third line
+ +This change will not be committed
+ +This is the second line
+ +This line has been added
+ record this change to 'editedfile'? [Ynesfdaq?] e
+
+ patching file editedfile
+ Hunk #1 FAILED at 0
+ 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
+ abort: patch failed to apply
+ [255]
+ $ cat editedfile
+ This change will not be committed
+ This is the second line
+ This line has been added
+ $ hg cat -r tip editedfile
+ This is the first line
+ This change will be committed
+ This is the third line
+ $ cat editedfile.rej
+ --- editedfile
+ +++ editedfile
+ @@ -1,3 +1,3 @@
+ -That is the first line
+ -That change will be committed
+ -That is the third line
+ +That change will not be committed
+ +That is the second line
+ +That line has been added
+
+Malformed patch - error handling
+
+ $ cat > editor.sh << '__EOF__'
+ > sed -e '/^@/p' "$1" > tmp
+ > mv tmp "$1"
+ > __EOF__
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y
+ > e
+ > EOF
+ diff --git a/editedfile b/editedfile
+ 1 hunks, 3 lines changed
+ examine changes to 'editedfile'? [Ynesfdaq?] y
+
+ @@ -1,3 +1,3 @@
+ -This is the first line
+ -This change will be committed
+ -This is the third line
+ +This change will not be committed
+ +This is the second line
+ +This line has been added
+ record this change to 'editedfile'? [Ynesfdaq?] e
+
+ abort: error parsing patch: unhandled transition: range -> range
+ [255]
+
+random text in random positions is still an error
+
+ $ cat > editor.sh << '__EOF__'
+ > sed -e '/^@/i\
+ > other' "$1" > tmp
+ > mv tmp "$1"
+ > __EOF__
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y
+ > e
+ > EOF
+ diff --git a/editedfile b/editedfile
+ 1 hunks, 3 lines changed
+ examine changes to 'editedfile'? [Ynesfdaq?] y
+
+ @@ -1,3 +1,3 @@
+ -This is the first line
+ -This change will be committed
+ -This is the third line
+ +This change will not be committed
+ +This is the second line
+ +This line has been added
+ record this change to 'editedfile'? [Ynesfdaq?] e
+
+ abort: error parsing patch: unhandled transition: file -> other
+ [255]
+
+ $ hg up -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+With win32text
+
+ $ echo '[extensions]' >> .hg/hgrc
+ $ echo 'win32text = ' >> .hg/hgrc
+ $ echo '[decode]' >> .hg/hgrc
+ $ echo '** = cleverdecode:' >> .hg/hgrc
+ $ echo '[encode]' >> .hg/hgrc
+ $ echo '** = cleverencode:' >> .hg/hgrc
+ $ echo '[patch]' >> .hg/hgrc
+ $ echo 'eol = crlf' >> .hg/hgrc
+
+Ignore win32text deprecation warning for now:
+
+ $ echo '[win32text]' >> .hg/hgrc
+ $ echo 'warn = no' >> .hg/hgrc
+
+ $ echo d >> subdir/f1
+ $ hg commit -i -d '24 0' -mw1 < y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -3,3 +3,4 @@
+ a
+ b
+ c
+ +d
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+
+ $ hg tip -p
+ changeset: 28:* (glob)
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:24 1970 +0000
+ summary: w1
+
+ diff -r ???????????? -r ???????????? subdir/f1 (glob)
+ --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
+ +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
+ @@ -3,3 +3,4 @@
+ a
+ b
+ c
+ +d
+
+
+
+Test --user when ui.username not set
+ $ unset HGUSER
+ $ echo e >> subdir/f1
+ $ hg commit -i --config ui.username= -d '8 0' --user xyz -m "user flag" < y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynesfdaq?] y
+
+ @@ -4,3 +4,4 @@
+ b
+ c
+ d
+ +e
+ record this change to 'subdir/f1'? [Ynesfdaq?] y
+
+ $ hg log --template '{author}\n' -l 1
+ xyz
+ $ HGUSER="test"
+ $ export HGUSER
+
+
+Editing patch of newly added file
+
+ $ cat > editor.sh << '__EOF__'
+ > cat "$1" | sed "s/first/very/g" > tt
+ > mv tt "$1"
+ > __EOF__
+ $ cat > newfile << '__EOF__'
+ > This is the first line
+ > This is the second line
+ > This is the third line
+ > __EOF__
+ $ hg add newfile
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new < y
+ > e
+ > EOF
+ diff --git a/newfile b/newfile
+ new file mode 100644
+ examine changes to 'newfile'? [Ynesfdaq?] y
+
+ @@ -0,0 +1,3 @@
+ +This is the first line
+ +This is the second line
+ +This is the third line
+ record this change to 'newfile'? [Ynesfdaq?] e
+
+ $ hg cat -r tip newfile
+ This is the very line
+ This is the second line
+ This is the third line
+
+ $ cat newfile
+ This is the first line
+ This is the second line
+ This is the third line
+
+ $ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-completion.t
--- a/tests/test-completion.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-completion.t Thu Apr 02 16:51:00 2015 -0500
@@ -202,8 +202,8 @@
add: include, exclude, subrepos, dry-run
annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, ignore-all-space, ignore-space-change, ignore-blank-lines, include, exclude, template
clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure
- commit: addremove, close-branch, amend, secret, edit, include, exclude, message, logfile, date, user, subrepos
- diff: rev, change, text, git, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude, subrepos
+ commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
+ diff: rev, change, text, git, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, root, include, exclude, subrepos
export: output, switch-parent, rev, text, git, nodates
forget: include, exclude
init: ssh, remotecmd, insecure
@@ -262,13 +262,13 @@
debugsuccessorssets:
debugwalk: include, exclude
debugwireargs: three, four, five, ssh, remotecmd, insecure
- files: rev, print0, include, exclude, template
+ 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
heads: rev, topo, active, closed, style, template
help: extension, command, keyword
identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure
- import: strip, base, edit, force, no-commit, bypass, partial, exact, import-branch, message, logfile, date, user, similarity
+ import: strip, base, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
locate: rev, print0, fullpath, include, exclude
manifest: rev, all, template
@@ -278,8 +278,8 @@
phase: public, draft, secret, force, rev
recover:
rename: after, force, include, exclude, dry-run
- resolve: all, list, mark, unmark, no-status, tool, include, exclude
- revert: all, date, rev, no-backup, include, exclude, dry-run
+ resolve: all, list, mark, unmark, no-status, tool, include, exclude, template
+ revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
rollback: dry-run, force
root:
tag: force, local, rev, remove, edit, message, date, user
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-context.py
--- a/tests/test-context.py Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-context.py Thu Apr 02 16:51:00 2015 -0500
@@ -51,7 +51,7 @@
for d in ctxb.diff(ctxa, git=True):
print d
-# test safeness and correctness of "cxt.status()"
+# test safeness and correctness of "ctx.status()"
print '= checking context.status():'
# ancestor "wcctx ~ 2"
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-convert-cvs.t
--- a/tests/test-convert-cvs.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-convert-cvs.t Thu Apr 02 16:51:00 2015 -0500
@@ -397,11 +397,12 @@
Author: * (glob)
Branch: HEAD
Tag: (none)
+ Branchpoints: branch
Log:
ci1
Members:
- b/c:1.2->1.3
+ a:1.1->1.2
---------------------
PatchSet 6
@@ -409,12 +410,11 @@
Author: * (glob)
Branch: HEAD
Tag: (none)
- Branchpoints: branch
Log:
ci1
Members:
- a:1.1->1.2
+ b/c:1.2->1.3
---------------------
PatchSet 7
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-convert-datesort.t
--- a/tests/test-convert-datesort.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-convert-datesort.t Thu Apr 02 16:51:00 2015 -0500
@@ -85,9 +85,9 @@
$ hg -R t-datesort log -G --template '{rev} "{desc}"\n'
o 12 "c1"
|\
- | o 11 "b2x"
+ | _ 11 "b2x"
| |
- | | o 10 "a7x"
+ | | _ 10 "a7x"
| | |
o | | 9 "c0"
| | |
@@ -136,9 +136,9 @@
$ hg -R t-sourcesort log -G --template '{rev} "{desc}"\n'
o 12 "c1"
|\
- | o 11 "b2x"
+ | _ 11 "b2x"
| |
- | | o 10 "a7x"
+ | | _ 10 "a7x"
| | |
o | | 9 "c0"
| | |
@@ -189,11 +189,11 @@
|\
| o 11 "c0"
| |
- o | 10 "b2x"
+ _ | 10 "b2x"
| |
o | 9 "b1"
| |
- | | o 8 "a7x"
+ | | _ 8 "a7x"
| | |
| | o 7 "a6"
| | |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-convert-filemap.t
--- a/tests/test-convert-filemap.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-convert-filemap.t Thu Apr 02 16:51:00 2015 -0500
@@ -387,15 +387,15 @@
1 addb
0 closedefault
$ glog -R branchpruning-hg1
- o 5 "closedefault" files:
+ _ 5 "closedefault" files:
|
o 4 "addb" files: b
|
- | o 3 "closeempty" files:
+ | _ 3 "closeempty" files:
| |
| o 2 "emptybranch" files:
|/
- | o 1 "closefoo" files:
+ | _ 1 "closefoo" files:
|/
o 0 "adda" files: a
@@ -422,7 +422,7 @@
1 closeempty
0 closedefault
$ glog -R branchpruning-hg2
- o 1 "closedefault" files:
+ _ 1 "closedefault" files:
|
o 0 "addb" files: b
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-convert-git.t
--- a/tests/test-convert-git.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-convert-git.t Thu Apr 02 16:51:00 2015 -0500
@@ -170,7 +170,79 @@
full conversion
- $ hg -q convert --datesort git-repo2 fullrepo
+ $ hg convert --datesort git-repo2 fullrepo \
+ > --config extensions.progress= --config progress.assume-tty=1 \
+ > --config progress.delay=0 --config progress.changedelay=0 \
+ > --config progress.refresh=0 --config progress.width=60
+ \r (no-eol) (esc)
+ scanning [===> ] 1/9\r (no-eol) (esc)
+ scanning [========> ] 2/9\r (no-eol) (esc)
+ scanning [=============> ] 3/9\r (no-eol) (esc)
+ scanning [==================> ] 4/9\r (no-eol) (esc)
+ scanning [=======================> ] 5/9\r (no-eol) (esc)
+ scanning [============================> ] 6/9\r (no-eol) (esc)
+ scanning [=================================> ] 7/9\r (no-eol) (esc)
+ scanning [======================================> ] 8/9\r (no-eol) (esc)
+ scanning [===========================================>] 9/9\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [ ] 0/9\r (no-eol) (esc)
+ getting files [======================================>] 1/1\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [===> ] 1/9\r (no-eol) (esc)
+ getting files [======================================>] 1/1\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [========> ] 2/9\r (no-eol) (esc)
+ getting files [======================================>] 1/1\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [=============> ] 3/9\r (no-eol) (esc)
+ getting files [======================================>] 1/1\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [=================> ] 4/9\r (no-eol) (esc)
+ getting files [======================================>] 1/1\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [======================> ] 5/9\r (no-eol) (esc)
+ getting files [===> ] 1/8\r (no-eol) (esc)
+ getting files [========> ] 2/8\r (no-eol) (esc)
+ getting files [=============> ] 3/8\r (no-eol) (esc)
+ getting files [==================> ] 4/8\r (no-eol) (esc)
+ getting files [=======================> ] 5/8\r (no-eol) (esc)
+ getting files [============================> ] 6/8\r (no-eol) (esc)
+ getting files [=================================> ] 7/8\r (no-eol) (esc)
+ getting files [======================================>] 8/8\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [===========================> ] 6/9\r (no-eol) (esc)
+ getting files [======================================>] 1/1\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [===============================> ] 7/9\r (no-eol) (esc)
+ getting files [======================================>] 1/1\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ \r (no-eol) (esc)
+ converting [====================================> ] 8/9\r (no-eol) (esc)
+ getting files [==================> ] 1/2\r (no-eol) (esc)
+ getting files [======================================>] 2/2\r (no-eol) (esc)
+ \r (no-eol) (esc)
+ initializing destination fullrepo repository
+ scanning source...
+ sorting...
+ converting...
+ 8 add foo
+ 7 change foo
+ 6 add quux
+ 5 add bar
+ 4 add baz
+ 3 Octopus merge
+ 2 change bar
+ 1 change foo
+ 0 Discard change to foo
+ updating bookmarks
$ hg up -q -R fullrepo
$ glog -R fullrepo
@ 9 "Discard change to foo" files: foo
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-copy.t
--- a/tests/test-copy.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-copy.t Thu Apr 02 16:51:00 2015 -0500
@@ -138,7 +138,7 @@
moving a missing file
$ rm foo
$ hg mv foo foo3
- foo: deleted in working copy
+ foo: deleted in working directory
foo3 does not exist!
$ hg up -qC .
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-debugcommands.t
--- a/tests/test-debugcommands.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-debugcommands.t Thu Apr 02 16:51:00 2015 -0500
@@ -18,6 +18,7 @@
deltas : 0 ( 0.00%)
avg chain length : 0
+ max chain length : 0
compression ratio : 0
uncompressed data size (min/max/avg) : 43 / 43 / 43
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-devel-warnings.t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-devel-warnings.t Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,67 @@
+
+ $ cat << EOF > buggylocking.py
+ > """A small extension that acquire locks in the wrong order
+ > """
+ >
+ > from mercurial import cmdutil
+ >
+ > cmdtable = {}
+ > command = cmdutil.command(cmdtable)
+ >
+ > @command('buggylocking', [], '')
+ > def buggylocking(ui, repo):
+ > tr = repo.transaction('buggy')
+ > lo = repo.lock()
+ > wl = repo.wlock()
+ > wl.release()
+ > lo.release()
+ > EOF
+
+ $ cat << EOF >> $HGRCPATH
+ > [extensions]
+ > buggylocking=$TESTTMP/buggylocking.py
+ > [devel]
+ > all=1
+ > EOF
+
+ $ hg init lock-checker
+ $ cd lock-checker
+ $ hg buggylocking
+ transaction with no lock
+ "lock" taken before "wlock"
+ $ cat << EOF >> $HGRCPATH
+ > [devel]
+ > all=0
+ > check-locks=1
+ > EOF
+ $ hg buggylocking
+ transaction with no lock
+ "lock" taken before "wlock"
+ $ hg buggylocking --traceback
+ transaction with no lock
+ at:
+ */hg:* in * (glob)
+ */mercurial/dispatch.py:* in run (glob)
+ */mercurial/dispatch.py:* in dispatch (glob)
+ */mercurial/dispatch.py:* in _runcatch (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)
+ "lock" taken before "wlock"
+ at:
+ */hg:* in * (glob)
+ */mercurial/dispatch.py:* in run (glob)
+ */mercurial/dispatch.py:* in dispatch (glob)
+ */mercurial/dispatch.py:* in _runcatch (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)
+ $ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-diff-subdir.t
--- a/tests/test-diff-subdir.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-diff-subdir.t Thu Apr 02 16:51:00 2015 -0500
@@ -44,4 +44,24 @@
@@ -0,0 +1,1 @@
+2
+relative to beta
+
$ cd ..
+ $ hg diff --nodates --root beta
+ diff -r 7d5ef1aea329 two
+ --- a/two
+ +++ b/two
+ @@ -0,0 +1,1 @@
+ +2
+
+inside beta
+
+ $ cd beta
+ $ hg diff --nodates --root .
+ diff -r 7d5ef1aea329 two
+ --- a/two
+ +++ b/two
+ @@ -0,0 +1,1 @@
+ +2
+
+ $ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-diff-unified.t
--- a/tests/test-diff-unified.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-diff-unified.t Thu Apr 02 16:51:00 2015 -0500
@@ -286,4 +286,51 @@
-b
+a
+showfunc diff
+ $ cat > f1 << EOF
+ > int main() {
+ > int a = 0;
+ > int b = 1;
+ > int c = 2;
+ > int d = 3;
+ > return a + b + c + d;
+ > }
+ > EOF
+ $ hg commit -m addfunction
+ $ cat > f1 << EOF
+ > int main() {
+ > int a = 0;
+ > int b = 1;
+ > int c = 2;
+ > int e = 3;
+ > return a + b + c + e;
+ > }
+ > EOF
+ $ hg diff --git
+ diff --git a/f1 b/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;
+ }
+ $ hg diff --config diff.showfunc=True --git
+ diff --git a/f1 b/f1
+ --- a/f1
+ +++ b/f1
+ @@ -2,6 +2,6 @@ int main() {
+ 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 -r e1842ef61edb -r d7cf8102bf09 tests/test-diffstat.t
--- a/tests/test-diffstat.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-diffstat.t Thu Apr 02 16:51:00 2015 -0500
@@ -69,4 +69,39 @@
file with spaces | Bin
1 files changed, 0 insertions(+), 0 deletions(-)
+diffstat within directories:
+
+ $ hg rm -f 'file with spaces'
+
+ $ mkdir dir1 dir2
+ $ echo new1 > dir1/new
+ $ echo new2 > dir2/new
+ $ hg add dir1/new dir2/new
+ $ hg diff --stat
+ dir1/new | 1 +
+ dir2/new | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+ $ hg diff --stat --root dir1
+ new | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+ $ hg diff --stat --root dir1 dir2
+ warning: dir2 not inside relative root dir1
+
+ $ hg diff --stat --root dir1 -I dir1/old
+
+ $ cd dir1
+ $ hg diff --stat .
+ dir1/new | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+ $ hg diff --stat --root .
+ new | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+ $ hg diff --stat --root ../dir1 ../dir2
+ warning: ../dir2 not inside relative root . (glob)
+
+ $ hg diff --stat --root . -I old
+
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-doctest.py
--- a/tests/test-doctest.py Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-doctest.py Thu Apr 02 16:51:00 2015 -0500
@@ -19,6 +19,7 @@
testmod('mercurial.hgweb.hgwebdir_mod')
testmod('mercurial.match')
testmod('mercurial.minirst')
+testmod('mercurial.patch')
testmod('mercurial.pathutil')
testmod('mercurial.revset')
testmod('mercurial.store')
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-extension.t
--- a/tests/test-extension.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-extension.t Thu Apr 02 16:51:00 2015 -0500
@@ -946,6 +946,9 @@
Declare the version as supporting this hg version, show regular bts link:
$ hgver=`$PYTHON -c 'from mercurial import util; print util.version().split("+")[0]'`
$ echo 'testedwith = """'"$hgver"'"""' >> throw.py
+ $ if [ -z "$hgver" ]; then
+ > echo "unable to fetch a mercurial version. Make sure __version__ is correct";
+ > fi
$ rm -f throw.pyc throw.pyo
$ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
** unknown exception encountered, please report by visiting
@@ -1140,3 +1143,27 @@
C sub3/3
$ cd ..
+
+Test synopsis and docstring extending
+
+ $ hg init exthelp
+ $ cat > exthelp.py < from mercurial import commands, extensions
+ > def exbookmarks(orig, *args, **opts):
+ > return orig(*args, **opts)
+ > def uisetup(ui):
+ > synopsis = ' GREPME [--foo] [-x]'
+ > docstring = '''
+ > GREPME make sure that this is in the help!
+ > '''
+ > extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
+ > synopsis, docstring)
+ > EOF
+ $ abspath=`pwd`/exthelp.py
+ $ echo '[extensions]' >> $HGRCPATH
+ $ echo "exthelp = $abspath" >> $HGRCPATH
+ $ cd exthelp
+ $ hg help bookmarks | grep GREPME
+ hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x]
+ GREPME make sure that this is in the help!
+
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-fetch.t
--- a/tests/test-fetch.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-fetch.t Thu Apr 02 16:51:00 2015 -0500
@@ -339,7 +339,8 @@
marked working directory as branch topic
(branches are permanent and global, did you want a bookmark?)
$ hg -R n2 fetch -m merge n1
- abort: working dir not at branch tip (use "hg update" to check out branch tip)
+ abort: working directory not at branch tip
+ (use "hg update" to check out branch tip)
[255]
parent should be 0 (fetch did not update or merge anything)
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-fileset-generated.t
--- a/tests/test-fileset-generated.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-fileset-generated.t Thu Apr 02 16:51:00 2015 -0500
@@ -141,39 +141,34 @@
Test revert
-BROKEN: the files that get undeleted were not modified, they were removed,
-and content1_content2_missing-tracked was also not modified, it was deleted
-
$ hg revert 'set:modified()'
reverting content1_content1_content3-tracked
reverting content1_content2_content1-tracked
- undeleting content1_content2_content1-untracked
- undeleting content1_content2_content2-untracked
reverting content1_content2_content3-tracked
- undeleting content1_content2_content3-untracked
- reverting content1_content2_missing-tracked
- undeleting content1_content2_missing-untracked
reverting missing_content2_content3-tracked
-BROKEN: only the files that get forgotten are correct
-
$ hg revert 'set:added()'
forgetting content1_missing_content1-tracked
forgetting content1_missing_content3-tracked
- undeleting missing_content2_content2-untracked
- undeleting missing_content2_content3-untracked
- reverting missing_content2_missing-tracked
- undeleting missing_content2_missing-untracked
forgetting missing_missing_content3-tracked
$ hg revert 'set:removed()'
undeleting content1_content1_content1-untracked
undeleting content1_content1_content3-untracked
undeleting content1_content1_missing-untracked
+ undeleting content1_content2_content1-untracked
+ undeleting content1_content2_content2-untracked
+ undeleting content1_content2_content3-untracked
+ undeleting content1_content2_missing-untracked
+ undeleting missing_content2_content2-untracked
+ undeleting missing_content2_content3-untracked
+ undeleting missing_content2_missing-untracked
$ hg revert 'set:deleted()'
reverting content1_content1_missing-tracked
+ reverting content1_content2_missing-tracked
forgetting content1_missing_missing-tracked
+ reverting missing_content2_missing-tracked
forgetting missing_missing_missing-tracked
$ hg revert 'set:unknown()'
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-fileset.t
--- a/tests/test-fileset.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-fileset.t Thu Apr 02 16:51:00 2015 -0500
@@ -111,6 +111,13 @@
$ hg add b2link
#endif
+#if no-windows
+ $ echo foo > con.xml
+ $ fileset 'not portable()'
+ con.xml
+ $ hg --config ui.portablefilenames=ignore add con.xml
+#endif
+
>>> file('1k', 'wb').write(' '*1024)
>>> file('2k', 'wb').write(' '*2048)
$ hg add 1k 2k
@@ -220,6 +227,12 @@
b2link
#endif
+#if no-windows
+ $ fileset -r1 'not portable()'
+ con.xml
+ $ hg forget 'con.xml'
+#endif
+
$ fileset -r4 'subrepo("re:su.*")'
sub
$ fileset -r4 'subrepo("sub")'
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-gendoc.t
--- a/tests/test-gendoc.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-gendoc.t Thu Apr 02 16:51:00 2015 -0500
@@ -1,4 +1,5 @@
#require docutils
+#require gettext
Test document extraction
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-git-export.t
--- a/tests/test-git-export.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-git-export.t Thu Apr 02 16:51:00 2015 -0500
@@ -5,46 +5,279 @@
New file:
- $ echo new > new
+ $ mkdir dir1
+ $ echo new > dir1/new
$ hg ci -Amnew
- adding new
+ adding dir1/new
$ hg diff --git -r 0
- diff --git a/new b/new
+ diff --git a/dir1/new b/dir1/new
new file mode 100644
--- /dev/null
- +++ b/new
+ +++ b/dir1/new
@@ -0,0 +1,1 @@
+new
Copy:
- $ hg cp new copy
+ $ mkdir dir2
+ $ hg cp dir1/new dir1/copy
+ $ echo copy1 >> dir1/copy
+ $ hg cp dir1/new dir2/copy
+ $ echo copy2 >> dir2/copy
$ hg ci -mcopy
$ hg diff --git -r 1:tip
+ diff --git a/dir1/new b/dir1/copy
+ copy from dir1/new
+ copy to dir1/copy
+ --- a/dir1/new
+ +++ b/dir1/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+ diff --git a/dir1/new b/dir2/copy
+ copy from dir1/new
+ copy to dir2/copy
+ --- a/dir1/new
+ +++ b/dir2/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy2
+
+Cross and same-directory copies with a relative root:
+
+ $ hg diff --git --root .. -r 1:tip
+ abort: .. not under root '$TESTTMP'
+ [255]
+ $ hg diff --git --root doesnotexist -r 1:tip
+ $ hg diff --git --root . -r 1:tip
+ diff --git a/dir1/new b/dir1/copy
+ copy from dir1/new
+ copy to dir1/copy
+ --- a/dir1/new
+ +++ b/dir1/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+ diff --git a/dir1/new b/dir2/copy
+ copy from dir1/new
+ copy to dir2/copy
+ --- a/dir1/new
+ +++ b/dir2/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy2
+ $ hg diff --git --root dir1 -r 1:tip
+ diff --git a/new b/copy
+ copy from new
+ copy to copy
+ --- a/new
+ +++ b/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+
+ $ hg diff --git --root dir2/ -r 1:tip
+ diff --git a/copy b/copy
+ new file mode 100644
+ --- /dev/null
+ +++ b/copy
+ @@ -0,0 +1,2 @@
+ +new
+ +copy2
+
+ $ hg diff --git --root dir1 -r 1:tip -I '**/copy'
diff --git a/new b/copy
copy from new
copy to copy
+ --- a/new
+ +++ b/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+
+ $ hg diff --git --root dir1 -r 1:tip dir2
+ warning: dir2 not inside relative root dir1
+
+ $ hg diff --git --root dir1 -r 1:tip 'dir2/{copy}'
+ warning: dir2/{copy} not inside relative root dir1 (glob)
+
+ $ cd dir1
+ $ hg diff --git --root .. -r 1:tip
+ diff --git a/dir1/new b/dir1/copy
+ copy from dir1/new
+ copy to dir1/copy
+ --- a/dir1/new
+ +++ b/dir1/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+ diff --git a/dir1/new b/dir2/copy
+ copy from dir1/new
+ copy to dir2/copy
+ --- a/dir1/new
+ +++ b/dir2/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy2
+
+ $ hg diff --git --root ../.. -r 1:tip
+ abort: ../.. not under root '$TESTTMP'
+ [255]
+ $ hg diff --git --root ../doesnotexist -r 1:tip
+ $ hg diff --git --root .. -r 1:tip
+ diff --git a/dir1/new b/dir1/copy
+ copy from dir1/new
+ copy to dir1/copy
+ --- a/dir1/new
+ +++ b/dir1/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+ diff --git a/dir1/new b/dir2/copy
+ copy from dir1/new
+ copy to dir2/copy
+ --- a/dir1/new
+ +++ b/dir2/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy2
+
+ $ hg diff --git --root . -r 1:tip
+ diff --git a/new b/copy
+ copy from new
+ copy to copy
+ --- a/new
+ +++ b/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+ $ hg diff --git --root . -r 1:tip copy
+ diff --git a/new b/copy
+ copy from new
+ copy to copy
+ --- a/new
+ +++ b/copy
+ @@ -1,1 +1,2 @@
+ new
+ +copy1
+ $ hg diff --git --root . -r 1:tip ../dir2
+ warning: ../dir2 not inside relative root . (glob)
+ $ hg diff --git --root . -r 1:tip '../dir2/*'
+ warning: ../dir2/* not inside relative root . (glob)
+ $ cd ..
Rename:
- $ hg mv copy rename
+ $ hg mv dir1/copy dir1/rename1
+ $ echo rename1 >> dir1/rename1
+ $ hg mv dir2/copy dir1/rename2
+ $ echo rename2 >> dir1/rename2
$ hg ci -mrename
$ hg diff --git -r 2:tip
- diff --git a/copy b/rename
+ diff --git a/dir1/copy b/dir1/rename1
+ rename from dir1/copy
+ rename to dir1/rename1
+ --- a/dir1/copy
+ +++ b/dir1/rename1
+ @@ -1,2 +1,3 @@
+ new
+ copy1
+ +rename1
+ diff --git a/dir2/copy b/dir1/rename2
+ rename from dir2/copy
+ rename to dir1/rename2
+ --- a/dir2/copy
+ +++ b/dir1/rename2
+ @@ -1,2 +1,3 @@
+ new
+ copy2
+ +rename2
+
+Cross and same-directory renames with a relative root:
+
+ $ hg diff --root dir1 --git -r 2:tip
+ diff --git a/copy b/rename1
rename from copy
- rename to rename
+ rename to rename1
+ --- a/copy
+ +++ b/rename1
+ @@ -1,2 +1,3 @@
+ new
+ copy1
+ +rename1
+ diff --git a/rename2 b/rename2
+ new file mode 100644
+ --- /dev/null
+ +++ b/rename2
+ @@ -0,0 +1,3 @@
+ +new
+ +copy2
+ +rename2
+
+ $ hg diff --root dir2 --git -r 2:tip
+ diff --git a/copy b/copy
+ deleted file mode 100644
+ --- a/copy
+ +++ /dev/null
+ @@ -1,2 +0,0 @@
+ -new
+ -copy2
+
+ $ hg diff --root dir1 --git -r 2:tip -I '**/copy'
+ diff --git a/copy b/copy
+ deleted file mode 100644
+ --- a/copy
+ +++ /dev/null
+ @@ -1,2 +0,0 @@
+ -new
+ -copy1
+
+ $ hg diff --root dir1 --git -r 2:tip -I '**/rename*'
+ diff --git a/copy b/rename1
+ copy from copy
+ copy to rename1
+ --- a/copy
+ +++ b/rename1
+ @@ -1,2 +1,3 @@
+ new
+ copy1
+ +rename1
+ diff --git a/rename2 b/rename2
+ new file mode 100644
+ --- /dev/null
+ +++ b/rename2
+ @@ -0,0 +1,3 @@
+ +new
+ +copy2
+ +rename2
Delete:
- $ hg rm rename
+ $ hg rm dir1/*
$ hg ci -mdelete
$ hg diff --git -r 3:tip
- diff --git a/rename b/rename
+ diff --git a/dir1/new b/dir1/new
deleted file mode 100644
- --- a/rename
+ --- a/dir1/new
+++ /dev/null
@@ -1,1 +0,0 @@
-new
+ diff --git a/dir1/rename1 b/dir1/rename1
+ deleted file mode 100644
+ --- a/dir1/rename1
+ +++ /dev/null
+ @@ -1,3 +0,0 @@
+ -new
+ -copy1
+ -rename1
+ diff --git a/dir1/rename2 b/dir1/rename2
+ deleted file mode 100644
+ --- a/dir1/rename2
+ +++ /dev/null
+ @@ -1,3 +0,0 @@
+ -new
+ -copy2
+ -rename2
$ cat > src < 1
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-globalopts.t
--- a/tests/test-globalopts.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-globalopts.t Thu Apr 02 16:51:00 2015 -0500
@@ -309,7 +309,7 @@
grep search for a pattern in specified files and revisions
heads show branch heads
help show help for a given topic or a help overview
- identify identify the working copy or specified revision
+ identify identify the working directory or specified revision
import import an ordered set of patches
incoming show new changesets found in source
init create a new repository in the given directory
@@ -390,7 +390,7 @@
grep search for a pattern in specified files and revisions
heads show branch heads
help show help for a given topic or a help overview
- identify identify the working copy or specified revision
+ identify identify the working directory or specified revision
import import an ordered set of patches
incoming show new changesets found in source
init create a new repository in the given directory
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-glog.t
--- a/tests/test-glog.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-glog.t Thu Apr 02 16:51:00 2015 -0500
@@ -1541,6 +1541,9 @@
$ testlog --follow
[]
[]
+ $ testlog -rnull
+ ['null']
+ []
$ echo a > a
$ echo aa > aa
$ echo f > f
@@ -1764,6 +1767,13 @@
nodetag 1
nodetag 0
+Test --follow null parent
+
+ $ hg up -q null
+ $ testlog -f
+ []
+ []
+
Test --follow-first
$ hg up -q 3
@@ -2192,13 +2202,6 @@
(func
('symbol', 'rev')
('symbol', '6'))))
- --- log.nodes * (glob)
- +++ glog.nodes * (glob)
- @@ -1,3 +1,3 @@
- -nodetag 6
- nodetag 8
- nodetag 7
- +nodetag 6
Test --follow-first and forward --rev
@@ -2240,6 +2243,14 @@
('symbol', 'rev')
('symbol', '6'))))
+Test --follow with --rev of graphlog extension
+
+ $ hg --config extensions.graphlog= glog -qfr1
+ o 1:216d4c92cf98
+ |
+ o 0:f8035bb17114
+
+
Test subdir
$ hg up -q 3
@@ -2354,4 +2365,14 @@
date: Thu Jan 01 00:00:00 1970 +0000
+should not draw line down to null due to the magic of fullreposet
+
+ $ hg log -G -r 'all()' | tail -6
+ |
+ o changeset: 0:f8035bb17114
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: add a
+
+
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-grep.t
--- a/tests/test-grep.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-grep.t Thu Apr 02 16:51:00 2015 -0500
@@ -82,6 +82,10 @@
port:1:2:+:eggs:export
port:0:1:+:spam:import
+ $ hg up -q null
+ $ hg grep -f port
+ [1]
+
$ cd ..
$ hg init t2
$ cd t2
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hardlinks.t
--- a/tests/test-hardlinks.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hardlinks.t Thu Apr 02 16:51:00 2015 -0500
@@ -58,6 +58,13 @@
Create hardlinked clone r2:
$ hg clone -U --debug r1 r2
+ linking: 1
+ linking: 2
+ linking: 3
+ linking: 4
+ linking: 5
+ linking: 6
+ linking: 7
linked 7 files
Create non-hardlinked clone r3:
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-help.t
--- a/tests/test-help.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-help.t Thu Apr 02 16:51:00 2015 -0500
@@ -72,7 +72,7 @@
grep search for a pattern in specified files and revisions
heads show branch heads
help show help for a given topic or a help overview
- identify identify the working copy or specified revision
+ identify identify the working directory or specified revision
import import an ordered set of patches
incoming show new changesets found in source
init create a new repository in the given directory
@@ -147,7 +147,7 @@
grep search for a pattern in specified files and revisions
heads show branch heads
help show help for a given topic or a help overview
- identify identify the working copy or specified revision
+ identify identify the working directory or specified revision
import import an ordered set of patches
incoming show new changesets found in source
init create a new repository in the given directory
@@ -245,6 +245,7 @@
acl hooks for controlling repository access
blackbox log repository events to a blackbox for debugging
bugzilla hooks for integrating with the Bugzilla bug tracker
+ censor erase file content at a given revision
churn command to display statistics about repository history
color colorize output from some commands
convert import revisions from foreign VCS repositories into
@@ -411,7 +412,7 @@
Mercurial Distributed SCM (version *) (glob)
(see http://mercurial.selenic.com for more information)
- Copyright (C) 2005-2014 Matt Mackall and others
+ Copyright (C) 2005-2015 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -508,6 +509,7 @@
-B --ignore-blank-lines ignore changes whose lines are all blank
-U --unified NUM number of lines of context to show
--stat output diffstat-style summary of changes
+ --root DIR produce diffs relative to subdirectory
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
-S --subrepos recurse into subrepositories
@@ -689,7 +691,7 @@
grep search for a pattern in specified files and revisions
heads show branch heads
help show help for a given topic or a help overview
- identify identify the working copy or specified revision
+ identify identify the working directory or specified revision
import import an ordered set of patches
incoming show new changesets found in source
init create a new repository in the given directory
@@ -1101,6 +1103,125 @@
abort: help section not found
[255]
+Test dynamic list of merge tools only shows up once
+ $ hg help merge-tools
+ Merge Tools
+ """""""""""
+
+ To merge files Mercurial uses merge tools.
+
+ A merge tool combines two different versions of a file into a merged file.
+ Merge tools are given the two files and the greatest common ancestor of
+ the two file versions, so they can determine the changes made on both
+ branches.
+
+ Merge tools are used both for "hg resolve", "hg merge", "hg update", "hg
+ backout" and in several extensions.
+
+ Usually, the merge tool tries to automatically reconcile the files by
+ combining all non-overlapping changes that occurred separately in the two
+ different evolutions of the same initial base file. Furthermore, some
+ interactive merge programs make it easier to manually resolve conflicting
+ merges, either in a graphical way, or by inserting some conflict markers.
+ Mercurial does not include any interactive merge programs but relies on
+ external tools for that.
+
+ Available merge tools
+ =====================
+
+ External merge tools and their properties are configured in the merge-
+ tools configuration section - see hgrc(5) - but they can often just be
+ named by their executable.
+
+ A merge tool is generally usable if its executable can be found on the
+ system and if it can handle the merge. The executable is found if it is an
+ absolute or relative executable path or the name of an application in the
+ executable search path. The tool is assumed to be able to handle the merge
+ if it can handle symlinks if the file is a symlink, if it can handle
+ binary files if the file is binary, and if a GUI is available if the tool
+ requires a GUI.
+
+ There are some internal merge tools which can be used. The internal merge
+ tools are:
+
+ ":dump"
+ Creates three versions of the files to merge, containing the contents of
+ local, other and base. These files can then be used to perform a merge
+ manually. If the file to be merged is named "a.txt", these files will
+ accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
+ they will be placed in the same directory as "a.txt".
+
+ ":fail"
+ Rather than attempting to merge files that were modified on both
+ branches, it marks them as unresolved. The resolve command must be used
+ to resolve these conflicts.
+
+ ":local"
+ Uses the local version of files as the merged version.
+
+ ":merge"
+ Uses the internal non-interactive simple merge algorithm for merging
+ files. It will fail if there are any conflicts and leave markers in the
+ partially merged file. Markers will have two sections, one for each side
+ of merge.
+
+ ":merge3"
+ Uses the internal non-interactive simple merge algorithm for merging
+ files. It will fail if there are any conflicts and leave markers in the
+ partially merged file. Marker will have three sections, one from each
+ side of the merge and one for the base content.
+
+ ":other"
+ Uses the other version of files as the merged version.
+
+ ":prompt"
+ Asks the user which of the local or the other version to keep as the
+ merged version.
+
+ ":tagmerge"
+ Uses the internal tag merge algorithm (experimental).
+
+ Internal tools are always available and do not require a GUI but will by
+ default not handle symlinks or binary files.
+
+ Choosing a merge tool
+ =====================
+
+ Mercurial uses these rules when deciding which merge tool to use:
+
+ 1. If a tool has been specified with the --tool option to merge or
+ resolve, it is used. If it is the name of a tool in the merge-tools
+ configuration, its configuration is used. Otherwise the specified tool
+ must be executable by the shell.
+ 2. If the "HGMERGE" environment variable is present, its value is used and
+ must be executable by the shell.
+ 3. If the filename of the file to be merged matches any of the patterns in
+ the merge-patterns configuration section, the first usable merge tool
+ corresponding to a matching pattern is used. Here, binary capabilities
+ of the merge tool are not considered.
+ 4. If ui.merge is set it will be considered next. If the value is not the
+ name of a configured tool, the specified value is used and must be
+ executable by the shell. Otherwise the named tool is used if it is
+ usable.
+ 5. If any usable merge tools are present in the merge-tools configuration
+ section, the one with the highest priority is used.
+ 6. If a program named "hgmerge" can be found on the system, it is used -
+ but it will by default not be used for symlinks and binary files.
+ 7. If the file to be merged is not binary and is not a symlink, then
+ internal ":merge" is used.
+ 8. The merge of the file fails and must be resolved before commit.
+
+ Note:
+ After selecting a merge program, Mercurial will by default attempt to
+ merge the files using a simple merge algorithm first. Only if it
+ doesn't succeed because of conflicting changes Mercurial will actually
+ execute the merge program. Whether to use the simple merge algorithm
+ first can be controlled by the premerge setting of the merge tool.
+ Premerge is enabled by default unless the file is binary or a symlink.
+
+ See the merge-tools and ui sections of hgrc(5) for details on the
+ configuration of merge tools.
+
Test usage of section marks in help documents
$ cd "$TESTDIR"/../doc
@@ -1536,7 +1657,7 @@
identify
- identify the working copy or specified revision
+ identify the working directory or specified revision
|
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgrc.t
--- a/tests/test-hgrc.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgrc.t Thu Apr 02 16:51:00 2015 -0500
@@ -71,7 +71,7 @@
Mercurial Distributed SCM (version *) (glob)
(see http://mercurial.selenic.com for more information)
- Copyright (C) 2005-2014 Matt Mackall and others
+ Copyright (C) 2005-2015 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ unset FAKEPATH
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgweb-commands.t Thu Apr 02 16:51:00 2015 -0500
@@ -726,7 +726,6 @@
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -873,7 +874,8 @@
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
|
@@ -894,8 +896,7 @@
[+]
[-]
-
-
+
da/foo |
1 |
@@ -1012,11 +1013,13 @@
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb-descend-empties.t
--- a/tests/test-hgweb-descend-empties.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgweb-descend-empties.t Thu Apr 02 16:51:00 2015 -0500
@@ -81,11 +81,13 @@
+
name |
size |
permissions |
+
[up] |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgweb-diffs.t Thu Apr 02 16:51:00 2015 -0500
@@ -97,7 +97,8 @@
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
|
@@ -118,8 +119,7 @@
[+]
[-]
-
-
+
a |
1 |
@@ -369,7 +369,8 @@
|
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
|
@@ -390,8 +391,7 @@
[+]
[-]
-
-
+
a |
1 |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb-empty.t
--- a/tests/test-hgweb-empty.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgweb-empty.t Thu Apr 02 16:51:00 2015 -0500
@@ -48,7 +48,6 @@
-
+
age |
author |
description |
+
@@ -158,7 +159,6 @@
-
+
age |
author |
description |
+
@@ -264,7 +266,6 @@
-
@@ -431,11 +432,13 @@
+
name |
size |
permissions |
+
[up] |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb-filelog.t
--- a/tests/test-hgweb-filelog.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgweb-filelog.t Thu Apr 02 16:51:00 2015 -0500
@@ -156,7 +156,6 @@
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -266,7 +267,6 @@
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -376,7 +378,6 @@
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -481,7 +484,6 @@
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb-json.t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-json.t Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,1009 @@
+#require json
+#require serve
+
+ $ request() {
+ > $TESTDIR/get-with-headers.py --json localhost:$HGPORT "$1"
+ > }
+
+ $ hg init test
+ $ cd test
+ $ mkdir da
+ $ echo foo > da/foo
+ $ echo foo > foo
+ $ hg -q ci -A -m initial
+ $ echo bar > foo
+ $ hg ci -m 'modify foo'
+ $ echo bar > da/foo
+ $ hg ci -m 'modify da/foo'
+ $ hg bookmark bookmark1
+ $ hg up default
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (leaving bookmark bookmark1)
+ $ hg mv foo foo-new
+ $ hg commit -m 'move foo'
+ $ hg tag -m 'create tag' tag1
+ $ hg phase --public -r .
+ $ echo baz > da/foo
+ $ hg commit -m 'another commit to da/foo'
+ $ hg tag -m 'create tag2' tag2
+ $ hg bookmark bookmark2
+ $ hg -q up -r 0
+ $ hg -q branch test-branch
+ $ echo branch > foo
+ $ hg commit -m 'create test branch'
+ $ echo branch_commit_2 > foo
+ $ hg commit -m 'another commit in test-branch'
+ $ hg -q up default
+ $ hg merge --tool :local test-branch
+ 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg commit -m 'merge test-branch into default'
+
+ $ hg log -G
+ @ changeset: 9:cc725e08502a
+ |\ tag: tip
+ | | parent: 6:ceed296fe500
+ | | parent: 8:ed66c30e87eb
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: merge test-branch into default
+ | |
+ | o changeset: 8:ed66c30e87eb
+ | | branch: test-branch
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: another commit in test-branch
+ | |
+ | o changeset: 7:6ab967a8ab34
+ | | branch: test-branch
+ | | parent: 0:06e557f3edf6
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: create test branch
+ | |
+ o | changeset: 6:ceed296fe500
+ | | bookmark: bookmark2
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: create tag2
+ | |
+ o | changeset: 5:f2890a05fea4
+ | | tag: tag2
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: another commit to da/foo
+ | |
+ o | changeset: 4:93a8ce14f891
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: create tag
+ | |
+ o | changeset: 3:78896eb0e102
+ | | tag: tag1
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: move foo
+ | |
+ o | changeset: 2:8d7c456572ac
+ | | bookmark: bookmark1
+ | | user: test
+ | | date: Thu Jan 01 00:00:00 1970 +0000
+ | | summary: modify da/foo
+ | |
+ o | changeset: 1:f8bbb9024b10
+ |/ user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: modify foo
+ |
+ o changeset: 0:06e557f3edf6
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: initial
+
+
+ $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log
+ $ cat hg.pid >> $DAEMON_PIDS
+
+(Try to keep these in roughly the order they are defined in webcommands.py)
+
+(log is handled by filelog/ and changelog/ - ignore it)
+
+(rawfile/ doesn't use templating - nothing to test)
+
+file/{revision}/{path} shows file revision
+
+ $ request json-file/06e557f3edf6/foo
+ 200 Script output follows
+
+ "not yet implemented"
+
+file/{revision} shows root directory info
+
+ $ request json-file/cc725e08502a
+ 200 Script output follows
+
+ {
+ "abspath": "/",
+ "bookmarks": [],
+ "directories": [
+ {
+ "abspath": "/da",
+ "basename": "da",
+ "emptydirs": ""
+ }
+ ],
+ "files": [
+ {
+ "abspath": ".hgtags",
+ "basename": ".hgtags",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "flags": "",
+ "size": 92
+ },
+ {
+ "abspath": "foo-new",
+ "basename": "foo-new",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "flags": "",
+ "size": 4
+ }
+ ],
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
+ "tags": [
+ "tip"
+ ]
+ }
+
+changelog/ shows information about several changesets
+
+ $ request json-changelog
+ 200 Script output follows
+
+ {
+ "changeset_count": 10,
+ "changesets": [
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "merge test-branch into default",
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
+ "tags": [
+ "tip"
+ ],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "another commit in test-branch",
+ "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "create test branch",
+ "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [
+ "bookmark2"
+ ],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "create tag2",
+ "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "another commit to da/foo",
+ "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
+ "tags": [
+ "tag2"
+ ],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "create tag",
+ "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "move foo",
+ "node": "78896eb0e102174ce9278438a95e12543e4367a7",
+ "tags": [
+ "tag1"
+ ],
+ "user": "test"
+ },
+ {
+ "bookmarks": [
+ "bookmark1"
+ ],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify da/foo",
+ "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify foo",
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "initial",
+ "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
+ "tags": [],
+ "user": "test"
+ }
+ ],
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
+ }
+
+changelog/{revision} shows information starting at a specific changeset
+
+ $ request json-changelog/f8bbb9024b10
+ 200 Script output follows
+
+ {
+ "changeset_count": 10,
+ "changesets": [
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify foo",
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "initial",
+ "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
+ "tags": [],
+ "user": "test"
+ }
+ ],
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
+ }
+
+shortlog/ shows information about a set of changesets
+
+ $ request json-shortlog
+ 200 Script output follows
+
+ {
+ "changeset_count": 10,
+ "changesets": [
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "merge test-branch into default",
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
+ "tags": [
+ "tip"
+ ],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "another commit in test-branch",
+ "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "create test branch",
+ "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [
+ "bookmark2"
+ ],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "create tag2",
+ "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "another commit to da/foo",
+ "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
+ "tags": [
+ "tag2"
+ ],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "create tag",
+ "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "move foo",
+ "node": "78896eb0e102174ce9278438a95e12543e4367a7",
+ "tags": [
+ "tag1"
+ ],
+ "user": "test"
+ },
+ {
+ "bookmarks": [
+ "bookmark1"
+ ],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify da/foo",
+ "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify foo",
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
+ "tags": [],
+ "user": "test"
+ },
+ {
+ "bookmarks": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "initial",
+ "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
+ "tags": [],
+ "user": "test"
+ }
+ ],
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
+ }
+
+changeset/ renders the tip changeset
+
+ $ request json-rev
+ 200 Script output follows
+
+ {
+ "bookmarks": [],
+ "branch": "default",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "merge test-branch into default",
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
+ "parents": [
+ "ceed296fe500c3fac9541e31dad860cb49c89e45",
+ "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
+ ],
+ "phase": "draft",
+ "tags": [
+ "tip"
+ ],
+ "user": "test"
+ }
+
+changeset/{revision} shows tags
+
+ $ request json-rev/78896eb0e102
+ 200 Script output follows
+
+ {
+ "bookmarks": [],
+ "branch": "default",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "move foo",
+ "node": "78896eb0e102174ce9278438a95e12543e4367a7",
+ "parents": [
+ "8d7c456572acf3557e8ed8a07286b10c408bcec5"
+ ],
+ "phase": "public",
+ "tags": [
+ "tag1"
+ ],
+ "user": "test"
+ }
+
+changeset/{revision} shows bookmarks
+
+ $ request json-rev/8d7c456572ac
+ 200 Script output follows
+
+ {
+ "bookmarks": [
+ "bookmark1"
+ ],
+ "branch": "default",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify da/foo",
+ "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
+ "parents": [
+ "f8bbb9024b10f93cdbb8d940337398291d40dea8"
+ ],
+ "phase": "public",
+ "tags": [],
+ "user": "test"
+ }
+
+changeset/{revision} shows branches
+
+ $ request json-rev/6ab967a8ab34
+ 200 Script output follows
+
+ {
+ "bookmarks": [],
+ "branch": "test-branch",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "create test branch",
+ "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
+ "parents": [
+ "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
+ ],
+ "phase": "draft",
+ "tags": [],
+ "user": "test"
+ }
+
+manifest/{revision}/{path} shows info about a directory at a revision
+
+ $ request json-manifest/06e557f3edf6/
+ 200 Script output follows
+
+ {
+ "abspath": "/",
+ "bookmarks": [],
+ "directories": [
+ {
+ "abspath": "/da",
+ "basename": "da",
+ "emptydirs": ""
+ }
+ ],
+ "files": [
+ {
+ "abspath": "foo",
+ "basename": "foo",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "flags": "",
+ "size": 4
+ }
+ ],
+ "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
+ "tags": []
+ }
+
+tags/ shows tags info
+
+ $ request json-tags
+ 200 Script output follows
+
+ {
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
+ "tags": [
+ {
+ "date": [
+ 0.0,
+ 0
+ ],
+ "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
+ "tag": "tag2"
+ },
+ {
+ "date": [
+ 0.0,
+ 0
+ ],
+ "node": "78896eb0e102174ce9278438a95e12543e4367a7",
+ "tag": "tag1"
+ }
+ ]
+ }
+
+bookmarks/ shows bookmarks info
+
+ $ request json-bookmarks
+ 200 Script output follows
+
+ {
+ "bookmarks": [
+ {
+ "bookmark": "bookmark1",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
+ },
+ {
+ "bookmark": "bookmark2",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
+ }
+ ],
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
+ }
+
+branches/ shows branches info
+
+ $ request json-branches
+ 200 Script output follows
+
+ {
+ "branches": [
+ {
+ "branch": "default",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
+ "status": "open"
+ },
+ {
+ "branch": "test-branch",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
+ "status": "inactive"
+ }
+ ]
+ }
+
+summary/ shows a summary of repository state
+
+ $ request json-summary
+ 200 Script output follows
+
+ "not yet implemented"
+
+filediff/{revision}/{path} shows changes to a file in a revision
+
+ $ request json-diff/f8bbb9024b10/foo
+ 200 Script output follows
+
+ "not yet implemented"
+
+comparison/{revision}/{path} shows information about before and after for a file
+
+ $ request json-comparison/f8bbb9024b10/foo
+ 200 Script output follows
+
+ "not yet implemented"
+
+annotate/{revision}/{path} shows annotations for each line
+
+ $ request json-annotate/f8bbb9024b10/foo
+ 200 Script output follows
+
+ "not yet implemented"
+
+filelog/{revision}/{path} shows history of a single file
+
+ $ request json-filelog/f8bbb9024b10/foo
+ 200 Script output follows
+
+ "not yet implemented"
+
+(archive/ doesn't use templating, so ignore it)
+
+(static/ doesn't use templating, so ignore it)
+
+graph/ shows information that can be used to render a graph of the DAG
+
+ $ request json-graph
+ 200 Script output follows
+
+ "not yet implemented"
+
+help/ shows help topics
+
+ $ request json-help
+ 200 Script output follows
+
+ {
+ "earlycommands": [
+ {
+ "summary": "add the specified files on the next commit",
+ "topic": "add"
+ },
+ {
+ "summary": "show changeset information by line for each file",
+ "topic": "annotate"
+ },
+ {
+ "summary": "make a copy of an existing repository",
+ "topic": "clone"
+ },
+ {
+ "summary": "commit the specified files or all outstanding changes",
+ "topic": "commit"
+ },
+ {
+ "summary": "diff repository (or selected files)",
+ "topic": "diff"
+ },
+ {
+ "summary": "dump the header and diffs for one or more changesets",
+ "topic": "export"
+ },
+ {
+ "summary": "forget the specified files on the next commit",
+ "topic": "forget"
+ },
+ {
+ "summary": "create a new repository in the given directory",
+ "topic": "init"
+ },
+ {
+ "summary": "show revision history of entire repository or files",
+ "topic": "log"
+ },
+ {
+ "summary": "merge another revision into working directory",
+ "topic": "merge"
+ },
+ {
+ "summary": "pull changes from the specified source",
+ "topic": "pull"
+ },
+ {
+ "summary": "push changes to the specified destination",
+ "topic": "push"
+ },
+ {
+ "summary": "remove the specified files on the next commit",
+ "topic": "remove"
+ },
+ {
+ "summary": "start stand-alone webserver",
+ "topic": "serve"
+ },
+ {
+ "summary": "show changed files in the working directory",
+ "topic": "status"
+ },
+ {
+ "summary": "summarize working directory state",
+ "topic": "summary"
+ },
+ {
+ "summary": "update working directory (or switch revisions)",
+ "topic": "update"
+ }
+ ],
+ "othercommands": [
+ {
+ "summary": "add all new files, delete all missing files",
+ "topic": "addremove"
+ },
+ {
+ "summary": "create an unversioned archive of a repository revision",
+ "topic": "archive"
+ },
+ {
+ "summary": "reverse effect of earlier changeset",
+ "topic": "backout"
+ },
+ {
+ "summary": "subdivision search of changesets",
+ "topic": "bisect"
+ },
+ {
+ "summary": "create a new bookmark or list existing bookmarks",
+ "topic": "bookmarks"
+ },
+ {
+ "summary": "set or show the current branch name",
+ "topic": "branch"
+ },
+ {
+ "summary": "list repository named branches",
+ "topic": "branches"
+ },
+ {
+ "summary": "create a changegroup file",
+ "topic": "bundle"
+ },
+ {
+ "summary": "output the current or given revision of files",
+ "topic": "cat"
+ },
+ {
+ "summary": "show combined config settings from all hgrc files",
+ "topic": "config"
+ },
+ {
+ "summary": "mark files as copied for the next commit",
+ "topic": "copy"
+ },
+ {
+ "summary": "list tracked files",
+ "topic": "files"
+ },
+ {
+ "summary": "copy changes from other branches onto the current branch",
+ "topic": "graft"
+ },
+ {
+ "summary": "search for a pattern in specified files and revisions",
+ "topic": "grep"
+ },
+ {
+ "summary": "show branch heads",
+ "topic": "heads"
+ },
+ {
+ "summary": "show help for a given topic or a help overview",
+ "topic": "help"
+ },
+ {
+ "summary": "identify the working directory or specified revision",
+ "topic": "identify"
+ },
+ {
+ "summary": "import an ordered set of patches",
+ "topic": "import"
+ },
+ {
+ "summary": "show new changesets found in source",
+ "topic": "incoming"
+ },
+ {
+ "summary": "output the current or given revision of the project manifest",
+ "topic": "manifest"
+ },
+ {
+ "summary": "show changesets not found in the destination",
+ "topic": "outgoing"
+ },
+ {
+ "summary": "show aliases for remote repositories",
+ "topic": "paths"
+ },
+ {
+ "summary": "set or show the current phase name",
+ "topic": "phase"
+ },
+ {
+ "summary": "roll back an interrupted transaction",
+ "topic": "recover"
+ },
+ {
+ "summary": "rename files; equivalent of copy + remove",
+ "topic": "rename"
+ },
+ {
+ "summary": "redo merges or set/view the merge status of files",
+ "topic": "resolve"
+ },
+ {
+ "summary": "restore files to their checkout state",
+ "topic": "revert"
+ },
+ {
+ "summary": "print the root (top) of the current working directory",
+ "topic": "root"
+ },
+ {
+ "summary": "add one or more tags for the current or given revision",
+ "topic": "tag"
+ },
+ {
+ "summary": "list repository tags",
+ "topic": "tags"
+ },
+ {
+ "summary": "apply one or more changegroup files",
+ "topic": "unbundle"
+ },
+ {
+ "summary": "verify the integrity of the repository",
+ "topic": "verify"
+ },
+ {
+ "summary": "output version and copyright information",
+ "topic": "version"
+ }
+ ],
+ "topics": [
+ {
+ "summary": "Configuration Files",
+ "topic": "config"
+ },
+ {
+ "summary": "Date Formats",
+ "topic": "dates"
+ },
+ {
+ "summary": "Diff Formats",
+ "topic": "diffs"
+ },
+ {
+ "summary": "Environment Variables",
+ "topic": "environment"
+ },
+ {
+ "summary": "Using Additional Features",
+ "topic": "extensions"
+ },
+ {
+ "summary": "Specifying File Sets",
+ "topic": "filesets"
+ },
+ {
+ "summary": "Glossary",
+ "topic": "glossary"
+ },
+ {
+ "summary": "Syntax for Mercurial Ignore Files",
+ "topic": "hgignore"
+ },
+ {
+ "summary": "Configuring hgweb",
+ "topic": "hgweb"
+ },
+ {
+ "summary": "Merge Tools",
+ "topic": "merge-tools"
+ },
+ {
+ "summary": "Specifying Multiple Revisions",
+ "topic": "multirevs"
+ },
+ {
+ "summary": "File Name Patterns",
+ "topic": "patterns"
+ },
+ {
+ "summary": "Working with Phases",
+ "topic": "phases"
+ },
+ {
+ "summary": "Specifying Single Revisions",
+ "topic": "revisions"
+ },
+ {
+ "summary": "Specifying Revision Sets",
+ "topic": "revsets"
+ },
+ {
+ "summary": "Subrepositories",
+ "topic": "subrepos"
+ },
+ {
+ "summary": "Template Usage",
+ "topic": "templating"
+ },
+ {
+ "summary": "URL Paths",
+ "topic": "urls"
+ }
+ ]
+ }
+
+help/{topic} shows an individual help topic
+
+ $ request json-help/phases
+ 200 Script output follows
+
+ {
+ "rawdoc": "Working with Phases\n*", (glob)
+ "topic": "phases"
+ }
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgweb-removed.t Thu Apr 02 16:51:00 2015 -0500
@@ -78,7 +78,8 @@
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
cb9a9f314b8b |
@@ -99,8 +100,7 @@
[+]
[-]
-
-
+
a |
1 |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgweb.t
--- a/tests/test-hgweb.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgweb.t Thu Apr 02 16:51:00 2015 -0500
@@ -272,11 +272,13 @@
+
name |
size |
permissions |
+
[up] |
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hgwebdir.t
--- a/tests/test-hgwebdir.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hgwebdir.t Thu Apr 02 16:51:00 2015 -0500
@@ -201,6 +201,7 @@
+
Name |
Description |
@@ -209,6 +210,7 @@
|
|
+
@@ -699,6 +701,7 @@
+
Name |
Description |
@@ -707,6 +710,7 @@
|
|
+
@@ -1128,6 +1132,7 @@
+
Name |
Description |
@@ -1136,6 +1141,7 @@
|
|
+
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-highlight.t
--- a/tests/test-highlight.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-highlight.t Thu Apr 02 16:51:00 2015 -0500
@@ -268,10 +268,12 @@
+
rev |
line source |
+
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-histedit-arguments.t Thu Apr 02 16:51:00 2015 -0500
@@ -103,6 +103,15 @@
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg up --quiet
+Test config specified default
+-----------------------------
+
+ $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF
+ > pick c8e68270e35a 3 four
+ > pick 08d98a8350f3 4 five
+ > EOF
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
Run on a revision not descendants of the initial parent
--------------------------------------------------------------------
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-histedit-drop.t
--- a/tests/test-histedit-drop.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-histedit-drop.t Thu Apr 02 16:51:00 2015 -0500
@@ -96,7 +96,6 @@
Check histedit_source
$ hg log --debug --rev f518305ce889
- invalid branchheads cache (visible): tip differs
changeset: 4:f518305ce889c07cb5bd05522176d75590ef3324
tag: tip
phase: draft
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-histedit-edit.t
--- a/tests/test-histedit-edit.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-histedit-edit.t Thu Apr 02 16:51:00 2015 -0500
@@ -3,13 +3,14 @@
$ cat >> $HGRCPATH < [extensions]
> histedit=
+ > strip=
> EOF
$ initrepo ()
> {
> hg init r
> cd r
- > for x in a b c d e f ; do
+ > for x in a b c d e f g; do
> echo $x > $x
> hg add $x
> hg ci -m $x
@@ -20,10 +21,15 @@
log before edit
$ hg log --graph
- @ changeset: 5:652413bf663e
+ @ changeset: 6:3c6a8ed2ebe8
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: g
+ |
+ o changeset: 5:652413bf663e
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
| summary: f
|
o changeset: 4:e860deea161a
@@ -58,11 +64,19 @@
> pick 055a42cdd887 d
> edit e860deea161a e
> pick 652413bf663e f
+ > pick 3c6a8ed2ebe8 g
> EOF
- 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
Make changes as needed, you may commit or record as needed now.
When you are finished, run hg histedit --continue to resume.
+edit the plan
+ $ hg histedit --edit-plan --commands - 2>&1 << EOF
+ > edit e860deea161a e
+ > pick 652413bf663e f
+ > drop 3c6a8ed2ebe8 g
+ > EOF
+
Go at a random point and try to continue
$ hg id -n
@@ -72,10 +86,22 @@
(use 'hg histedit --continue' or 'hg histedit --abort')
[255]
+Try to delete necessary commit
+ $ hg strip -r 652413bf663e
+ abort: histedit in progress, can't strip 363532343133
+ [255]
+
commit, then edit the revision
$ hg ci -m 'wat'
created new head
$ echo a > e
+
+qnew should fail while we're in the middle of the edit step
+
+ $ hg --config extensions.mq= qnew please-fail
+ abort: histedit in progress
+ (use 'hg histedit --continue' or 'hg histedit --abort')
+ [255]
$ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-hook.t
--- a/tests/test-hook.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-hook.t Thu Apr 02 16:51:00 2015 -0500
@@ -12,13 +12,19 @@
> pre-identify = python "$TESTDIR/printenv.py" pre-identify 1
> pre-cat = python "$TESTDIR/printenv.py" pre-cat
> post-cat = python "$TESTDIR/printenv.py" post-cat
+ > pretxnopen = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnopen"
+ > pretxnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnclose"
+ > txnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnclose"
> EOF
$ echo a > a
$ hg add a
$ hg commit -m a
precommit hook: HG_PARENT1=0000000000000000000000000000000000000000
+ pretxnopen hook: HG_TXNNAME=commit
pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a
0:cb9a9f314b8b
+ pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNNAME=commit
commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
@@ -42,8 +48,11 @@
$ echo b >> a
$ hg commit -m a1 -d "1 0"
precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
+ pretxnopen hook: HG_TXNNAME=commit
pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
1:ab228980c14d
+ pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit
+ txnclose hook: HG_TXNNAME=commit
commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
$ hg update -C 0
@@ -52,8 +61,11 @@
$ hg add b
$ hg commit -m b -d '1 0'
precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
+ pretxnopen hook: HG_TXNNAME=commit
pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
2:ee9deb46ab31
+ pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit
+ txnclose hook: HG_TXNNAME=commit
commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
created new head
@@ -62,8 +74,11 @@
(branch merge, don't forget to commit)
$ hg commit -m merge -d '2 0'
precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
+ pretxnopen hook: HG_TXNNAME=commit
pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a
3:07f3376c1e65
+ pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit
+ txnclose hook: HG_TXNNAME=commit
commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
@@ -103,9 +118,12 @@
$ hg tag -d '3 0' a
pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
+ pretxnopen hook: HG_TXNNAME=commit
pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a
4:539e4b31b6dc
+ pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=commit
tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
+ txnclose hook: HG_TXNNAME=commit
commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
$ hg tag -l la
@@ -137,6 +155,7 @@
4:539e4b31b6dc
$ hg commit -m 'fail' -d '4 0'
precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
+ pretxnopen hook: HG_TXNNAME=commit
pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
5:6f611f8018c1
5:6f611f8018c1
@@ -198,6 +217,9 @@
pushing to ../a
searching for changes
no changes found
+ pretxnopen hook: HG_TXNNAME=bookmarks
+ pretxnclose hook: HG_PENDING=$TESTTMP/a HG_XNNAME=bookmarks
+ txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNNAME=bookmarks
pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1
exporting bookmark foo
[1]
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-https.t
--- a/tests/test-https.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-https.t Thu Apr 02 16:51:00 2015 -0500
@@ -119,12 +119,12 @@
Apple's OpenSSL. This trick do not work with plain OpenSSL.
$ DISABLEOSXDUMMYCERT=
-#if osx
+#if defaultcacerts
$ hg clone https://localhost:$HGPORT/ copy-pull
abort: error: *certificate verify failed* (glob)
[255]
- $ DISABLEOSXDUMMYCERT="--config=web.cacerts="
+ $ DISABLEOSXDUMMYCERT="--config=web.cacerts=!"
#endif
clone via pull
@@ -156,8 +156,8 @@
$ echo '[hooks]' >> .hg/hgrc
$ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
$ hg pull $DISABLEOSXDUMMYCERT
+ pulling from https://localhost:$HGPORT/
warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
- pulling from https://localhost:$HGPORT/
searching for changes
adding changesets
adding manifests
@@ -188,28 +188,30 @@
searching for changes
no changes found
$ P=`pwd` hg -R copy-pull pull --insecure
+ pulling from https://localhost:$HGPORT/
warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
- pulling from https://localhost:$HGPORT/
searching for changes
no changes found
cacert mismatch
$ hg -R copy-pull pull --config web.cacerts=pub.pem https://127.0.0.1:$HGPORT/
+ pulling from https://127.0.0.1:$HGPORT/
abort: 127.0.0.1 certificate error: certificate is for localhost
(configure hostfingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca or use --insecure to connect insecurely)
[255]
$ hg -R copy-pull pull --config web.cacerts=pub.pem https://127.0.0.1:$HGPORT/ --insecure
+ pulling from https://127.0.0.1:$HGPORT/
warning: 127.0.0.1 certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
- pulling from https://127.0.0.1:$HGPORT/
searching for changes
no changes found
$ hg -R copy-pull pull --config web.cacerts=pub-other.pem
+ pulling from https://localhost:$HGPORT/
abort: error: *certificate verify failed* (glob)
[255]
$ hg -R copy-pull pull --config web.cacerts=pub-other.pem --insecure
+ pulling from https://localhost:$HGPORT/
warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
- pulling from https://localhost:$HGPORT/
searching for changes
no changes found
@@ -218,6 +220,7 @@
$ hg -R test serve -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem
$ cat hg1.pid >> $DAEMON_PIDS
$ hg -R copy-pull pull --config web.cacerts=pub-not-yet.pem https://localhost:$HGPORT1/
+ pulling from https://localhost:$HGPORT1/
abort: error: *certificate verify failed* (glob)
[255]
@@ -226,6 +229,7 @@
$ hg -R test serve -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
$ cat hg2.pid >> $DAEMON_PIDS
$ hg -R copy-pull pull --config web.cacerts=pub-expired.pem https://localhost:$HGPORT2/
+ pulling from https://localhost:$HGPORT2/
abort: error: *certificate verify failed* (glob)
[255]
@@ -236,7 +240,7 @@
$ echo "127.0.0.1 = 914f1aff87249c09b6859b88b1906d30756491ca" >> copy-pull/.hg/hgrc
- works without cacerts
- $ hg -R copy-pull id https://localhost:$HGPORT/ --config web.cacerts=
+ $ hg -R copy-pull id https://localhost:$HGPORT/ --config web.cacerts=!
5fed3813f7f5
- fails when cert doesn't match hostname (port is ignored)
@@ -267,8 +271,8 @@
Test unvalidated https through proxy
$ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure --traceback
+ pulling from https://localhost:$HGPORT/
warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
- pulling from https://localhost:$HGPORT/
searching for changes
no changes found
@@ -286,8 +290,10 @@
Test https with cert problems through proxy
$ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --config web.cacerts=pub-other.pem
+ pulling from https://localhost:$HGPORT/
abort: error: *certificate verify failed* (glob)
[255]
$ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --config web.cacerts=pub-expired.pem https://localhost:$HGPORT2/
+ pulling from https://localhost:$HGPORT2/
abort: error: *certificate verify failed* (glob)
[255]
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-import-bypass.t
--- a/tests/test-import-bypass.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-import-bypass.t Thu Apr 02 16:51:00 2015 -0500
@@ -104,6 +104,86 @@
$ hg rollback
repository tip rolled back to revision 1 (undo import)
+Test --strip with --bypass
+
+ $ mkdir -p dir/dir2
+ $ echo bb > dir/dir2/b
+ $ echo cc > dir/dir2/c
+ $ echo d > dir/d
+ $ hg ci -Am 'addabcd'
+ adding dir/d
+ adding dir/dir2/b
+ adding dir/dir2/c
+ $ shortlog
+ @ 2:d805bc8236b6 test 0 0 - default - addabcd
+ |
+ | o 1:4e322f7ce8e3 test 0 0 - foo - changea
+ |/
+ o 0:07f494440405 test 0 0 - default - adda
+
+ $ hg import --bypass --strip 2 --prefix dir/ - < # HG changeset patch
+ > # User test
+ > # Date 0 0
+ > # Branch foo
+ > changeabcd
+ >
+ > diff --git a/foo/a b/foo/a
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/foo/a
+ > @@ -0,0 +1 @@
+ > +a
+ > diff --git a/foo/dir2/b b/foo/dir2/b2
+ > rename from foo/dir2/b
+ > rename to foo/dir2/b2
+ > diff --git a/foo/dir2/c b/foo/dir2/c
+ > --- a/foo/dir2/c
+ > +++ b/foo/dir2/c
+ > @@ -0,0 +1 @@
+ > +cc
+ > diff --git a/foo/d b/foo/d
+ > deleted file mode 100644
+ > --- a/foo/d
+ > +++ /dev/null
+ > @@ -1,1 +0,0 @@
+ > -d
+ > EOF
+ applying patch from stdin
+
+ $ shortlog
+ o 3:5bd46886ca3e test 0 0 - default - changeabcd
+ |
+ @ 2:d805bc8236b6 test 0 0 - default - addabcd
+ |
+ | o 1:4e322f7ce8e3 test 0 0 - foo - changea
+ |/
+ o 0:07f494440405 test 0 0 - default - adda
+
+ $ hg diff --change 3 --git
+ diff --git a/dir/a b/dir/a
+ new file mode 100644
+ --- /dev/null
+ +++ b/dir/a
+ @@ -0,0 +1,1 @@
+ +a
+ diff --git a/dir/d b/dir/d
+ deleted file mode 100644
+ --- a/dir/d
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -d
+ diff --git a/dir/dir2/b b/dir/dir2/b2
+ rename from dir/dir2/b
+ rename to dir/dir2/b2
+ diff --git a/dir/dir2/c b/dir/dir2/c
+ --- a/dir/dir2/c
+ +++ b/dir/dir2/c
+ @@ -1,1 +1,2 @@
+ cc
+ +cc
+ $ hg -q --config extensions.strip= strip .
+
Test unsupported combinations
$ hg import --bypass --no-commit ../test.diff
@@ -112,6 +192,9 @@
$ hg import --bypass --similarity 50 ../test.diff
abort: cannot use --similarity with --bypass
[255]
+ $ hg import --exact --prefix dir/ ../test.diff
+ abort: cannot use --exact with --prefix
+ [255]
Test commit editor
(this also tests that editor is invoked, if the patch doesn't contain
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-import-git.t
--- a/tests/test-import-git.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-import-git.t Thu Apr 02 16:51:00 2015 -0500
@@ -612,12 +612,114 @@
a
R a
-Renames, similarity and git diff
+Prefix with strip, renames, creates etc
$ hg revert -aC
undeleting a
forgetting b
$ rm b
+ $ mkdir -p dir/dir2
+ $ echo b > dir/dir2/b
+ $ echo c > dir/dir2/c
+ $ echo d > dir/d
+ $ hg ci -Am addbcd
+ adding dir/d
+ adding dir/dir2/b
+ adding dir/dir2/c
+
+prefix '.' is the same as no prefix
+ $ hg import --no-commit --prefix . - < diff --git a/dir/a b/dir/a
+ > --- /dev/null
+ > +++ b/dir/a
+ > @@ -0,0 +1 @@
+ > +aaaa
+ > diff --git a/dir/d b/dir/d
+ > --- a/dir/d
+ > +++ b/dir/d
+ > @@ -1,1 +1,2 @@
+ > d
+ > +dddd
+ > EOF
+ applying patch from stdin
+ $ cat dir/a
+ aaaa
+ $ cat dir/d
+ d
+ dddd
+ $ hg revert -aC
+ forgetting dir/a (glob)
+ reverting dir/d (glob)
+ $ rm dir/a
+
+prefix with default strip
+ $ hg import --no-commit --prefix dir/ - < diff --git a/a b/a
+ > --- /dev/null
+ > +++ b/a
+ > @@ -0,0 +1 @@
+ > +aaa
+ > diff --git a/d b/d
+ > --- a/d
+ > +++ b/d
+ > @@ -1,1 +1,2 @@
+ > d
+ > +dd
+ > EOF
+ applying patch from stdin
+ $ cat dir/a
+ aaa
+ $ cat dir/d
+ d
+ dd
+ $ hg revert -aC
+ forgetting dir/a (glob)
+ reverting dir/d (glob)
+ $ rm dir/a
+(test that prefixes are relative to the cwd)
+ $ mkdir tmpdir
+ $ cd tmpdir
+ $ hg import --no-commit -p2 --prefix ../dir/ - < diff --git a/foo/a b/foo/a
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/foo/a
+ > @@ -0,0 +1 @@
+ > +a
+ > diff --git a/foo/dir2/b b/foo/dir2/b2
+ > rename from foo/dir2/b
+ > rename to foo/dir2/b2
+ > diff --git a/foo/dir2/c b/foo/dir2/c
+ > --- a/foo/dir2/c
+ > +++ b/foo/dir2/c
+ > @@ -0,0 +1 @@
+ > +cc
+ > diff --git a/foo/d b/foo/d
+ > deleted file mode 100644
+ > --- a/foo/d
+ > +++ /dev/null
+ > @@ -1,1 +0,0 @@
+ > -d
+ > EOF
+ applying patch from stdin
+ $ hg st --copies
+ M dir/dir2/c
+ A dir/a
+ A dir/dir2/b2
+ dir/dir2/b
+ R dir/d
+ R dir/dir2/b
+ $ cd ..
+
+Renames, similarity and git diff
+
+ $ hg revert -aC
+ forgetting dir/a (glob)
+ undeleting dir/d (glob)
+ undeleting dir/dir2/b (glob)
+ forgetting dir/dir2/b2 (glob)
+ reverting dir/dir2/c (glob)
+ $ rm dir/a dir/dir2/b2
$ hg import --similarity 90 --no-commit - < diff --git a/a b/b
> rename from a
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-import.t
--- a/tests/test-import.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-import.t Thu Apr 02 16:51:00 2015 -0500
@@ -670,6 +670,25 @@
$ hg status
$ cat a
bb
+
+test --prefix
+
+ $ mkdir -p dir/dir2
+ $ echo b > dir/dir2/b
+ $ hg ci -Am b
+ adding dir/dir2/b
+ $ hg import -p2 --prefix dir - << EOF
+ > foobar
+ > --- drop1/drop2/dir2/b
+ > +++ drop1/drop2/dir2/b
+ > @@ -1,1 +1,1 @@
+ > -b
+ > +cc
+ > EOF
+ applying patch from stdin
+ $ hg status
+ $ cat dir/dir2/b
+ cc
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-keyword.t
--- a/tests/test-keyword.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-keyword.t Thu Apr 02 16:51:00 2015 -0500
@@ -473,18 +473,24 @@
$ hg -v record -l msg -d '12 2' r< y
+ > y
> EOF
diff --git a/r b/r
new file mode 100644
examine changes to 'r'? [Ynesfdaq?] y
+ @@ -0,0 +1,1 @@
+ +$Id$
+ record this change to 'r'? [Ynesfdaq?] y
+
+ resolving manifests
+ patching file r
committing files:
r
committing manifest
committing changelog
committed changeset 3:82a2f715724d
overwriting r expanding keywords
- - status call required for dirstate.normallookup() check
$ hg status r
$ hg --verbose rollback
repository tip rolled back to revision 2 (undo commit)
@@ -501,11 +507,18 @@
$ hg add i
$ hg --verbose record -d '13 1' -m recignored< y
+ > y
> EOF
diff --git a/i b/i
new file mode 100644
examine changes to 'i'? [Ynesfdaq?] y
+ @@ -0,0 +1,1 @@
+ +$Id$
+ record this change to 'i'? [Ynesfdaq?] y
+
+ resolving manifests
+ patching file i
committing files:
i
committing manifest
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-largefiles-cache.t Thu Apr 02 16:51:00 2015 -0500
@@ -136,7 +136,7 @@
#endif
Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say
-it is missing, but a remove on a nonexistant unknown file still should. Same
+it is missing, but a remove on a nonexistent unknown file still should. Same
for a forget.)
$ cd src
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-largefiles-misc.t
--- a/tests/test-largefiles-misc.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-largefiles-misc.t Thu Apr 02 16:51:00 2015 -0500
@@ -248,7 +248,7 @@
commit: 1 subrepos
update: (current)
$ hg ci -m "this commit should fail without -S"
- abort: uncommitted changes in subrepo subrepo
+ abort: uncommitted changes in subrepository 'subrepo'
(use --subrepos for recursive commit)
[255]
@@ -362,6 +362,14 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg status -S
+ $ hg forget -v subrepo/large.txt
+ removing subrepo/large.txt (glob)
+
+Test reverting a forgotten file
+ $ hg revert -R subrepo subrepo/large.txt
+ $ hg status -SA subrepo/large.txt
+ C subrepo/large.txt
+
$ hg rm -v subrepo/large.txt
removing subrepo/large.txt (glob)
$ hg revert -R subrepo subrepo/large.txt
@@ -443,6 +451,10 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: anotherlarge
+ $ hg --debug log -T '{rev}: {desc}\n' ../sub/anotherlarge
+ updated patterns: ['../.hglf/sub/../sub/anotherlarge', '../sub/anotherlarge']
+ 1: anotherlarge
+
$ hg log -G anotherlarge
@ changeset: 1:9627a577c5e9
| tag: tip
@@ -450,6 +462,30 @@
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: anotherlarge
|
+
+ $ hg log glob:another*
+ changeset: 1:9627a577c5e9
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: anotherlarge
+
+ $ hg --debug log -T '{rev}: {desc}\n' -G glob:another*
+ updated patterns: ['glob:../.hglf/sub/another*', 'glob:another*']
+ @ 1: anotherlarge
+ |
+
+#if no-msys
+ $ hg --debug log -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
+ updated patterns: ['glob:../.hglf/sub/another*']
+ 1: anotherlarge
+
+ $ hg --debug log -G -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
+ updated patterns: ['glob:../.hglf/sub/another*']
+ @ 1: anotherlarge
+ |
+#endif
+
$ echo more >> anotherlarge
$ hg st .
M anotherlarge
@@ -460,8 +496,33 @@
? sub/anotherlarge.orig
$ cd ..
+Test glob logging from the root dir
+ $ hg log glob:**another*
+ changeset: 1:9627a577c5e9
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: anotherlarge
+
+ $ hg log -G glob:**another*
+ @ changeset: 1:9627a577c5e9
+ | tag: tip
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: anotherlarge
+ |
+
$ cd ..
+Log from outer space
+ $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/sub/anotherlarge'
+ updated patterns: ['addrm2/.hglf/sub/anotherlarge', 'addrm2/sub/anotherlarge']
+ 1: anotherlarge
+ $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/.hglf/sub/anotherlarge'
+ updated patterns: ['addrm2/.hglf/sub/anotherlarge']
+ 1: anotherlarge
+
+
Check error message while exchange
=========================================================
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-largefiles.t
--- a/tests/test-largefiles.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-largefiles.t Thu Apr 02 16:51:00 2015 -0500
@@ -1183,12 +1183,12 @@
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files (+1 heads)
- 0 largefiles cached
rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
Invoking status precommit hook
M sub/normal4
M sub2/large6
saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
+ 0 largefiles cached
$ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
$ hg log --template '{rev}:{node|short} {desc|firstline}\n'
9:598410d3eb9a modify normal file largefile in repo d
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-log.t
--- a/tests/test-log.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-log.t Thu Apr 02 16:51:00 2015 -0500
@@ -46,18 +46,31 @@
$ hg ci -me -d '5 0'
Make sure largefiles doesn't interfere with logging a regular file
- $ hg log a --config extensions.largefiles=
- changeset: 0:9161b9aeaf16
- user: test
- date: Thu Jan 01 00:00:01 1970 +0000
- summary: a
-
+ $ hg --debug log a -T '{rev}: {desc}\n' --config extensions.largefiles=
+ updated patterns: ['.hglf/a', 'a']
+ 0: a
$ hg log a
changeset: 0:9161b9aeaf16
user: test
date: Thu Jan 01 00:00:01 1970 +0000
summary: a
+ $ hg log glob:a*
+ changeset: 3:2ca5ba701980
+ user: test
+ date: Thu Jan 01 00:00:04 1970 +0000
+ summary: d
+
+ changeset: 0:9161b9aeaf16
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: a
+
+ $ hg --debug log glob:a* -T '{rev}: {desc}\n' --config extensions.largefiles=
+ updated patterns: ['glob:.hglf/a*', 'glob:a*']
+ 3: d
+ 0: a
+
log on directory
$ hg log dir
@@ -634,7 +647,7 @@
-log -f -r 1:tip
+log -f -r '1 + 4'
$ hg up -C 0
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -642,25 +655,24 @@
$ hg ci -Amb2 -d '1 0'
adding b2
created new head
- $ hg log -f -r 1:tip
+ $ hg log -f -r '1 + 4'
+ changeset: 4:ddb82e70d1a1
+ tag: tip
+ parent: 0:67e992f2c4f3
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: b2
+
changeset: 1:3d5bf5654eda
user: test
date: Thu Jan 01 00:00:01 1970 +0000
summary: r1
- changeset: 2:60c670bf5b30
+ changeset: 0:67e992f2c4f3
user: test
date: Thu Jan 01 00:00:01 1970 +0000
- summary: r2
+ summary: base
- changeset: 3:e62f78d544b4
- parent: 1:3d5bf5654eda
- user: test
- date: Thu Jan 01 00:00:01 1970 +0000
- summary: b1
-
-
-
log -f -r null
$ hg log -f -r null
@@ -675,10 +687,17 @@
+log -f with null parent
+
+ $ hg up -C null
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ $ hg log -f
+
+
log -r . with two parents
$ hg up -C 3
- 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
@@ -1342,6 +1361,11 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: add foo, related
+ changeset: 2:c4c64aedf0f7
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: add unrelated old foo
+
$ cd ..
Issue2383: hg log showing _less_ differences than hg diff
@@ -1599,6 +1623,25 @@
user:
date: Thu Jan 01 00:00:00 1970 +0000
+working-directory revision requires special treatment
+
+ $ hg log -r 'wdir()'
+ changeset: 0:65624cd9070a+
+ user: test
+ date: [A-Za-z0-9:+ ]+ (re)
+
+ $ hg log -r 'wdir()' -q
+ 0:65624cd9070a+
+
+ $ hg log -r 'wdir()' --debug
+ changeset: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08+
+ phase: draft
+ parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
+ parent: -1:0000000000000000000000000000000000000000
+ user: test
+ date: [A-Za-z0-9:+ ]+ (re)
+ extra: branch=default
+
Check that adding an arbitrary name shows up in log automatically
$ cat > ../names.py < file1
+ $ echo b > file2
+ $ echo c > file3
+ $ hg ci -Aqm 'initial'
+ $ echo d > file2
+ $ hg ci -m 'modify file2'
+
+Check that 'hg verify', which uses manifest.readdelta(), works
+
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 3 files, 2 changesets, 4 total revisions
+
+Check that manifest revlog is smaller than for v1
+
+ $ hg debugindex -m
+ rev offset length base linkrev nodeid p1 p2
+ 0 0 81 0 0 57361477c778 000000000000 000000000000
+ 1 81 33 0 1 aeaab5a2ef74 57361477c778 000000000000
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-merge-tools.t
--- a/tests/test-merge-tools.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-merge-tools.t Thu Apr 02 16:51:00 2015 -0500
@@ -603,7 +603,8 @@
true.priority=1
true.executable=cat
# hg update -C 1
- $ hg debugsetparent 0
+ $ hg update -q 0
+ $ hg revert -q -r 1 .
$ hg update -r 2
merging f
revision 1
@@ -628,7 +629,8 @@
true.priority=1
true.executable=cat
# hg update -C 1
- $ hg debugsetparent 0
+ $ hg update -q 0
+ $ hg revert -q -r 1 .
$ hg update -r 2 --tool false
merging f
merging f failed!
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-module-imports.t
--- a/tests/test-module-imports.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-module-imports.t Thu Apr 02 16:51:00 2015 -0500
@@ -21,6 +21,9 @@
these may expose other cycles.
$ hg locate 'mercurial/**.py' | sed 's-\\-/-g' | xargs python "$import_checker"
+ mercurial/crecord.py mixed imports
+ stdlib: fcntl, termios
+ relative: curses
mercurial/dispatch.py mixed imports
stdlib: commands
relative: error, extensions, fancyopts, hg, hook, util
@@ -36,4 +39,4 @@
mercurial/ui.py mixed imports
stdlib: formatter
relative: config, error, scmutil, util
- Import cycle: mercurial.cmdutil -> mercurial.context -> mercurial.subrepo -> mercurial.cmdutil -> mercurial.cmdutil
+ Import cycle: mercurial.cmdutil -> mercurial.context -> mercurial.subrepo -> mercurial.cmdutil
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-mq-eol.t
--- a/tests/test-mq-eol.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-mq-eol.t Thu Apr 02 16:51:00 2015 -0500
@@ -60,7 +60,7 @@
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file a.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh eol.diff
[2]
$ hg qpop
@@ -72,7 +72,7 @@
$ hg --config patch.eol='LFCR' qpush
applying eol.diff
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh eol.diff
[2]
$ hg qpop
@@ -169,7 +169,7 @@
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file a.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh patch1
[2]
$ hg qpop
@@ -192,7 +192,7 @@
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file a.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh patch1
[2]
$ hg qpop
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-mq-missingfiles.t
--- a/tests/test-mq-missingfiles.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-mq-missingfiles.t Thu Apr 02 16:51:00 2015 -0500
@@ -44,7 +44,7 @@
unable to find 'b' for patching
2 out of 2 hunks FAILED -- saving rejects to file b.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh changeb
[2]
@@ -97,7 +97,7 @@
2 out of 2 hunks FAILED -- saving rejects to file bb.rej
b not tracked!
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh changebb
[2]
$ cat a
@@ -149,7 +149,7 @@
unable to find 'b' for patching
1 out of 1 hunks FAILED -- saving rejects to file b.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh changeb
[2]
$ hg st
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-mq-qpush-exact.t
--- a/tests/test-mq-qpush-exact.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-mq-qpush-exact.t Thu Apr 02 16:51:00 2015 -0500
@@ -203,7 +203,7 @@
file fp0 already exists
1 out of 1 hunks FAILED -- saving rejects to file fp0.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh p0
[2]
$ cat fp0
@@ -230,7 +230,7 @@
file fp1 already exists
1 out of 1 hunks FAILED -- saving rejects to file fp1.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh p1
[2]
$ cat fp1
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-mq-qpush-fail.t
--- a/tests/test-mq-qpush-fail.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-mq-qpush-fail.t Thu Apr 02 16:51:00 2015 -0500
@@ -284,7 +284,7 @@
b
committing manifest
committing changelog
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh p3
[2]
$ cat a.orig
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-mq-subrepo-svn.t
--- a/tests/test-mq-subrepo-svn.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-mq-subrepo-svn.t Thu Apr 02 16:51:00 2015 -0500
@@ -50,7 +50,7 @@
$ cd ..
$ hg status -S # doesn't show status for svn subrepos (yet)
$ hg qnew -m1 1.diff
- abort: uncommitted changes in subrepository sub
+ abort: uncommitted changes in subrepository 'sub'
[255]
$ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-mq-subrepo.t
--- a/tests/test-mq-subrepo.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-mq-subrepo.t Thu Apr 02 16:51:00 2015 -0500
@@ -102,7 +102,7 @@
A .hgsub
A sub/a
% qnew -X path:no-effect -m0 0.diff
- abort: uncommitted changes in subrepository sub
+ abort: uncommitted changes in subrepository 'sub'
[255]
% update substate when adding .hgsub w/clean updated subrepo
A .hgsub
@@ -117,7 +117,7 @@
M .hgsub
A sub2/a
% qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
- abort: uncommitted changes in subrepository sub2
+ abort: uncommitted changes in subrepository 'sub2'
[255]
% update substate when modifying .hgsub w/clean updated subrepo
M .hgsub
@@ -161,7 +161,7 @@
A .hgsub
A sub/a
% qrefresh
- abort: uncommitted changes in subrepository sub
+ abort: uncommitted changes in subrepository 'sub'
[255]
% update substate when adding .hgsub w/clean updated subrepo
A .hgsub
@@ -177,7 +177,7 @@
M .hgsub
A sub2/a
% qrefresh
- abort: uncommitted changes in subrepository sub2
+ abort: uncommitted changes in subrepository 'sub2'
[255]
% update substate when modifying .hgsub w/clean updated subrepo
M .hgsub
@@ -295,7 +295,12 @@
new file mode 100644
examine changes to '.hgsub'? [Ynesfdaq?] y
- abort: uncommitted changes in subrepository sub
+ @@ -0,0 +1,1 @@
+ +sub = sub
+ record this change to '.hgsub'? [Ynesfdaq?] y
+
+ warning: subrepo spec file .hgsub not found
+ abort: uncommitted changes in subrepository 'sub'
[255]
% update substate when adding .hgsub w/clean updated subrepo
A .hgsub
@@ -304,10 +309,14 @@
new file mode 100644
examine changes to '.hgsub'? [Ynesfdaq?] y
+ @@ -0,0 +1,1 @@
+ +sub = sub
+ record this change to '.hgsub'? [Ynesfdaq?] y
+
+ warning: subrepo spec file .hgsub not found
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
-
$ testmod qrecord --config ui.interactive=1 -m1 1.diff < y
> y
@@ -326,7 +335,7 @@
+sub2 = sub2
record this change to '.hgsub'? [Ynesfdaq?] y
- abort: uncommitted changes in subrepository sub2
+ abort: uncommitted changes in subrepository 'sub2'
[255]
% update substate when modifying .hgsub w/clean updated subrepo
M .hgsub
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-mq.t
--- a/tests/test-mq.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-mq.t Thu Apr 02 16:51:00 2015 -0500
@@ -870,7 +870,7 @@
file foo already exists
1 out of 1 hunks FAILED -- saving rejects to file foo.rej
patch failed, unable to continue (try -v)
- patch failed, rejects left in working dir
+ patch failed, rejects left in working directory
errors during apply, please fix and refresh bar
[2]
$ hg st
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-obsolete-tag-cache.t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-obsolete-tag-cache.t Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,70 @@
+ $ cat >> $HGRCPATH << EOF
+ > [extensions]
+ > rebase=
+ >
+ > [experimental]
+ > evolution = createmarkers
+ > EOF
+
+Create a repo with some tags
+
+ $ hg init repo
+ $ cd repo
+ $ echo initial > foo
+ $ hg -q commit -A -m initial
+ $ hg tag -m 'test tag' test1
+ $ echo first > first
+ $ hg -q commit -A -m first
+ $ hg tag -m 'test2 tag' test2
+ $ hg -q up -r 0
+ $ echo newhead > newhead
+ $ hg commit -A -m newhead
+ adding newhead
+ created new head
+
+Trigger tags cache population by doing something that accesses tags info
+
+ $ hg log -G -T '{rev}:{node|short} {tags} {desc}\n'
+ @ 4:042eb6bfcc49 tip newhead
+ |
+ | o 3:c3cb30f2d2cd test2 tag
+ | |
+ | o 2:d75775ffbc6b test2 first
+ | |
+ | o 1:5f97d42da03f test tag
+ |/
+ o 0:55482a6fb4b1 test1 initial
+
+
+ $ cat .hg/cache/tags
+ 4 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41
+ 3 c3cb30f2d2cd0aae008cc91a07876e3c5131fd22 b3bce87817fe7ac9dca2834366c1d7534c095cf1
+
+ 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
+ d75775ffbc6bca1794d300f5571272879bd280da test2
+
+Create some hidden changesets via a rebase and trigger tags cache
+repopulation
+
+ $ hg -q rebase -s 1 -d 4
+ $ hg log -G -T '{rev}:{node|short} {tags} {desc}\n'
+ o 7:eb610439e10e tip test2 tag
+ |
+ o 6:7b4af00c3c83 first
+ |
+ o 5:43ac2a539b3c test tag
+ |
+ @ 4:042eb6bfcc49 newhead
+ |
+ o 0:55482a6fb4b1 test1 initial
+
+
+.hgtags filenodes for hidden heads should be visible (issue4550)
+(currently broken)
+
+ $ cat .hg/cache/tags
+ 7 eb610439e10e0c6b296f97b59624c2e24fc59e30 b3bce87817fe7ac9dca2834366c1d7534c095cf1
+
+ 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
+ d75775ffbc6bca1794d300f5571272879bd280da test2
+
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-obsolete.t
--- a/tests/test-obsolete.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-obsolete.t Thu Apr 02 16:51:00 2015 -0500
@@ -11,7 +11,7 @@
> hg ci -m "add $1"
> }
$ getid() {
- > hg id --debug --hidden -ir "desc('$1')"
+ > hg log -T "{node}\n" --hidden -r "desc('$1')"
> }
$ cat > debugkeys.py < foo
+ $ hg add foo
+ $ hg ci -m "content-0"
+
+ $ hg up null
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ echo "1" > bar
+ $ hg add bar
+ $ hg ci -m "content-1"
+ created new head
+ $ hg up 0
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ hg graft 1
+ grafting 1:1c9eddb02162 "content-1" (tip)
+
+ $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
+
+ $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+ $ cat hg.pid >> $DAEMON_PIDS
+
+ $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/1'
+ 404 Not Found
+ [1]
+ $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'file/tip/bar'
+ 200 Script output follows
+ $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'annotate/tip/bar'
+ 200 Script output follows
+
+ $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
+
+#endif
+
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-phases.t
--- a/tests/test-phases.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-phases.t Thu Apr 02 16:51:00 2015 -0500
@@ -456,8 +456,12 @@
o 0 public A
-move changeset forward and backward
+move changeset forward and backward and test kill switch
+ $ cat <> $HGRCPATH
+ > [experimental]
+ > nativephaseskillswitch = true
+ > EOF
$ hg phase --draft --force 1::4
$ hg log -G --template "{rev} {phase} {desc}\n"
@ 7 secret merge B' and E
@@ -478,6 +482,10 @@
test partial failure
+ $ cat <> $HGRCPATH
+ > [experimental]
+ > nativephaseskillswitch = false
+ > EOF
$ hg phase --public 7
$ hg phase --draft '5 or 7'
cannot move 1 changesets to a higher phase, use --force
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-pull.t
--- a/tests/test-pull.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-pull.t Thu Apr 02 16:51:00 2015 -0500
@@ -76,7 +76,7 @@
abort: file:// URLs can only refer to localhost
[255]
- $ hg pull -q file:../test
+ $ hg pull -q file:../test # no-msys
It's tricky to make file:// URLs working on every platform with
regular shell commands.
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-push-warn.t
--- a/tests/test-push-warn.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-push-warn.t Thu Apr 02 16:51:00 2015 -0500
@@ -19,6 +19,14 @@
$ hg add t3
$ hg commit -m "3"
+Specifying a revset that evaluates to null will abort
+
+ $ hg push -r '0 & 1' ../a
+ pushing to ../a
+ abort: specified revisions evaluate to an empty set
+ (use different revision arguments)
+ [255]
+
$ hg push ../a
pushing to ../a
searching for changes
@@ -411,7 +419,7 @@
adding c
created new head
- $ for i in `seq 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
+ $ for i in `python $TESTDIR/seq.py 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
$ hg -R i push h
pushing to h
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-qrecord.t
--- a/tests/test-qrecord.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-qrecord.t Thu Apr 02 16:51:00 2015 -0500
@@ -60,7 +60,7 @@
committing
--close-branch mark a branch as closed, hiding it from the branch
list
- --amend amend the parent of the working dir
+ --amend amend the parent of the working directory
-s --secret use the secret phase for committing
-e --edit invoke editor on commit messages
-I --include PATTERN [+] include names matching the given patterns
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-rebase-conflicts.t Thu Apr 02 16:51:00 2015 -0500
@@ -322,6 +322,6 @@
files: 1/1 chunks (100.00%)
added 2 changesets with 2 changes to 1 files
invalid branchheads cache (served): tip differs
- truncating cache/rbc-revs-v1 to 72
rebase completed
updating the branch cache
+ truncating cache/rbc-revs-v1 to 72
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-rebase-named-branches.t
--- a/tests/test-rebase-named-branches.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-rebase-named-branches.t Thu Apr 02 16:51:00 2015 -0500
@@ -352,7 +352,7 @@
$ hg ci -qm 'c2 closed' --close
$ hg up -qr 2
$ hg tglog
- o 4: 'c2 closed' c
+ _ 4: 'c2 closed' c
|
o 3: 'b1' b
|
@@ -366,7 +366,7 @@
nothing to rebase - working directory parent is also destination
[1]
$ hg tglog
- o 4: 'c2 closed' c
+ _ 4: 'c2 closed' c
|
o 3: 'b1' b
|
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-rebase-pull.t
--- a/tests/test-rebase-pull.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-rebase-pull.t Thu Apr 02 16:51:00 2015 -0500
@@ -165,5 +165,47 @@
|
o 0: 'C1'
+pull --rebase works with bundle2 turned on
-
+ $ cd ../a
+ $ echo R4 > R4
+ $ hg ci -Am R4
+ adding R4
+ $ hg tglog
+ @ 5: 'R4'
+ |
+ o 4: 'R3'
+ |
+ o 3: 'R2'
+ |
+ o 2: 'R1'
+ |
+ o 1: 'C2'
+ |
+ o 0: 'C1'
+
+ $ cd ../c
+ $ hg pull --rebase --config experimental.bundle2-exp=True --config experimental.strip-bundle2-version=02
+ pulling from $TESTTMP/a (glob)
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files (+1 heads)
+ rebasing 5:518d153c0ba3 "L1"
+ saved backup bundle to $TESTTMP/c/.hg/strip-backup/518d153c0ba3-73407f14-backup.hg (glob)
+ $ hg tglog
+ @ 6: 'L1'
+ |
+ o 5: 'R4'
+ |
+ o 4: 'R3'
+ |
+ o 3: 'R2'
+ |
+ o 2: 'R1'
+ |
+ o 1: 'C2'
+ |
+ o 0: 'C1'
+
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-record.t
--- a/tests/test-record.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-record.t Thu Apr 02 16:51:00 2015 -0500
@@ -10,6 +10,59 @@
$ hg init a
$ cd a
+Record help
+
+ $ hg record -h
+ hg record [OPTION]... [FILE]...
+
+ interactively select changes to commit
+
+ If a list of files is omitted, all changes reported by "hg status" will be
+ candidates for recording.
+
+ See "hg help dates" for a list of formats valid for -d/--date.
+
+ You will be prompted for whether to record changes to each modified file,
+ and for files with multiple changes, for each change to use. For each
+ query, the following responses are possible:
+
+ y - record this change
+ n - skip this change
+ e - edit this change manually
+
+ s - skip remaining changes to this file
+ f - record remaining changes to this file
+
+ d - done, skip remaining changes and files
+ a - record all changes to all remaining files
+ q - quit, recording no changes
+
+ ? - display help
+
+ This command is not available when committing a merge.
+
+ options ([+] can be repeated):
+
+ -A --addremove mark new/missing files as added/removed before
+ committing
+ --close-branch mark a branch as closed, hiding it from the branch
+ list
+ --amend amend the parent of the working directory
+ -s --secret use the secret phase for committing
+ -e --edit invoke editor on commit messages
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+ -m --message TEXT use text as commit message
+ -l --logfile FILE read commit message from file
+ -d --date DATE record the specified date as commit date
+ -u --user USER record the specified user as committer
+ -S --subrepos recurse into subrepositories
+ -w --ignore-all-space ignore white space when comparing lines
+ -b --ignore-space-change ignore changes in the amount of white space
+ -B --ignore-blank-lines ignore changes whose lines are all blank
+
+ (some details hidden, use --verbose to show complete help)
+
Select no files
$ touch empty-rw
@@ -32,1348 +85,4 @@
-Select files but no hunks
- $ hg record empty-rw< y
- > n
- > EOF
- diff --git a/empty-rw b/empty-rw
- new file mode 100644
- examine changes to 'empty-rw'? [Ynesfdaq?] y
-
- abort: empty commit message
- [255]
-
- $ hg tip -p
- changeset: -1:000000000000
- tag: tip
- user:
- date: Thu Jan 01 00:00:00 1970 +0000
-
-
-
-Record empty file
-
- $ hg record -d '0 0' -m empty empty-rw< y
- > y
- > EOF
- diff --git a/empty-rw b/empty-rw
- new file mode 100644
- examine changes to 'empty-rw'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 0:c0708cf4e46e
- tag: tip
- user: test
- date: Thu Jan 01 00:00:00 1970 +0000
- summary: empty
-
-
-
-Summary shows we updated to the new cset
-
- $ hg summary
- parent: 0:c0708cf4e46e tip
- empty
- branch: default
- commit: (clean)
- update: (current)
-
-Rename empty file
-
- $ hg mv empty-rw empty-rename
- $ hg record -d '1 0' -m rename< y
- > EOF
- diff --git a/empty-rw b/empty-rename
- rename from empty-rw
- rename to empty-rename
- examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 1:d695e8dcb197
- tag: tip
- user: test
- date: Thu Jan 01 00:00:01 1970 +0000
- summary: rename
-
-
-
-Copy empty file
-
- $ hg cp empty-rename empty-copy
- $ hg record -d '2 0' -m copy< y
- > EOF
- diff --git a/empty-rename b/empty-copy
- copy from empty-rename
- copy to empty-copy
- examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 2:1d4b90bea524
- tag: tip
- user: test
- date: Thu Jan 01 00:00:02 1970 +0000
- summary: copy
-
-
-
-Delete empty file
-
- $ hg rm empty-copy
- $ hg record -d '3 0' -m delete< y
- > EOF
- diff --git a/empty-copy b/empty-copy
- deleted file mode 100644
- examine changes to 'empty-copy'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 3:b39a238f01a1
- tag: tip
- user: test
- date: Thu Jan 01 00:00:03 1970 +0000
- summary: delete
-
-
-
-Add binary file
-
- $ hg bundle --base -2 tip.bundle
- 1 changesets found
- $ hg add tip.bundle
- $ hg record -d '4 0' -m binary< y
- > EOF
- diff --git a/tip.bundle b/tip.bundle
- new file mode 100644
- this is a binary file
- examine changes to 'tip.bundle'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 4:ad816da3711e
- tag: tip
- user: test
- date: Thu Jan 01 00:00:04 1970 +0000
- summary: binary
-
- diff -r b39a238f01a1 -r ad816da3711e tip.bundle
- Binary file tip.bundle has changed
-
-
-Change binary file
-
- $ hg bundle --base -2 tip.bundle
- 1 changesets found
- $ hg record -d '5 0' -m binary-change< y
- > EOF
- diff --git a/tip.bundle b/tip.bundle
- this modifies a binary file (all or nothing)
- examine changes to 'tip.bundle'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 5:dccd6f3eb485
- tag: tip
- user: test
- date: Thu Jan 01 00:00:05 1970 +0000
- summary: binary-change
-
- diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
- Binary file tip.bundle has changed
-
-
-Rename and change binary file
-
- $ hg mv tip.bundle top.bundle
- $ hg bundle --base -2 top.bundle
- 1 changesets found
- $ hg record -d '6 0' -m binary-change-rename< y
- > EOF
- diff --git a/tip.bundle b/top.bundle
- rename from tip.bundle
- rename to top.bundle
- this modifies a binary file (all or nothing)
- examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 6:7fa44105f5b3
- tag: tip
- user: test
- date: Thu Jan 01 00:00:06 1970 +0000
- summary: binary-change-rename
-
- diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
- Binary file tip.bundle has changed
- diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
- Binary file top.bundle has changed
-
-
-Add plain file
-
- $ for i in 1 2 3 4 5 6 7 8 9 10; do
- > echo $i >> plain
- > done
-
- $ hg add plain
- $ hg record -d '7 0' -m plain plain< y
- > y
- > EOF
- diff --git a/plain b/plain
- new file mode 100644
- examine changes to 'plain'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 7:11fb457c1be4
- tag: tip
- user: test
- date: Thu Jan 01 00:00:07 1970 +0000
- summary: plain
-
- diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/plain Thu Jan 01 00:00:07 1970 +0000
- @@ -0,0 +1,10 @@
- +1
- +2
- +3
- +4
- +5
- +6
- +7
- +8
- +9
- +10
-
-Modify end of plain file with username unset
-
- $ echo 11 >> plain
- $ unset HGUSER
- $ hg record --config ui.username= -d '8 0' -m end plain
- abort: no username supplied
- (use "hg config --edit" to set your username)
- [255]
-
-
-Modify end of plain file, also test that diffopts are accounted for
-
- $ HGUSER="test"
- $ export HGUSER
- $ hg record --config diff.showfunc=true -d '8 0' -m end plain < y
- > y
- > EOF
- diff --git a/plain b/plain
- 1 hunks, 1 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -8,3 +8,4 @@ 7
- 8
- 9
- 10
- +11
- record this change to 'plain'? [Ynesfdaq?] y
-
-
-Modify end of plain file, no EOL
-
- $ hg tip --template '{node}' >> plain
- $ hg record -d '9 0' -m noeol plain < y
- > y
- > EOF
- diff --git a/plain b/plain
- 1 hunks, 1 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -9,3 +9,4 @@
- 9
- 10
- 11
- +7264f99c5f5ff3261504828afa4fb4d406c3af54
- \ No newline at end of file
- record this change to 'plain'? [Ynesfdaq?] y
-
-
-Modify end of plain file, add EOL
-
- $ echo >> plain
- $ echo 1 > plain2
- $ hg add plain2
- $ hg record -d '10 0' -m eol plain plain2 < y
- > y
- > y
- > EOF
- diff --git a/plain b/plain
- 1 hunks, 1 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -9,4 +9,4 @@
- 9
- 10
- 11
- -7264f99c5f5ff3261504828afa4fb4d406c3af54
- \ No newline at end of file
- +7264f99c5f5ff3261504828afa4fb4d406c3af54
- record change 1/2 to 'plain'? [Ynesfdaq?] y
-
- diff --git a/plain2 b/plain2
- new file mode 100644
- examine changes to 'plain2'? [Ynesfdaq?] y
-
-
-Modify beginning, trim end, record both, add another file to test
-changes numbering
-
- $ rm plain
- $ for i in 2 2 3 4 5 6 7 8 9 10; do
- > echo $i >> plain
- > done
- $ echo 2 >> plain2
-
- $ hg record -d '10 0' -m begin-and-end plain plain2 < y
- > y
- > y
- > y
- > y
- > EOF
- diff --git a/plain b/plain
- 2 hunks, 3 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -1,4 +1,4 @@
- -1
- +2
- 2
- 3
- 4
- record change 1/3 to 'plain'? [Ynesfdaq?] y
-
- @@ -8,5 +8,3 @@
- 8
- 9
- 10
- -11
- -7264f99c5f5ff3261504828afa4fb4d406c3af54
- record change 2/3 to 'plain'? [Ynesfdaq?] y
-
- diff --git a/plain2 b/plain2
- 1 hunks, 1 lines changed
- examine changes to 'plain2'? [Ynesfdaq?] y
-
- @@ -1,1 +1,2 @@
- 1
- +2
- record change 3/3 to 'plain2'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 11:21df83db12b8
- tag: tip
- user: test
- date: Thu Jan 01 00:00:10 1970 +0000
- summary: begin-and-end
-
- diff -r ddb8b281c3ff -r 21df83db12b8 plain
- --- a/plain Thu Jan 01 00:00:10 1970 +0000
- +++ b/plain Thu Jan 01 00:00:10 1970 +0000
- @@ -1,4 +1,4 @@
- -1
- +2
- 2
- 3
- 4
- @@ -8,5 +8,3 @@
- 8
- 9
- 10
- -11
- -7264f99c5f5ff3261504828afa4fb4d406c3af54
- diff -r ddb8b281c3ff -r 21df83db12b8 plain2
- --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
- +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
- @@ -1,1 +1,2 @@
- 1
- +2
-
-
-Trim beginning, modify end
-
- $ rm plain
- > for i in 4 5 6 7 8 9 10.new; do
- > echo $i >> plain
- > done
-
-Record end
-
- $ hg record -d '11 0' -m end-only plain < y
- > n
- > y
- > EOF
- diff --git a/plain b/plain
- 2 hunks, 4 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -1,9 +1,6 @@
- -2
- -2
- -3
- 4
- 5
- 6
- 7
- 8
- 9
- record change 1/2 to 'plain'? [Ynesfdaq?] n
-
- @@ -4,7 +1,7 @@
- 4
- 5
- 6
- 7
- 8
- 9
- -10
- +10.new
- record change 2/2 to 'plain'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 12:99337501826f
- tag: tip
- user: test
- date: Thu Jan 01 00:00:11 1970 +0000
- summary: end-only
-
- diff -r 21df83db12b8 -r 99337501826f plain
- --- a/plain Thu Jan 01 00:00:10 1970 +0000
- +++ b/plain Thu Jan 01 00:00:11 1970 +0000
- @@ -7,4 +7,4 @@
- 7
- 8
- 9
- -10
- +10.new
-
-
-Record beginning
-
- $ hg record -d '12 0' -m begin-only plain < y
- > y
- > EOF
- diff --git a/plain b/plain
- 1 hunks, 3 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -1,6 +1,3 @@
- -2
- -2
- -3
- 4
- 5
- 6
- record this change to 'plain'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 13:bbd45465d540
- tag: tip
- user: test
- date: Thu Jan 01 00:00:12 1970 +0000
- summary: begin-only
-
- diff -r 99337501826f -r bbd45465d540 plain
- --- a/plain Thu Jan 01 00:00:11 1970 +0000
- +++ b/plain Thu Jan 01 00:00:12 1970 +0000
- @@ -1,6 +1,3 @@
- -2
- -2
- -3
- 4
- 5
- 6
-
-
-Add to beginning, trim from end
-
- $ rm plain
- $ for i in 1 2 3 4 5 6 7 8 9; do
- > echo $i >> plain
- > done
-
-Record end
-
- $ hg record --traceback -d '13 0' -m end-again plain< y
- > n
- > y
- > EOF
- diff --git a/plain b/plain
- 2 hunks, 4 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -1,6 +1,9 @@
- +1
- +2
- +3
- 4
- 5
- 6
- 7
- 8
- 9
- record change 1/2 to 'plain'? [Ynesfdaq?] n
-
- @@ -1,7 +4,6 @@
- 4
- 5
- 6
- 7
- 8
- 9
- -10.new
- record change 2/2 to 'plain'? [Ynesfdaq?] y
-
-
-Add to beginning, middle, end
-
- $ rm plain
- $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
- > echo $i >> plain
- > done
-
-Record beginning, middle, and test that format-breaking diffopts are ignored
-
- $ hg record --config diff.noprefix=True -d '14 0' -m middle-only plain < y
- > y
- > y
- > n
- > EOF
- diff --git a/plain b/plain
- 3 hunks, 7 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -1,2 +1,5 @@
- +1
- +2
- +3
- 4
- 5
- record change 1/3 to 'plain'? [Ynesfdaq?] y
-
- @@ -1,6 +4,8 @@
- 4
- 5
- +5.new
- +5.reallynew
- 6
- 7
- 8
- 9
- record change 2/3 to 'plain'? [Ynesfdaq?] y
-
- @@ -3,4 +8,6 @@
- 6
- 7
- 8
- 9
- +10
- +11
- record change 3/3 to 'plain'? [Ynesfdaq?] n
-
-
- $ hg tip -p
- changeset: 15:f34a7937ec33
- tag: tip
- user: test
- date: Thu Jan 01 00:00:14 1970 +0000
- summary: middle-only
-
- diff -r 82c065d0b850 -r f34a7937ec33 plain
- --- a/plain Thu Jan 01 00:00:13 1970 +0000
- +++ b/plain Thu Jan 01 00:00:14 1970 +0000
- @@ -1,5 +1,10 @@
- +1
- +2
- +3
- 4
- 5
- +5.new
- +5.reallynew
- 6
- 7
- 8
-
-
-Record end
-
- $ hg record -d '15 0' -m end-only plain < y
- > y
- > EOF
- diff --git a/plain b/plain
- 1 hunks, 2 lines changed
- examine changes to 'plain'? [Ynesfdaq?] y
-
- @@ -9,3 +9,5 @@
- 7
- 8
- 9
- +10
- +11
- record this change to 'plain'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 16:f9900b71a04c
- tag: tip
- user: test
- date: Thu Jan 01 00:00:15 1970 +0000
- summary: end-only
-
- diff -r f34a7937ec33 -r f9900b71a04c plain
- --- a/plain Thu Jan 01 00:00:14 1970 +0000
- +++ b/plain Thu Jan 01 00:00:15 1970 +0000
- @@ -9,3 +9,5 @@
- 7
- 8
- 9
- +10
- +11
-
-
- $ mkdir subdir
- $ cd subdir
- $ echo a > a
- $ hg ci -d '16 0' -Amsubdir
- adding subdir/a
-
- $ echo a >> a
- $ hg record -d '16 0' -m subdir-change a < y
- > y
- > EOF
- diff --git a/subdir/a b/subdir/a
- 1 hunks, 1 lines changed
- examine changes to 'subdir/a'? [Ynesfdaq?] y
-
- @@ -1,1 +1,2 @@
- a
- +a
- record this change to 'subdir/a'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 18:61be427a9deb
- tag: tip
- user: test
- date: Thu Jan 01 00:00:16 1970 +0000
- summary: subdir-change
-
- diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
- --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
- +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
- @@ -1,1 +1,2 @@
- a
- +a
-
-
- $ echo a > f1
- $ echo b > f2
- $ hg add f1 f2
-
- $ hg ci -mz -d '17 0'
-
- $ echo a >> f1
- $ echo b >> f2
-
-Help, quit
-
- $ hg record < ?
- > q
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] ?
-
- y - yes, record this change
- n - no, skip this change
- e - edit this change manually
- s - skip remaining changes to this file
- f - record remaining changes to this file
- d - done, skip remaining changes and files
- a - record all changes to all remaining files
- q - quit, recording no changes
- ? - ? (display help)
- examine changes to 'subdir/f1'? [Ynesfdaq?] q
-
- abort: user quit
- [255]
-
-Skip
-
- $ hg record < s
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] s
-
- diff --git a/subdir/f2 b/subdir/f2
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
- [255]
-
-No
-
- $ hg record < n
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] n
-
- diff --git a/subdir/f2 b/subdir/f2
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
- [255]
-
-f, quit
-
- $ hg record < f
- > q
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] f
-
- diff --git a/subdir/f2 b/subdir/f2
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f2'? [Ynesfdaq?] q
-
- abort: user quit
- [255]
-
-s, all
-
- $ hg record -d '18 0' -mx < s
- > a
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] s
-
- diff --git a/subdir/f2 b/subdir/f2
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f2'? [Ynesfdaq?] a
-
-
- $ hg tip -p
- changeset: 20:b3df3dda369a
- tag: tip
- user: test
- date: Thu Jan 01 00:00:18 1970 +0000
- summary: x
-
- diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
- --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
- +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
- @@ -1,1 +1,2 @@
- b
- +b
-
-
-f
-
- $ hg record -d '19 0' -my < f
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] f
-
-
- $ hg tip -p
- changeset: 21:38ec577f126b
- tag: tip
- user: test
- date: Thu Jan 01 00:00:19 1970 +0000
- summary: y
-
- diff -r b3df3dda369a -r 38ec577f126b subdir/f1
- --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
- +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
- @@ -1,1 +1,2 @@
- a
- +a
-
-
-#if execbit
-
-Preserve chmod +x
-
- $ chmod +x f1
- $ echo a >> f1
- $ hg record -d '20 0' -mz < y
- > y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- old mode 100644
- new mode 100755
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -1,2 +1,3 @@
- a
- a
- +a
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
-
- $ hg tip --config diff.git=True -p
- changeset: 22:3261adceb075
- tag: tip
- user: test
- date: Thu Jan 01 00:00:20 1970 +0000
- summary: z
-
- diff --git a/subdir/f1 b/subdir/f1
- old mode 100644
- new mode 100755
- --- a/subdir/f1
- +++ b/subdir/f1
- @@ -1,2 +1,3 @@
- a
- a
- +a
-
-
-Preserve execute permission on original
-
- $ echo b >> f1
- $ hg record -d '21 0' -maa < y
- > y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -1,3 +1,4 @@
- a
- a
- a
- +b
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
-
- $ hg tip --config diff.git=True -p
- changeset: 23:b429867550db
- tag: tip
- user: test
- date: Thu Jan 01 00:00:21 1970 +0000
- summary: aa
-
- diff --git a/subdir/f1 b/subdir/f1
- --- a/subdir/f1
- +++ b/subdir/f1
- @@ -1,3 +1,4 @@
- a
- a
- a
- +b
-
-
-Preserve chmod -x
-
- $ chmod -x f1
- $ echo c >> f1
- $ hg record -d '22 0' -mab < y
- > y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- old mode 100755
- new mode 100644
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -2,3 +2,4 @@
- a
- a
- b
- +c
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
-
- $ hg tip --config diff.git=True -p
- changeset: 24:0b082130c20a
- tag: tip
- user: test
- date: Thu Jan 01 00:00:22 1970 +0000
- summary: ab
-
- diff --git a/subdir/f1 b/subdir/f1
- old mode 100755
- new mode 100644
- --- a/subdir/f1
- +++ b/subdir/f1
- @@ -2,3 +2,4 @@
- a
- a
- b
- +c
-
-
-#else
-
-Slightly bogus tests to get almost same repo structure as when x bit is used
-- but with different hashes.
-
-Mock "Preserve chmod +x"
-
- $ echo a >> f1
- $ hg record -d '20 0' -mz < y
- > y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -1,2 +1,3 @@
- a
- a
- +a
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
-
- $ hg tip --config diff.git=True -p
- changeset: 22:0d463bd428f5
- tag: tip
- user: test
- date: Thu Jan 01 00:00:20 1970 +0000
- summary: z
-
- diff --git a/subdir/f1 b/subdir/f1
- --- a/subdir/f1
- +++ b/subdir/f1
- @@ -1,2 +1,3 @@
- a
- a
- +a
-
-
-Mock "Preserve execute permission on original"
-
- $ echo b >> f1
- $ hg record -d '21 0' -maa < y
- > y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -1,3 +1,4 @@
- a
- a
- a
- +b
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
-
- $ hg tip --config diff.git=True -p
- changeset: 23:0eab41a3e524
- tag: tip
- user: test
- date: Thu Jan 01 00:00:21 1970 +0000
- summary: aa
-
- diff --git a/subdir/f1 b/subdir/f1
- --- a/subdir/f1
- +++ b/subdir/f1
- @@ -1,3 +1,4 @@
- a
- a
- a
- +b
-
-
-Mock "Preserve chmod -x"
-
- $ chmod -x f1
- $ echo c >> f1
- $ hg record -d '22 0' -mab < y
- > y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -2,3 +2,4 @@
- a
- a
- b
- +c
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
-
- $ hg tip --config diff.git=True -p
- changeset: 24:f4f718f27b7c
- tag: tip
- user: test
- date: Thu Jan 01 00:00:22 1970 +0000
- summary: ab
-
- diff --git a/subdir/f1 b/subdir/f1
- --- a/subdir/f1
- +++ b/subdir/f1
- @@ -2,3 +2,4 @@
- a
- a
- b
- +c
-
-
-#endif
-
- $ cd ..
-
-
-Abort early when a merge is in progress
-
- $ hg up 4
- 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
-
- $ touch iwillmergethat
- $ hg add iwillmergethat
-
- $ hg branch thatbranch
- marked working directory as branch thatbranch
- (branches are permanent and global, did you want a bookmark?)
-
- $ hg ci -m'new head'
-
- $ hg up default
- 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
-
- $ hg merge thatbranch
- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
- (branch merge, don't forget to commit)
-
- $ hg record -m'will abort'
- abort: cannot partially commit a merge (use "hg commit" instead)
- [255]
-
- $ hg up -C
- 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-
-Editing patch (and ignoring trailing text)
-
- $ cat > editor.sh << '__EOF__'
- > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
- > trailing\nditto' "$1" > tmp
- > mv tmp "$1"
- > __EOF__
- $ cat > editedfile << '__EOF__'
- > This is the first line
- > This is the second line
- > This is the third line
- > __EOF__
- $ hg add editedfile
- $ hg commit -medit-patch-1
- $ cat > editedfile << '__EOF__'
- > This line has changed
- > This change will be committed
- > This is the third line
- > __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record -d '23 0' -medit-patch-2 < y
- > e
- > EOF
- diff --git a/editedfile b/editedfile
- 1 hunks, 2 lines changed
- examine changes to 'editedfile'? [Ynesfdaq?] y
-
- @@ -1,3 +1,3 @@
- -This is the first line
- -This is the second line
- +This line has changed
- +This change will be committed
- This is the third line
- record this change to 'editedfile'? [Ynesfdaq?] e
-
- $ cat editedfile
- This line has changed
- This change will be committed
- This is the third line
- $ hg cat -r tip editedfile
- This is the first line
- This change will be committed
- This is the third line
- $ hg revert editedfile
-
-Trying to edit patch for whole file
-
- $ echo "This is the fourth line" >> editedfile
- $ hg record < e
- > q
- > EOF
- diff --git a/editedfile b/editedfile
- 1 hunks, 1 lines changed
- examine changes to 'editedfile'? [Ynesfdaq?] e
-
- cannot edit patch for whole file
- examine changes to 'editedfile'? [Ynesfdaq?] q
-
- abort: user quit
- [255]
- $ hg revert editedfile
-
-Removing changes from patch
-
- $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
- $ mv tmp editedfile
- $ echo "This line has been added" >> editedfile
- $ cat > editor.sh << '__EOF__'
- > sed -e 's/^[-+]/ /' "$1" > tmp
- > mv tmp "$1"
- > __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
- > e
- > EOF
- diff --git a/editedfile b/editedfile
- 1 hunks, 3 lines changed
- examine changes to 'editedfile'? [Ynesfdaq?] y
-
- @@ -1,3 +1,3 @@
- -This is the first line
- -This change will be committed
- -This is the third line
- +This change will not be committed
- +This is the second line
- +This line has been added
- record this change to 'editedfile'? [Ynesfdaq?] e
-
- no changes to record
- $ cat editedfile
- This change will not be committed
- This is the second line
- This line has been added
- $ hg cat -r tip editedfile
- This is the first line
- This change will be committed
- This is the third line
- $ hg revert editedfile
-
-Invalid patch
-
- $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
- $ mv tmp editedfile
- $ echo "This line has been added" >> editedfile
- $ cat > editor.sh << '__EOF__'
- > sed s/This/That/ "$1" > tmp
- > mv tmp "$1"
- > __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
- > e
- > EOF
- diff --git a/editedfile b/editedfile
- 1 hunks, 3 lines changed
- examine changes to 'editedfile'? [Ynesfdaq?] y
-
- @@ -1,3 +1,3 @@
- -This is the first line
- -This change will be committed
- -This is the third line
- +This change will not be committed
- +This is the second line
- +This line has been added
- record this change to 'editedfile'? [Ynesfdaq?] e
-
- patching file editedfile
- Hunk #1 FAILED at 0
- 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
- abort: patch failed to apply
- [255]
- $ cat editedfile
- This change will not be committed
- This is the second line
- This line has been added
- $ hg cat -r tip editedfile
- This is the first line
- This change will be committed
- This is the third line
- $ cat editedfile.rej
- --- editedfile
- +++ editedfile
- @@ -1,3 +1,3 @@
- -That is the first line
- -That change will be committed
- -That is the third line
- +That change will not be committed
- +That is the second line
- +That line has been added
-
-Malformed patch - error handling
-
- $ cat > editor.sh << '__EOF__'
- > sed -e '/^@/p' "$1" > tmp
- > mv tmp "$1"
- > __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
- > e
- > EOF
- diff --git a/editedfile b/editedfile
- 1 hunks, 3 lines changed
- examine changes to 'editedfile'? [Ynesfdaq?] y
-
- @@ -1,3 +1,3 @@
- -This is the first line
- -This change will be committed
- -This is the third line
- +This change will not be committed
- +This is the second line
- +This line has been added
- record this change to 'editedfile'? [Ynesfdaq?] e
-
- abort: error parsing patch: unhandled transition: range -> range
- [255]
-
-random text in random positions is still an error
-
- $ cat > editor.sh << '__EOF__'
- > sed -e '/^@/i\
- > other' "$1" > tmp
- > mv tmp "$1"
- > __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
- > e
- > EOF
- diff --git a/editedfile b/editedfile
- 1 hunks, 3 lines changed
- examine changes to 'editedfile'? [Ynesfdaq?] y
-
- @@ -1,3 +1,3 @@
- -This is the first line
- -This change will be committed
- -This is the third line
- +This change will not be committed
- +This is the second line
- +This line has been added
- record this change to 'editedfile'? [Ynesfdaq?] e
-
- abort: error parsing patch: unhandled transition: file -> other
- [255]
-
- $ hg up -C
- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-With win32text
-
- $ echo '[extensions]' >> .hg/hgrc
- $ echo 'win32text = ' >> .hg/hgrc
- $ echo '[decode]' >> .hg/hgrc
- $ echo '** = cleverdecode:' >> .hg/hgrc
- $ echo '[encode]' >> .hg/hgrc
- $ echo '** = cleverencode:' >> .hg/hgrc
- $ echo '[patch]' >> .hg/hgrc
- $ echo 'eol = crlf' >> .hg/hgrc
-
-Ignore win32text deprecation warning for now:
-
- $ echo '[win32text]' >> .hg/hgrc
- $ echo 'warn = no' >> .hg/hgrc
-
- $ echo d >> subdir/f1
- $ hg record -d '24 0' -mw1 < y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -3,3 +3,4 @@
- a
- b
- c
- +d
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
-
- $ hg tip -p
- changeset: 28:* (glob)
- tag: tip
- user: test
- date: Thu Jan 01 00:00:24 1970 +0000
- summary: w1
-
- diff -r ???????????? -r ???????????? subdir/f1 (glob)
- --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
- +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
- @@ -3,3 +3,4 @@
- a
- b
- c
- +d
-
-Test --user when ui.username not set
- $ unset HGUSER
- $ echo e >> subdir/f1
- $ hg record --config ui.username= -d '8 0' --user xyz -m "user flag" < y
- > y
- > EOF
- diff --git a/subdir/f1 b/subdir/f1
- 1 hunks, 1 lines changed
- examine changes to 'subdir/f1'? [Ynesfdaq?] y
-
- @@ -4,3 +4,4 @@
- b
- c
- d
- +e
- record this change to 'subdir/f1'? [Ynesfdaq?] y
-
- $ hg log --template '{author}\n' -l 1
- xyz
- $ HGUSER="test"
- $ export HGUSER
-
- $ cd ..
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-rename.t
--- a/tests/test-rename.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-rename.t Thu Apr 02 16:51:00 2015 -0500
@@ -620,10 +620,16 @@
$ hg rename d1/d11/a1 .hg
abort: path contains illegal component: .hg/a1 (glob)
[255]
+ $ hg --config extensions.largefiles= rename d1/d11/a1 .hg
+ abort: path contains illegal component: .hg/a1 (glob)
+ [255]
$ hg status -C
$ hg rename d1/d11/a1 ..
abort: ../a1 not under root '$TESTTMP' (glob)
[255]
+ $ hg --config extensions.largefiles= rename d1/d11/a1 ..
+ abort: ../a1 not under root '$TESTTMP' (glob)
+ [255]
$ hg status -C
$ mv d1/d11/a1 .hg
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-resolve.t
--- a/tests/test-resolve.t Thu Apr 02 21:29:05 2015 +0900
+++ b/tests/test-resolve.t Thu Apr 02 16:51:00 2015 -0500
@@ -43,10 +43,15 @@
U file1
U file2
-resolving an unknown path should emit a warning
+ $ hg resolve -l --no-status
+ file1
+ file2
+
+resolving an unknown path should emit a warning, but not for -l
$ hg resolve -m does-not-exist
arguments do not match paths that need resolving
+ $ hg resolve -l does-not-exist
resolve the failure
@@ -59,6 +64,18 @@
R file1
U file2
+ $ hg resolve -l -Tjson
+ [
+ {
+ "path": "file1",
+ "status": "R"
+ },
+ {
+ "path": "file2",
+ "status": "U"
+ }
+ ]
+
resolve -m without paths should mark all resolved
$ hg resolve -m
@@ -69,6 +86,10 @@
$ hg resolve -l
+ $ hg resolve -l -Tjson
+ [
+ ]
+
resolve --all should abort when no merge in progress
$ hg resolve --all
diff -r e1842ef61edb -r d7cf8102bf09 tests/test-revert-interactive.t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revert-interactive.t Thu Apr 02 16:51:00 2015 -0500
@@ -0,0 +1,257 @@
+Revert interactive tests
+1 add and commit file f
+2 add commit file folder1/g
+3 add and commit file folder2/h
+4 add and commit file folder1/i
+5 commit change to file f
+6 commit changes to files folder1/g folder2/h
+7 commit changes to files folder1/g folder2/h
+8 revert interactive to commit id 2 (line 3 above), check that folder1/i is removed and
+9 make workdir match 7
+10 run the same test than 8 from within folder1 and check same expectations
+
+ $ cat < | | | | |