{author|user}@{rev}
+ title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}
|
{linenumber}
@@ -129,7 +129,7 @@ changesetparent = '
{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 --git a/mercurial/templates/monoblue/shortlog.tmpl b/mercurial/templates/monoblue/shortlog.tmpl
--- a/mercurial/templates/monoblue/shortlog.tmpl
+++ b/mercurial/templates/monoblue/shortlog.tmpl
@@ -26,8 +26,8 @@
bookmarks
branches
files
- {archives%archiveentry}
- help
+ {archives%archiveentry}
+ help
diff --git a/mercurial/templates/monoblue/summary.tmpl b/mercurial/templates/monoblue/summary.tmpl
--- a/mercurial/templates/monoblue/summary.tmpl
+++ b/mercurial/templates/monoblue/summary.tmpl
@@ -26,7 +26,7 @@
bookmarks
branches
files
- help
+ help
diff --git a/mercurial/templates/monoblue/tags.tmpl b/mercurial/templates/monoblue/tags.tmpl
--- a/mercurial/templates/monoblue/tags.tmpl
+++ b/mercurial/templates/monoblue/tags.tmpl
@@ -26,7 +26,7 @@
bookmarks
branches
files
- help
+ help
diff --git a/mercurial/templates/paper/bookmarks.tmpl b/mercurial/templates/paper/bookmarks.tmpl
--- a/mercurial/templates/paper/bookmarks.tmpl
+++ b/mercurial/templates/paper/bookmarks.tmpl
@@ -23,7 +23,6 @@
-
@@ -42,10 +41,12 @@
+
bookmark |
node |
+
{entries%bookmarkentry}
diff --git a/mercurial/templates/paper/branches.tmpl b/mercurial/templates/paper/branches.tmpl
--- a/mercurial/templates/paper/branches.tmpl
+++ b/mercurial/templates/paper/branches.tmpl
@@ -23,7 +23,6 @@
-
@@ -42,10 +41,12 @@
+
branch |
node |
+
{entries % branchentry}
diff --git a/mercurial/templates/paper/changeset.tmpl b/mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl
+++ b/mercurial/templates/paper/changeset.tmpl
@@ -48,7 +48,8 @@
date |
- {date|rfc822date} |
+ {date|rfc822date} |
+
parents |
{ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} |
@@ -68,8 +69,7 @@
[+]
diff --git a/mercurial/templates/paper/fileannotate.tmpl b/mercurial/templates/paper/fileannotate.tmpl
--- a/mercurial/templates/paper/fileannotate.tmpl
+++ b/mercurial/templates/paper/fileannotate.tmpl
@@ -68,10 +68,12 @@
+
rev |
line source |
+
{annotate%annotateline}
diff --git a/mercurial/templates/paper/filelog.tmpl b/mercurial/templates/paper/filelog.tmpl
--- a/mercurial/templates/paper/filelog.tmpl
+++ b/mercurial/templates/paper/filelog.tmpl
@@ -35,7 +35,6 @@
-
+
age |
author |
description |
+
{entries%filelogentry}
diff --git a/mercurial/templates/paper/graph.tmpl b/mercurial/templates/paper/graph.tmpl
--- a/mercurial/templates/paper/graph.tmpl
+++ b/mercurial/templates/paper/graph.tmpl
@@ -28,7 +28,6 @@
-
diff --git a/mercurial/templates/paper/index.tmpl b/mercurial/templates/paper/index.tmpl
--- a/mercurial/templates/paper/index.tmpl
+++ b/mercurial/templates/paper/index.tmpl
@@ -12,6 +12,7 @@
Mercurial {pathdef%breadcrumb}
+
Name |
Description |
@@ -20,6 +21,7 @@
|
|
+
{entries%indexentry}
diff --git a/mercurial/templates/paper/manifest.tmpl b/mercurial/templates/paper/manifest.tmpl
--- a/mercurial/templates/paper/manifest.tmpl
+++ b/mercurial/templates/paper/manifest.tmpl
@@ -39,11 +39,13 @@
+
name |
size |
permissions |
+
[up] |
diff --git a/mercurial/templates/paper/search.tmpl b/mercurial/templates/paper/search.tmpl
--- a/mercurial/templates/paper/search.tmpl
+++ b/mercurial/templates/paper/search.tmpl
@@ -43,11 +43,13 @@ Use {showunforcekw} instead.')}
+
age |
author |
description |
+
{entries}
diff --git a/mercurial/templates/paper/shortlog.tmpl b/mercurial/templates/paper/shortlog.tmpl
--- a/mercurial/templates/paper/shortlog.tmpl
+++ b/mercurial/templates/paper/shortlog.tmpl
@@ -30,7 +30,6 @@
-
+
age |
author |
description |
+
{entries%shortlogentry}
diff --git a/mercurial/templates/paper/tags.tmpl b/mercurial/templates/paper/tags.tmpl
--- a/mercurial/templates/paper/tags.tmpl
+++ b/mercurial/templates/paper/tags.tmpl
@@ -23,7 +23,6 @@
-
@@ -42,10 +41,12 @@
+
tag |
node |
+
{entries%tagentry}
diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -60,6 +60,10 @@ body {
border: 0;
}
+div.atom-logo {
+ margin-top: 10px;
+}
+
.atom-logo img{
width: 14px;
height: 14px;
@@ -104,6 +108,9 @@ a { text-decoration:none; }
.minusline { color: #dc143c; } /* crimson */
.atline { color: purple; }
+.diffstat-table {
+ margin-top: 1em;
+}
.diffstat-file {
white-space: nowrap;
font-size: 90%;
@@ -232,8 +239,9 @@ h3 {
.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 @@ h3 {
-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 --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -83,7 +83,7 @@ def _playback(journal, report, opener, v
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 @@ class transaction(object):
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 @@ class transaction(object):
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:
@@ -535,6 +542,6 @@ def rollback(opener, vfsmap, file, repor
backupentries.append((l, f, b, bool(c)))
else:
report(_("journal was created by a different version of "
- "Mercurial"))
+ "Mercurial\n"))
_playback(file, report, opener, vfsmap, entries, backupentries)
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -158,7 +158,7 @@ class ui(object):
if self.plain():
for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
- 'logtemplate', 'style',
+ 'logtemplate', 'statuscopies', 'style',
'traceback', 'verbose'):
if k in cfg['ui']:
del cfg['ui'][k]
@@ -531,10 +531,14 @@ class ui(object):
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
@@ -805,7 +809,7 @@ class ui(object):
environ = {'HGUSER': user}
if 'transplant_source' in extra:
environ.update({'HGREVISION': hex(extra['transplant_source'])})
- for label in ('source', 'rebase_source'):
+ for label in ('intermediate-source', 'source', 'rebase_source'):
if label in extra:
environ.update({'HGREVISION': extra[label]})
break
@@ -923,3 +927,48 @@ class ui(object):
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 --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -160,8 +160,11 @@ class unionfilelog(unionrevlog, filelog.
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 --git a/mercurial/util.h b/mercurial/util.h
--- a/mercurial/util.h
+++ b/mercurial/util.h
@@ -172,6 +172,22 @@ static inline uint32_t getbe32(const cha
(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,34 @@ static inline void putbe32(uint32_t x, c
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;
+}
+
+/* This should be kept in sync with normcasespecs in encoding.py. */
+enum normcase_spec {
+ NORMCASE_LOWER = -1,
+ NORMCASE_UPPER = 1,
+ NORMCASE_OTHER = 0
+};
+
+#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 --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -15,7 +15,7 @@ hide platform-specific details from the
import i18n
_ = i18n._
-import error, osutil, encoding
+import error, osutil, encoding, parsers
import errno, shutil, sys, tempfile, traceback
import re as remod
import os, time, datetime, calendar, textwrap, signal, collections
@@ -48,6 +48,8 @@ makedir = platform.makedir
nlinks = platform.nlinks
normpath = platform.normpath
normcase = platform.normcase
+normcasespec = platform.normcasespec
+normcasefallback = platform.normcasefallback
openhardlinks = platform.openhardlinks
oslink = platform.oslink
parsepatchoutput = platform.parsepatchoutput
@@ -57,6 +59,7 @@ posixfile = platform.posixfile
quotecommand = platform.quotecommand
readpipe = platform.readpipe
rename = platform.rename
+removedirs = platform.removedirs
samedevice = platform.samedevice
samefile = platform.samefile
samestat = platform.samestat
@@ -359,8 +362,10 @@ class sortdict(dict):
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 +742,27 @@ def copyfile(src, dest, hardlink=False):
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 +774,8 @@ def copyfiles(src, dst, hardlink=None):
else:
shutil.copy(src, dst)
num += 1
+ progress(topic, num)
+ progress(topic, None)
return hardlink, num
@@ -1352,11 +1366,11 @@ def parsedate(date, formats=None, bias={
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')
@@ -2227,5 +2241,50 @@ def debugstacktrace(msg='stacktrace', sk
f.write(' %-*s in %s\n' % (fnmax, fnln, func))
f.flush()
+class dirs(object):
+ '''a multiset of directory names from a dirstate or manifest'''
+
+ def __init__(self, map, skip=None):
+ self._dirs = {}
+ addpath = self.addpath
+ if safehasattr(map, 'iteritems') and skip is not None:
+ for f, s in map.iteritems():
+ if s[0] != skip:
+ addpath(f)
+ else:
+ for f in map:
+ addpath(f)
+
+ def addpath(self, path):
+ dirs = self._dirs
+ for base in finddirs(path):
+ if base in dirs:
+ dirs[base] += 1
+ return
+ dirs[base] = 1
+
+ def delpath(self, path):
+ dirs = self._dirs
+ for base in finddirs(path):
+ if dirs[base] > 1:
+ dirs[base] -= 1
+ return
+ del dirs[base]
+
+ def __iter__(self):
+ return self._dirs.iterkeys()
+
+ def __contains__(self, d):
+ return d in self._dirs
+
+if safehasattr(parsers, 'dirs'):
+ dirs = parsers.dirs
+
+def finddirs(path):
+ pos = path.rfind('/')
+ while pos != -1:
+ yield path[:pos]
+ pos = path.rfind('/', 0, pos)
+
# convenient shortcut
dst = debugstacktrace
diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -169,7 +169,7 @@ def _verify(repo):
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 --git a/mercurial/win32.py b/mercurial/win32.py
--- a/mercurial/win32.py
+++ b/mercurial/win32.py
@@ -5,7 +5,7 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-import ctypes, errno, os, subprocess, random
+import ctypes, errno, msvcrt, os, subprocess, random
_kernel32 = ctypes.windll.kernel32
_advapi32 = ctypes.windll.advapi32
@@ -26,6 +26,7 @@ import ctypes, errno, os, subprocess, ra
_ERROR_SUCCESS = 0
_ERROR_NO_MORE_FILES = 18
_ERROR_INVALID_PARAMETER = 87
+_ERROR_BROKEN_PIPE = 109
_ERROR_INSUFFICIENT_BUFFER = 122
# WPARAM is defined as UINT_PTR (unsigned type)
@@ -211,6 +212,10 @@ except AttributeError:
_kernel32.CreateToolhelp32Snapshot.argtypes = [_DWORD, _DWORD]
_kernel32.CreateToolhelp32Snapshot.restype = _BOOL
+_kernel32.PeekNamedPipe.argtypes = [_HANDLE, ctypes.c_void_p, _DWORD,
+ ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]
+_kernel32.PeekNamedPipe.restype = _BOOL
+
_kernel32.Process32First.argtypes = [_HANDLE, ctypes.c_void_p]
_kernel32.Process32First.restype = _BOOL
@@ -260,6 +265,19 @@ def samedevice(path1, path2):
res2 = _getfileinfo(path2)
return res1.dwVolumeSerialNumber == res2.dwVolumeSerialNumber
+def peekpipe(pipe):
+ handle = msvcrt.get_osfhandle(pipe.fileno())
+ avail = _DWORD()
+
+ if not _kernel32.PeekNamedPipe(handle, None, 0, None, ctypes.byref(avail),
+ None):
+ err = _kernel32.GetLastError()
+ if err == _ERROR_BROKEN_PIPE:
+ return 0
+ raise ctypes.WinError(err)
+
+ return avail.value
+
def testpid(pid):
'''return True if pid is still running or unable to
determine, False otherwise'''
@@ -279,7 +297,7 @@ def executablepath():
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 --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -26,14 +26,22 @@ testpid = win32.testpid
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'''
@@ -133,6 +141,10 @@ def normpath(path):
def normcase(path):
return encoding.upper(path)
+# see posix.py for definitions
+normcasespec = encoding.normcasespecs.upper
+normcasefallback = encoding.upperfallback
+
def samestat(s1, s2):
return False
@@ -258,7 +270,7 @@ def groupname(gid=None):
If gid is None, return the name of the current group."""
return None
-def _removedirs(name):
+def removedirs(name):
"""special version of os.removedirs that does not remove symlinked
directories or junction points if they actually contain files"""
if osutil.listdir(name):
@@ -285,7 +297,7 @@ def unlinkpath(f, ignoremissing=False):
raise
# try removing directories that might now be empty
try:
- _removedirs(os.path.dirname(f))
+ removedirs(os.path.dirname(f))
except OSError:
pass
@@ -351,7 +363,7 @@ def readpipe(pipe):
"""Read all available data from a pipe."""
chunks = []
while True:
- size = os.fstat(pipe.fileno()).st_size
+ size = win32.peekpipe(pipe)
if not size:
break
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -363,8 +363,10 @@ class wirepeer(peer.peerrepository):
opts[key] = value
f = self._callcompressable("getbundle", **opts)
bundlecaps = kwargs.get('bundlecaps')
- if bundlecaps is not None and 'HG2Y' in bundlecaps:
- return bundle2.unbundle20(self.ui, f)
+ if bundlecaps is None:
+ bundlecaps = () # kwargs could have it to None
+ if util.any((cap.startswith('HG2') for cap in bundlecaps)):
+ return bundle2.getunbundler(self.ui, f)
else:
return changegroupmod.cg1unpacker(f, 'UN')
@@ -401,7 +403,7 @@ class wirepeer(peer.peerrepository):
else:
# bundle2 push. Send a stream, fetch a stream.
stream = self._calltwowaystream('unbundle', cg, heads=heads)
- ret = bundle2.unbundle20(self.ui, stream)
+ ret = bundle2.getunbundler(self.ui, stream)
return ret
def debugwireargs(self, one, two, three=None, four=None, five=None):
@@ -613,9 +615,9 @@ def _capabilities(repo, proto):
# otherwise, add 'streamreqs' detailing our local revlog format
else:
caps.append('streamreqs=%s' % ','.join(requiredformats))
- if repo.ui.configbool('experimental', 'bundle2-exp', False):
+ if repo.ui.configbool('experimental', 'bundle2-advertise', True):
capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
- caps.append('bundle2-exp=' + urllib.quote(capsblob))
+ caps.append('bundle2=' + urllib.quote(capsblob))
caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
caps.append('httpheader=1024')
return caps
@@ -839,35 +841,40 @@ def unbundle(repo, proto, heads):
finally:
fp.close()
os.unlink(tempname)
- except error.BundleValueError, exc:
- bundler = bundle2.bundle20(repo.ui)
- errpart = bundler.newpart('b2x:error:unsupportedcontent')
+
+ except (error.BundleValueError, util.Abort, error.PushRaced), exc:
+ # handle non-bundle2 case first
+ if not getattr(exc, 'duringunbundle2', False):
+ try:
+ raise
+ except util.Abort:
+ # The old code we moved used sys.stderr directly.
+ # We did not change it to minimise code change.
+ # This need to be moved to something proper.
+ # Feel free to do it.
+ sys.stderr.write("abort: %s\n" % exc)
+ return pushres(0)
+ except error.PushRaced:
+ return pusherr(str(exc))
+
+ bundler = bundle2.bundle20(repo.ui)
+ for out in getattr(exc, '_bundle2salvagedoutput', ()):
+ bundler.addpart(out)
+ try:
+ raise
+ except error.BundleValueError, exc:
+ errpart = bundler.newpart('error:unsupportedcontent')
if exc.parttype is not None:
errpart.addparam('parttype', exc.parttype)
if exc.params:
errpart.addparam('params', '\0'.join(exc.params))
- return streamres(bundler.getchunks())
- except util.Abort, inst:
- # The old code we moved used sys.stderr directly.
- # We did not change it to minimise code change.
- # This need to be moved to something proper.
- # Feel free to do it.
- if getattr(inst, 'duringunbundle2', False):
- bundler = bundle2.bundle20(repo.ui)
- manargs = [('message', str(inst))]
+ except util.Abort, exc:
+ manargs = [('message', str(exc))]
advargs = []
- if inst.hint is not None:
- advargs.append(('hint', inst.hint))
- bundler.addpart(bundle2.bundlepart('b2x:error:abort',
+ if exc.hint is not None:
+ advargs.append(('hint', exc.hint))
+ bundler.addpart(bundle2.bundlepart('error:abort',
manargs, advargs))
- return streamres(bundler.getchunks())
- else:
- sys.stderr.write("abort: %s\n" % inst)
- return pushres(0)
- except error.PushRaced, exc:
- if getattr(exc, 'duringunbundle2', False):
- bundler = bundle2.bundle20(repo.ui)
- bundler.newpart('b2x:error:pushraced', [('message', str(exc))])
- return streamres(bundler.getchunks())
- else:
- return pusherr(str(exc))
+ except error.PushRaced, exc:
+ bundler.newpart('error:pushraced', [('message', str(exc))])
+ return streamres(bundler.getchunks())
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -63,6 +63,8 @@ else:
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 hgbuildmo(build):
class hgdist(Distribution):
- pure = 0
+ pure = ispypy
global_options = Distribution.global_options + \
[('pure', None, "use pure (slow) Python "
@@ -491,6 +493,7 @@ extmodules = [
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 @@ extra = {}
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 --git a/tests/get-with-headers.py b/tests/get-with-headers.py
--- a/tests/get-with-headers.py
+++ b/tests/get-with-headers.py
@@ -6,6 +6,14 @@ a subset of the headers plus the body of
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 @@ headeronly = False
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 @@ def request(host, path, show):
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 --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -320,6 +320,11 @@ def has_ssl():
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 --git a/tests/mockblackbox.py b/tests/mockblackbox.py
new file mode 100644
--- /dev/null
+++ b/tests/mockblackbox.py
@@ -0,0 +1,11 @@
+from mercurial import util
+
+def makedate():
+ return 0, 0
+def getuser():
+ return 'bob'
+
+# mock the date and user apis so the output is always the same
+def uisetup(ui):
+ util.makedate = makedate
+ util.getuser = getuser
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -76,6 +76,8 @@ processlock = threading.Lock()
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 @@ def getparser():
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 @@ def parseargs(args, parser):
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 @@ class Test(unittest.TestCase):
# 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 @@ class Test(unittest.TestCase):
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 @@ class Test(unittest.TestCase):
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')
@@ -691,6 +705,8 @@ class Test(unittest.TestCase):
hgrc.write('commit = -d "0 0"\n')
hgrc.write('shelve = --date "0 0"\n')
hgrc.write('tag = -d "0 0"\n')
+ hgrc.write('[devel]\n')
+ hgrc.write('all = true\n')
hgrc.write('[largefiles]\n')
hgrc.write('usercache = %s\n' %
(os.path.join(self._testtmp, '.cache/largefiles')))
@@ -707,6 +723,55 @@ class Test(unittest.TestCase):
# 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 +779,13 @@ class PythonTest(Test):
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 +815,7 @@ class TTest(Test):
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 +832,7 @@ class TTest(Test):
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 +1125,6 @@ class TTest(Test):
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 +1160,6 @@ class TestResult(unittest._TextTestResul
self.warned = []
self.times = []
- self._started = {}
- self._stopped = {}
# Data stored for the benefit of generating xunit reports.
self.successes = []
self.faildata = {}
@@ -1263,21 +1281,18 @@ class TestResult(unittest._TextTestResul
# 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 +1303,8 @@ class TestSuite(unittest.TestSuite):
"""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 +1339,21 @@ class TestSuite(unittest.TestSuite):
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 +1380,8 @@ class TestSuite(unittest.TestSuite):
if ignored:
continue
-
- tests.append(test)
+ for _ in xrange(self._runs_per_test):
+ tests.append(get())
runtests = list(tests)
done = queue.Queue()
@@ -1373,24 +1397,44 @@ class TestSuite(unittest.TestSuite):
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 +1495,11 @@ class TextTestRunner(unittest.TextTestRu
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 +1593,7 @@ class TestRunner(object):
def __init__(self):
self.options = None
+ self._hgroot = None
self._testdir = None
self._hgtmp = None
self._installdir = None
@@ -1646,6 +1695,11 @@ class TestRunner(object):
runtestdir = os.path.abspath(os.path.dirname(__file__))
path = [self._bindir, runtestdir] + os.environ["PATH"].split(os.pathsep)
+ if os.path.islink(__file__):
+ # test helper will likely be at the end of the symlink
+ realfile = os.path.realpath(__file__)
+ realdir = os.path.abspath(os.path.dirname(realfile))
+ path.insert(2, realdir)
if self._tmpbindir != self._bindir:
path = [self._tmpbindir] + path
os.environ["PATH"] = os.pathsep.join(path)
@@ -1729,7 +1783,8 @@ class TestRunner(object):
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 +1824,16 @@ class TestRunner(object):
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 +1893,10 @@ class TestRunner(object):
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 +1904,7 @@ class TestRunner(object):
# 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 +1924,17 @@ class TestRunner(object):
'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 +1942,7 @@ class TestRunner(object):
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 +1984,14 @@ class TestRunner(object):
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 +2024,31 @@ class TestRunner(object):
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 --git a/tests/seq.py b/tests/seq.py
new file mode 100644
--- /dev/null
+++ b/tests/seq.py
@@ -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 --git a/tests/sitecustomize.py b/tests/sitecustomize.py
--- a/tests/sitecustomize.py
+++ b/tests/sitecustomize.py
@@ -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 --git a/tests/test-add.t b/tests/test-add.t
--- a/tests/test-add.t
+++ b/tests/test-add.t
@@ -176,12 +176,48 @@ Test that adding a directory doesn't req
$ mkdir CapsDir1/CapsDir/SubDir
$ echo def > CapsDir1/CapsDir/SubDir/Def.txt
- $ hg add -v capsdir1/capsdir
+ $ hg add capsdir1/capsdir
adding CapsDir1/CapsDir/AbC.txt (glob)
adding CapsDir1/CapsDir/SubDir/Def.txt (glob)
$ hg forget capsdir1/capsdir/abc.txt
removing CapsDir1/CapsDir/AbC.txt (glob)
+
+ $ hg forget capsdir1/capsdir
+ removing CapsDir1/CapsDir/SubDir/Def.txt (glob)
+
+ $ hg add capsdir1
+ adding CapsDir1/CapsDir/AbC.txt (glob)
+ adding CapsDir1/CapsDir/SubDir/Def.txt (glob)
+
+ $ hg ci -m "AbCDef" capsdir1/capsdir
+
+ $ hg status -A capsdir1/capsdir
+ C CapsDir1/CapsDir/AbC.txt
+ C CapsDir1/CapsDir/SubDir/Def.txt
+
+ $ hg files capsdir1/capsdir
+ CapsDir1/CapsDir/AbC.txt (glob)
+ CapsDir1/CapsDir/SubDir/Def.txt (glob)
+
+ $ echo xyz > CapsDir1/CapsDir/SubDir/Def.txt
+ $ hg ci -m xyz capsdir1/capsdir/subdir/def.txt
+
+ $ hg revert -r '.^' capsdir1/capsdir
+ reverting CapsDir1/CapsDir/SubDir/Def.txt (glob)
+
+ $ hg diff capsdir1/capsdir
+ diff -r 5112e00e781d CapsDir1/CapsDir/SubDir/Def.txt
+ --- a/CapsDir1/CapsDir/SubDir/Def.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/CapsDir1/CapsDir/SubDir/Def.txt * +0000 (glob)
+ @@ -1,1 +1,1 @@
+ -xyz
+ +def
+
+ $ hg remove -f 'glob:**.txt' -X capsdir1/capsdir
+ $ hg remove -f 'glob:**.txt' -I capsdir1/capsdir
+ removing CapsDir1/CapsDir/AbC.txt (glob)
+ removing CapsDir1/CapsDir/SubDir/Def.txt (glob)
#endif
$ cd ..
diff --git a/tests/test-addremove.t b/tests/test-addremove.t
--- a/tests/test-addremove.t
+++ b/tests/test-addremove.t
@@ -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 --git a/tests/test-alias.t b/tests/test-alias.t
--- a/tests/test-alias.t
+++ b/tests/test-alias.t
@@ -360,9 +360,11 @@ shell alias defined in current repo
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 @@ shell alias defined in other repo
$ 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 --git a/tests/test-annotate.t b/tests/test-annotate.t
--- a/tests/test-annotate.t
+++ b/tests/test-annotate.t
@@ -398,6 +398,88 @@ and its ancestor by overriding "repo._fi
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 --git a/tests/test-basic.t b/tests/test-basic.t
--- a/tests/test-basic.t
+++ b/tests/test-basic.t
@@ -5,6 +5,7 @@ Create a repository:
defaults.commit=-d "0 0"
defaults.shelve=--date "0 0"
defaults.tag=-d "0 0"
+ devel.all=true
largefiles.usercache=$TESTTMP/.cache/largefiles (glob)
ui.slash=True
ui.interactive=False
diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t
--- a/tests/test-blackbox.t
+++ b/tests/test-blackbox.t
@@ -1,20 +1,8 @@
setup
- $ cat > mock.py < from mercurial import util
- >
- > def makedate():
- > return 0, 0
- > def getuser():
- > return 'bob'
- > # mock the date and user apis so the output is always the same
- > def uisetup(ui):
- > util.makedate = makedate
- > util.getuser = getuser
- > EOF
$ cat >> $HGRCPATH < [extensions]
> blackbox=
- > mock=`pwd`/mock.py
+ > mock=$TESTDIR/mockblackbox.py
> mq=
> EOF
$ hg init blackboxtest
@@ -124,18 +112,6 @@ backup bundles get logged
1970/01/01 00:00:00 bob> wrote base branch cache with 1 labels and 2 nodes
1970/01/01 00:00:00 bob> strip tip exited 0 after * seconds (glob)
-tags cache gets logged
- $ hg up tip
- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
- $ hg tag -m 'create test tag' test-tag
- $ hg tags
- tip 3:5b5562c08298
- test-tag 2:d02f48003e62
- $ hg blackbox -l 3
- 1970/01/01 00:00:00 bob> resolved 1 tags cache entries from 1 manifests in ?.???? seconds (glob)
- 1970/01/01 00:00:00 bob> writing tags cache file with 2 heads and 1 tags
- 1970/01/01 00:00:00 bob> tags exited 0 after ?.?? seconds (glob)
-
extension and python hooks - use the eol extension for a pythonhook
$ echo '[extensions]' >> .hg/hgrc
@@ -144,9 +120,10 @@ extension and python hooks - use the eol
$ echo 'update = echo hooked' >> .hg/hgrc
$ hg update
hooked
- 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
- $ hg blackbox -l 4
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg blackbox -l 5
1970/01/01 00:00:00 bob> update
+ 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 0 tags
1970/01/01 00:00:00 bob> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
1970/01/01 00:00:00 bob> exthook-update: echo hooked finished in * seconds (glob)
1970/01/01 00:00:00 bob> update exited 0 after * seconds (glob)
@@ -160,7 +137,7 @@ log rotation
$ hg status
$ hg status
$ hg tip -q
- 3:5b5562c08298
+ 2:d02f48003e62
$ ls .hg/blackbox.log*
.hg/blackbox.log
.hg/blackbox.log.1
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -164,6 +164,40 @@ divergent bookmarks
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
@@ -368,8 +402,11 @@ hgweb
$ hg out -B http://localhost:$HGPORT/
comparing with http://localhost:$HGPORT/
searching for changed bookmarks
- no changed bookmarks found
- [1]
+ @ 0d2164f0ce0d
+ X 0d2164f0ce0d
+ Z 0d2164f0ce0d
+ foo
+ foobar
$ hg push -B Z http://localhost:$HGPORT/
pushing to http://localhost:$HGPORT/
searching for changes
@@ -380,6 +417,8 @@ hgweb
$ hg in -B http://localhost:$HGPORT/
comparing with http://localhost:$HGPORT/
searching for changed bookmarks
+ @ 9b140be10808
+ X 9b140be10808
Z 0d2164f0ce0d
foo 000000000000
foobar 9b140be10808
@@ -409,6 +448,121 @@ hgweb
$ cd ..
+Test to show result of bookmarks comparision
+
+ $ mkdir bmcomparison
+ $ cd bmcomparison
+
+ $ hg init source
+ $ hg -R source debugbuilddag '+2*2*3*4'
+ $ hg -R source log -G --template '{rev}:{node|short}'
+ o 4:e7bd5218ca15
+ |
+ | o 3:6100d3090acf
+ |/
+ | o 2:fa942426a6fd
+ |/
+ | o 1:66f7d451a68b
+ |/
+ o 0:1ea73414a91b
+
+ $ hg -R source bookmarks -r 0 SAME
+ $ hg -R source bookmarks -r 0 ADV_ON_REPO1
+ $ hg -R source bookmarks -r 0 ADV_ON_REPO2
+ $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1
+ $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2
+ $ hg -R source bookmarks -r 1 DIVERGED
+
+ $ hg clone -U source repo1
+
+(test that incoming/outgoing exit with 1, if there is no bookmark to
+be excahnged)
+
+ $ hg -R repo1 incoming -B
+ comparing with $TESTTMP/bmcomparison/source
+ searching for changed bookmarks
+ no changed bookmarks found
+ [1]
+ $ hg -R repo1 outgoing -B
+ comparing with $TESTTMP/bmcomparison/source
+ searching for changed bookmarks
+ no changed bookmarks found
+ [1]
+
+ $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1
+ $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1
+ $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1
+ $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED
+ $ hg -R repo1 -q --config extensions.mq= strip 4
+ $ hg -R repo1 log -G --template '{node|short} ({bookmarks})'
+ o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED)
+ |
+ | o fa942426a6fd (ADV_ON_REPO1)
+ |/
+ | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED)
+ |/
+ o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME)
+
+
+ $ hg clone -U source repo2
+ $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2
+ $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2
+ $ hg -R repo2 bookmarks -f -r 2 DIVERGED
+ $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2
+ $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED
+ $ hg -R repo2 -q --config extensions.mq= strip 3
+ $ hg -R repo2 log -G --template '{node|short} ({bookmarks})'
+ o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED)
+ |
+ | o fa942426a6fd (DIVERGED)
+ |/
+ | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2)
+ |/
+ o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME)
+
+
+(test that difference of bookmarks between repositories are fully shown)
+
+ $ hg -R repo1 incoming -B repo2 -v
+ comparing with repo2
+ searching for changed bookmarks
+ ADD_ON_REPO2 66f7d451a68b added
+ ADV_ON_REPO2 66f7d451a68b advanced
+ DIFF_ADV_ON_REPO2 e7bd5218ca15 changed
+ DIFF_DIVERGED e7bd5218ca15 changed
+ DIVERGED fa942426a6fd diverged
+ $ hg -R repo1 outgoing -B repo2 -v
+ comparing with repo2
+ searching for changed bookmarks
+ ADD_ON_REPO1 66f7d451a68b added
+ ADD_ON_REPO2 deleted
+ ADV_ON_REPO1 fa942426a6fd advanced
+ DIFF_ADV_ON_REPO1 6100d3090acf advanced
+ DIFF_ADV_ON_REPO2 1ea73414a91b changed
+ DIFF_DIVERGED 6100d3090acf changed
+ DIVERGED 66f7d451a68b diverged
+
+ $ hg -R repo2 incoming -B repo1 -v
+ comparing with repo1
+ searching for changed bookmarks
+ ADD_ON_REPO1 66f7d451a68b added
+ ADV_ON_REPO1 fa942426a6fd advanced
+ DIFF_ADV_ON_REPO1 6100d3090acf changed
+ DIFF_DIVERGED 6100d3090acf changed
+ DIVERGED 66f7d451a68b diverged
+ $ hg -R repo2 outgoing -B repo1 -v
+ comparing with repo1
+ searching for changed bookmarks
+ ADD_ON_REPO1 deleted
+ ADD_ON_REPO2 66f7d451a68b added
+ ADV_ON_REPO2 66f7d451a68b advanced
+ DIFF_ADV_ON_REPO1 1ea73414a91b changed
+ DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced
+ DIFF_DIVERGED e7bd5218ca15 changed
+ DIVERGED fa942426a6fd diverged
+
+ $ cd ..
+
Pushing a bookmark should only push the changes required by that
bookmark, not all outgoing changes:
$ hg clone http://localhost:$HGPORT/ addmarks
@@ -460,6 +614,13 @@ pushing a new bookmark on a new head doe
$ 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 --git a/tests/test-bookmarks-rebase.t b/tests/test-bookmarks-rebase.t
--- a/tests/test-bookmarks-rebase.t
+++ b/tests/test-bookmarks-rebase.t
@@ -66,3 +66,27 @@ rebase
date: Thu Jan 01 00:00:00 1970 +0000
summary: 0
+aborted rebase should restore active bookmark.
+
+ $ hg up 1
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (leaving bookmark two)
+ $ echo 'e' > d
+ $ hg ci -A -m "4"
+ adding d
+ created new head
+ $ hg bookmark three
+ $ hg rebase -s three -d two
+ rebasing 4:dd7c838e8362 "4" (tip three)
+ merging d
+ warning: conflicts during merge.
+ merging d incomplete! (edit conflicts, then use 'hg resolve --mark')
+ unresolved conflicts (see hg resolve, then hg rebase --continue)
+ [1]
+ $ hg rebase --abort
+ rebase aborted
+ $ hg bookmark
+ one 1:925d80f479bb
+ * three 4:dd7c838e8362
+ two 3:42e5ed2cdcf4
+
diff --git a/tests/test-branches.t b/tests/test-branches.t
--- a/tests/test-branches.t
+++ b/tests/test-branches.t
@@ -547,11 +547,22 @@ revision branch cache is created when bu
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 @@ recovery from invalid cache file with pa
$ 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 @@ recovery from invalid cache file with so
$ 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 --git a/tests/test-bundle-type.t b/tests/test-bundle-type.t
--- a/tests/test-bundle-type.t
+++ b/tests/test-bundle-type.t
@@ -87,6 +87,7 @@ test garbage file
$ hg init tgarbage
$ cd tgarbage
$ hg pull ../bgarbage
+ pulling from ../bgarbage
abort: ../bgarbage: not a Mercurial bundle
[255]
$ cd ..
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -224,7 +224,7 @@ hg -R bundle://../full.hg verify
adding manifests
adding file changes
added 9 changesets with 7 changes to 4 files (+1 heads)
- changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg
+ changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=bundle:../full.hg (glob)
(run 'hg heads' to see heads, 'hg merge' to merge)
Rollback empty
@@ -247,7 +247,7 @@ Pull full.hg into empty again (using -R;
adding manifests
adding file changes
added 9 changesets with 7 changes to 4 files (+1 heads)
- changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
+ changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=bundle:empty+full.hg (glob)
(run 'hg heads' to see heads, 'hg merge' to merge)
Create partial clones
diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t
--- a/tests/test-bundle2-exchange.t
+++ b/tests/test-bundle2-exchange.t
@@ -25,10 +25,9 @@ enable obsolescence
> [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 @@ The extension requires a repo (currently
$ 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_TXNID=TXN:* HG_TXNNAME=commit (glob)
$ 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_TXNID=TXN:* HG_TXNNAME=unbundle (glob)
+ 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 @@ Real world exchange
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_TXNID=TXN:* HG_TXNNAME=debugobsolete (glob)
$ 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_TXNID=TXN:* HG_TXNNAME=debugobsolete (glob)
clone --pull
$ hg -R main phase --public cd010b8cd998
+ pre-close-tip:000000000000 public
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=phase (glob)
$ hg clone main other --pull --rev 9520eea781bc
adding changesets
adding manifests
@@ -69,8 +83,8 @@ clone --pull
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_TXNID=TXN:* HG_TXNNAME=pull (glob)
+ 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 @@ clone --pull
pull
$ hg -R main phase --public 9520eea781bc
+ pre-close-tip:000000000000 public
+ postclose-tip:02de42196ebe draft
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=phase (glob)
$ hg -R other pull -r 24b6387c8c8c
pulling from $TESTTMP/main (glob)
searching for changes
@@ -94,8 +111,8 @@ pull
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_TXNID=TXN:* HG_TXNNAME=pull (glob)
+ 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
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_TXNID=TXN:* HG_TXNNAME=phase (glob)
$ 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_TXNID=TXN:* HG_TXNNAME=pull (glob)
+ 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 @@ pull empty
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_TXNID=TXN:* HG_TXNNAME=pull (glob)
+ 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 @@ add extra data to test their exchange du
$ 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_TXNID=TXN:* HG_TXNNAME=debugobsolete (glob)
$ 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_TXNID=TXN:* HG_TXNNAME=debugobsolete (glob)
$ 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_TXNID=TXN:* HG_TXNNAME=debugobsolete (glob)
$ 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_TXNID=TXN:* HG_TXNNAME=debugobsolete (glob)
$ 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_TXNID=TXN:* HG_TXNNAME=debugobsolete (glob)
$ hg -R other bookmark --rev cd010b8cd998 book_eea1
$ hg -R other bookmark --rev cd010b8cd998 book_02de
@@ -167,6 +204,9 @@ add extra data to test their exchange du
$ 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_TXNID=TXN:* HG_TXNNAME=phase (glob)
push
$ hg -R main push other --rev eea13746799a --bookmark book_eea1
@@ -180,8 +220,7 @@ push
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=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:* HG_TXNNAME=push HG_URL=push (glob)
remote: adding changesets
remote: adding manifests
remote: adding file changes
@@ -190,7 +229,8 @@ push
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_TXNID=TXN:* HG_TXNNAME=push-response (glob)
+ 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 @@ pull over ssh
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_TXNID=TXN:* HG_TXNNAME=pull (glob)
+ 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 @@ pull over http
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_TXNID=TXN:* HG_TXNNAME=pull (glob)
+ 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 @@ push over ssh
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=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:* HG_TXNNAME=serve HG_URL=remote:ssh:127.0.0.1 (glob)
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_TXNID=TXN:* HG_TXNNAME=push-response (glob)
+ 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 @@ push over http
$ 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_TXNID=TXN:* HG_TXNNAME=phase (glob)
$ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
pushing to http://localhost:$HGPORT2/
searching for changes
@@ -315,7 +358,8 @@ push over http
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_TXNID=TXN:* HG_TXNNAME=push-response (glob)
+ http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
$ cat other-error.log
Check final content.
@@ -382,7 +426,7 @@ Setting up
> bundler.newpart('test:unknown')
> if reason == 'race':
> # 20 Bytes of crap
- > bundler.newpart('b2x:check:heads', data='01234567890123456789')
+ > bundler.newpart('check:heads', data='01234567890123456789')
>
> @bundle2.parthandler("test:abort")
> def handleabort(op, part):
@@ -400,6 +444,9 @@ Setting up
$ echo 'I' > I
$ hg add I
$ hg ci -m 'I'
+ pre-close-tip:e7ec4e813ba6 draft
+ postclose-tip:e7ec4e813ba6 draft
+ txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
$ hg id
e7ec4e813ba6 tip
$ cd ..
@@ -501,7 +548,7 @@ Doing the actual push: hook abort
> [failpush]
> reason =
> [hooks]
- > b2x-pretransactionclose.failpush = false
+ > pretxnclose.failpush = false
> EOF
$ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
@@ -514,13 +561,21 @@ Doing the actual push: hook abort
pre-close-tip:e7ec4e813ba6 draft
transaction abort!
rollback completed
- abort: b2x-pretransactionclose.failpush hook exited with status 1
+ remote: adding changesets
+ remote: adding manifests
+ remote: adding file changes
+ remote: added 1 changesets with 1 changes to 1 files
+ 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
+ remote: adding changesets
+ remote: adding manifests
+ remote: adding file changes
+ remote: added 1 changesets with 1 changes to 1 files
+ abort: pretxnclose.failpush hook exited with status 1
remote: pre-close-tip:e7ec4e813ba6 draft
remote: transaction abort!
remote: rollback completed
@@ -529,7 +584,11 @@ Doing the actual push: hook abort
$ 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
+ remote: adding changesets
+ remote: adding manifests
+ remote: adding file changes
+ remote: added 1 changesets with 1 changes to 1 files
+ abort: pretxnclose.failpush hook exited with status 1
[255]
(check that no 'pending' files remain)
diff --git a/tests/test-bundle2-format.t b/tests/test-bundle2-format.t
--- a/tests/test-bundle2-format.t
+++ b/tests/test-bundle2-format.t
@@ -92,11 +92,11 @@ Create an extension to test bundle2 API
>
> if opts['reply']:
> capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville'
- > bundler.newpart('b2x:replycaps', data=capsstring)
+ > bundler.newpart('replycaps', data=capsstring)
>
> if opts['pushrace']:
> # also serve to test the assignement of data outside of init
- > part = bundler.newpart('b2x:check:heads')
+ > part = bundler.newpart('check:heads')
> part.data = '01234567890123456789'
>
> revs = opts['rev']
@@ -109,7 +109,7 @@ Create an extension to test bundle2 API
> headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
> outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
> cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None)
- > bundler.newpart('b2x:changegroup', data=cg.getchunks(),
+ > bundler.newpart('changegroup', data=cg.getchunks(),
> mandatory=False)
>
> if opts['parts']:
@@ -136,7 +136,7 @@ Create an extension to test bundle2 API
> def genraise():
> yield 'first line\n'
> raise RuntimeError('Someone set up us the bomb!')
- > bundler.newpart('b2x:output', data=genraise(), mandatory=False)
+ > bundler.newpart('output', data=genraise(), mandatory=False)
>
> if path is None:
> file = sys.stdout
@@ -157,7 +157,7 @@ Create an extension to test bundle2 API
> lock = repo.lock()
> tr = repo.transaction('processbundle')
> try:
- > unbundler = bundle2.unbundle20(ui, sys.stdin)
+ > unbundler = bundle2.getunbundler(ui, sys.stdin)
> op = bundle2.processbundle(repo, unbundler, lambda: tr)
> tr.close()
> except error.BundleValueError, exc:
@@ -183,7 +183,7 @@ Create an extension to test bundle2 API
> @command('statbundle2', [], '')
> def cmdstatbundle2(ui, repo):
> """print statistic on the bundle2 container read from stdin"""
- > unbundler = bundle2.unbundle20(ui, sys.stdin)
+ > unbundler = bundle2.getunbundler(ui, sys.stdin)
> try:
> params = unbundler.params
> except error.BundleValueError, exc:
@@ -237,7 +237,7 @@ Empty bundle
Test bundling
$ hg bundle2
- HG2Y\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
+ HG20\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
Test unbundling
@@ -267,7 +267,7 @@ Simplest possible parameters form
Test generation simple option
$ hg bundle2 --param 'caution'
- HG2Y\x00\x00\x00\x07caution\x00\x00\x00\x00 (no-eol) (esc)
+ HG20\x00\x00\x00\x07caution\x00\x00\x00\x00 (no-eol) (esc)
Test unbundling
@@ -279,7 +279,7 @@ Test unbundling
Test generation multiple option
$ hg bundle2 --param 'caution' --param 'meal'
- HG2Y\x00\x00\x00\x0ccaution meal\x00\x00\x00\x00 (no-eol) (esc)
+ HG20\x00\x00\x00\x0ccaution meal\x00\x00\x00\x00 (no-eol) (esc)
Test unbundling
@@ -295,7 +295,7 @@ advisory parameters, with value
Test generation
$ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
- HG2Y\x00\x00\x00\x1ccaution meal=vegan elephants\x00\x00\x00\x00 (no-eol) (esc)
+ HG20\x00\x00\x00\x1ccaution meal=vegan elephants\x00\x00\x00\x00 (no-eol) (esc)
Test unbundling
@@ -313,7 +313,7 @@ parameter with special char in value
Test generation
$ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
- HG2Y\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
+ HG20\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
Test unbundling
@@ -337,7 +337,7 @@ Test debug output
bundling debug
$ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
- start emission of HG2Y stream
+ start emission of HG20 stream
bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
start of parts
end of bundle
@@ -345,12 +345,12 @@ bundling debug
file content is ok
$ cat ../out.hg2
- HG2Y\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
+ HG20\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
unbundling debug
$ hg statbundle2 --debug < ../out.hg2
- start processing of HG2Y stream
+ start processing of HG20 stream
reading bundle2 stream parameters
ignoring unknown parameter 'e|! 7/'
ignoring unknown parameter 'simple'
@@ -384,7 +384,7 @@ Test part
=================
$ hg bundle2 --parts ../parts.hg2 --debug
- start emission of HG2Y stream
+ start emission of HG20 stream
bundle parameter:
start of parts
bundle part: "test:empty"
@@ -397,7 +397,7 @@ Test part
end of bundle
$ cat ../parts.hg2
- HG2Y\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
+ HG20\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
test:empty\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10 test:song\x00\x00\x00\x02\x00\x00\x00\x00\x00\xb2Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko (esc)
Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
@@ -437,7 +437,7 @@ Test part
parts count: 7
$ hg statbundle2 --debug < ../parts.hg2
- start processing of HG2Y stream
+ start processing of HG20 stream
reading bundle2 stream parameters
options count: 0
start extraction of bundle2 parts
@@ -516,7 +516,7 @@ Test actual unbundling of test part
Process the bundle
$ hg unbundle2 --debug < ../parts.hg2
- start processing of HG2Y stream
+ start processing of HG20 stream
reading bundle2 stream parameters
start extraction of bundle2 parts
part header size: 17
@@ -610,21 +610,18 @@ unbundle with a reply
The reply is a bundle
$ cat ../reply.hg2
- HG2Y\x00\x00\x00\x00\x00\x00\x00\x1f (esc)
- b2x:output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
+ HG20\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
- \x00\x00\x00\x00\x00\x00\x00\x1f (esc)
- b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
+ \x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
debugreply: 'city=!'
debugreply: 'celeste,ville'
debugreply: 'elephants'
debugreply: 'babar'
debugreply: 'celeste'
debugreply: 'ping-pong'
- \x00\x00\x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to7\x00\x00\x00\x00\x00\x00\x00\x1f (esc)
- b2x:output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to7\x00\x00\x00=received ping request (id 7) (esc)
+ \x00\x00\x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to7\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to7\x00\x00\x00=received ping request (id 7) (esc)
replying to ping request (id 7)
\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
@@ -632,11 +629,11 @@ The reply is valid
$ hg statbundle2 < ../reply.hg2
options count: 0
- :b2x:output:
+ :output:
mandatory: 0
advisory: 1
payload: 217 bytes
- :b2x:output:
+ :output:
mandatory: 0
advisory: 1
payload: 201 bytes
@@ -644,7 +641,7 @@ The reply is valid
mandatory: 1
advisory: 0
payload: 0 bytes
- :b2x:output:
+ :output:
mandatory: 0
advisory: 1
payload: 61 bytes
@@ -714,10 +711,10 @@ Support for changegroup
9520eea781bcca16c1e15acc0ba14335a0e8e5ba
eea13746799a9e0bfd88f29d3c2e9dc9389f524f
02de42196ebee42ef284b6780a87cdc96e8eaab6
- start emission of HG2Y stream
+ start emission of HG20 stream
bundle parameter:
start of parts
- bundle part: "b2x:changegroup"
+ bundle part: "changegroup"
bundling: 1/4 changesets (25.00%)
bundling: 2/4 changesets (50.00%)
bundling: 3/4 changesets (75.00%)
@@ -732,7 +729,7 @@ Support for changegroup
end of bundle
$ cat ../rev.hg2
- HG2Y\x00\x00\x00\x00\x00\x00\x00\x16\x0fb2x:changegroup\x00\x00\x00\x00\x00\x00\x00\x00\x06\x13\x00\x00\x00\xa42\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j_\xdd\xd9\x89W\xc8\xa5JMCm\xfe\x1d\xa9\xd8\x7f!\xa1\xb9{\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c (esc)
+ HG20\x00\x00\x00\x00\x00\x00\x00\x12\x0bchangegroup\x00\x00\x00\x00\x00\x00\x00\x00\x06\x13\x00\x00\x00\xa42\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j_\xdd\xd9\x89W\xc8\xa5JMCm\xfe\x1d\xa9\xd8\x7f!\xa1\xb9{\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c (esc)
\x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
\x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01D\x00\x00\x00\xa4\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\xcd\x01\x0b\x8c\xd9\x98\xf3\x98\x1aZ\x81\x15\xf9O\x8d\xa4\xabP`\x89\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)4dece9c826f69490507b98c6383a3009b295837d (esc)
\x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
@@ -757,7 +754,7 @@ Support for changegroup
$ hg debugbundle ../rev.hg2
Stream params: {}
- b2x:changegroup -- '{}'
+ changegroup -- '{}'
32af7686d403cf45b5d95f2d70cebea587ac806a
9520eea781bcca16c1e15acc0ba14335a0e8e5ba
eea13746799a9e0bfd88f29d3c2e9dc9389f524f
@@ -776,8 +773,7 @@ with reply
addchangegroup return: 1
$ cat ../rev-reply.hg2
- HG2Y\x00\x00\x00\x00\x00\x00\x003\x15b2x:reply:changegroup\x00\x00\x00\x00\x00\x02\x0b\x01\x06\x01in-reply-to1return1\x00\x00\x00\x00\x00\x00\x00\x1f (esc)
- b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
+ HG20\x00\x00\x00\x00\x00\x00\x00/\x11reply:changegroup\x00\x00\x00\x00\x00\x02\x0b\x01\x06\x01in-reply-to1return1\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
adding manifests
adding file changes
added 0 changesets with 0 changes to 3 files
@@ -793,8 +789,8 @@ Check handling of exception during gener
Should still be a valid bundle
$ cat ../genfailed.hg2
- HG2Y\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
- b2x:output\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00L\x0fb2x:error:abort\x00\x00\x00\x00\x01\x00\x07-messageunexpected error: Someone set up us the bomb!\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
+ HG20\x00\x00\x00\x00\x00\x00\x00\r (no-eol) (esc)
+ \x06output\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00H\x0berror:abort\x00\x00\x00\x00\x01\x00\x07-messageunexpected error: Someone set up us the bomb!\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
And its handling on the other size raise a clean exception
diff --git a/tests/test-bundle2-multiple-changegroups.t b/tests/test-bundle2-multiple-changegroups.t
--- a/tests/test-bundle2-multiple-changegroups.t
+++ b/tests/test-bundle2-multiple-changegroups.t
@@ -14,13 +14,13 @@ Create an extension to test bundle2 with
> intermediates = [repo[r].p1().node() for r in heads]
> cg = changegroup.getchangegroup(repo, source, heads=intermediates,
> common=common, bundlecaps=bundlecaps)
- > bundler.newpart('b2x:output', data='changegroup1')
- > bundler.newpart('b2x:changegroup', data=cg.getchunks())
+ > bundler.newpart('output', data='changegroup1')
+ > bundler.newpart('changegroup', data=cg.getchunks())
> cg = changegroup.getchangegroup(repo, source, heads=heads,
> common=common + intermediates,
> bundlecaps=bundlecaps)
- > bundler.newpart('b2x:output', data='changegroup2')
- > bundler.newpart('b2x:changegroup', data=cg.getchunks())
+ > bundler.newpart('output', data='changegroup2')
+ > bundler.newpart('changegroup', data=cg.getchunks())
>
> def _pull(repo, *args, **kwargs):
> pullop = _orig_pull(repo, *args, **kwargs)
@@ -82,17 +82,17 @@ Pull the new commits in the clone
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pretxnchangegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
+ pretxnchangegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
remote: changegroup2
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pretxnchangegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- changegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- changegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
+ pretxnchangegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ changegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ changegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
pullop.cgresult is 1
(run 'hg update' to get a working copy)
$ hg update
@@ -152,20 +152,20 @@ pullop.cgresult
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files (+1 heads)
- pretxnchangegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
+ pretxnchangegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
remote: changegroup2
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 3 files (+1 heads)
- pretxnchangegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- changegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- changegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
+ pretxnchangegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ changegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ changegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
pullop.cgresult is 3
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg log -G
@@ -225,17 +225,17 @@ pullop.cgresult
adding manifests
adding file changes
added 1 changesets with 0 changes to 0 files (-1 heads)
- pretxnchangegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
+ pretxnchangegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
remote: changegroup2
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- pretxnchangegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- changegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- changegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
- incoming hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
+ pretxnchangegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ changegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ changegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
+ incoming hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/repo (glob)
pullop.cgresult is -2
(run 'hg update' to get a working copy)
$ hg log -G
diff --git a/tests/test-bundle2-pushback.t b/tests/test-bundle2-pushback.t
--- a/tests/test-bundle2-pushback.t
+++ b/tests/test-bundle2-pushback.t
@@ -6,21 +6,21 @@
> from mercurial import bundle2, pushkey, exchange, util
> def _newhandlechangegroup(op, inpart):
> """This function wraps the changegroup part handler for getbundle.
- > It issues an additional b2x:pushkey part to send a new
+ > It issues an additional pushkey part to send a new
> bookmark back to the client"""
> result = bundle2.handlechangegroup(op, inpart)
- > if 'b2x:pushback' in op.reply.capabilities:
+ > if 'pushback' in op.reply.capabilities:
> params = {'namespace': 'bookmarks',
> 'key': 'new-server-mark',
> 'old': '',
> 'new': 'tip'}
> encodedparams = [(k, pushkey.encode(v)) for (k,v) in params.items()]
- > op.reply.newpart('b2x:pushkey', mandatoryparams=encodedparams)
+ > op.reply.newpart('pushkey', mandatoryparams=encodedparams)
> else:
- > op.reply.newpart('b2x:output', data='pushback not enabled')
+ > op.reply.newpart('output', data='pushback not enabled')
> return result
> _newhandlechangegroup.params = bundle2.handlechangegroup.params
- > bundle2.parthandlermapping['b2x:changegroup'] = _newhandlechangegroup
+ > bundle2.parthandlermapping['changegroup'] = _newhandlechangegroup
> EOF
$ cat >> $HGRCPATH < def newpart(name, data=''):
> """wrapper around bundler.newpart adding an extra part making the
> client output information about each processed part"""
- > bundler.newpart('b2x:output', data=name)
+ > bundler.newpart('output', data=name)
> part = bundler.newpart(name, data=data)
> return part
>
@@ -50,13 +50,13 @@ Create an extension to test bundle2 remo
> bundledata = open(file, 'rb').read()
> digest = util.digester.preferred(b2caps['digests'])
> d = util.digester([digest], bundledata)
- > part = newpart('b2x:remote-changegroup')
+ > part = newpart('remote-changegroup')
> part.addparam('url', url)
> part.addparam('size', str(len(bundledata)))
> part.addparam('digests', digest)
> part.addparam('digest:%s' % digest, d[digest])
> elif verb == 'raw-remote-changegroup':
- > part = newpart('b2x:remote-changegroup')
+ > part = newpart('remote-changegroup')
> for k, v in eval(args).items():
> part.addparam(k, str(v))
> elif verb == 'changegroup':
@@ -65,7 +65,7 @@ Create an extension to test bundle2 remo
> heads = [repo.lookup(r) for r in repo.revs(heads)]
> cg = changegroup.getchangegroup(repo, 'changegroup',
> heads=heads, common=common)
- > newpart('b2x:changegroup', cg.getchunks())
+ > newpart('changegroup', cg.getchunks())
> else:
> raise Exception('unknown verb')
>
@@ -137,7 +137,7 @@ Test a pull with an remote-changegroup
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -180,12 +180,12 @@ Test a pull with an remote-changegroup a
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files (+1 heads)
- remote: b2x:changegroup
+ remote: changegroup
adding changesets
adding manifests
adding file changes
@@ -228,12 +228,12 @@ Test a pull with a changegroup followed
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:changegroup
+ remote: changegroup
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files (+1 heads)
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -279,17 +279,17 @@ Test a pull with two remote-changegroups
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files (+1 heads)
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
added 2 changesets with 1 changes to 1 files
- remote: b2x:changegroup
+ remote: changegroup
adding changesets
adding manifests
adding file changes
@@ -324,7 +324,7 @@ Hash digest tests
> EOF
$ hg clone ssh://user@dummy/repo clone
requesting all changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -338,7 +338,7 @@ Hash digest tests
> EOF
$ hg clone ssh://user@dummy/repo clone
requesting all changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -354,7 +354,7 @@ Hash digest mismatch throws an error
> EOF
$ hg clone ssh://user@dummy/repo clone
requesting all changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -372,7 +372,7 @@ Multiple hash digests can be given
> EOF
$ hg clone ssh://user@dummy/repo clone
requesting all changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -388,7 +388,7 @@ If either of the multiple hash digests m
> EOF
$ hg clone ssh://user@dummy/repo clone
requesting all changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -404,7 +404,7 @@ If either of the multiple hash digests m
> EOF
$ hg clone ssh://user@dummy/repo clone
requesting all changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -433,12 +433,12 @@ Corruption tests
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files (+1 heads)
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -467,7 +467,7 @@ No params
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
abort: remote-changegroup: missing "url" param
[255]
@@ -479,7 +479,7 @@ Missing size
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
abort: remote-changegroup: missing "size" param
[255]
@@ -491,7 +491,7 @@ Invalid size
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
abort: remote-changegroup: invalid value for param "size"
[255]
@@ -503,7 +503,7 @@ Size mismatch
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
adding changesets
adding manifests
adding file changes
@@ -522,8 +522,8 @@ Unknown digest
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
- abort: missing support for b2x:remote-changegroup - digest:foo
+ remote: remote-changegroup
+ abort: missing support for remote-changegroup - digest:foo
[255]
Missing digest
@@ -534,7 +534,7 @@ Missing digest
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
abort: remote-changegroup: missing "digest:sha1" param
[255]
@@ -546,7 +546,7 @@ Not an HTTP url
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
abort: remote-changegroup does not support ssh urls
[255]
@@ -561,14 +561,14 @@ Not a bundle
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
abort: http://localhost:$HGPORT/notbundle.hg: not a Mercurial bundle
[255]
Not a bundle 1.0
$ cat > notbundle10.hg << EOF
- > HG2Y
+ > HG20
> EOF
$ cat > repo/.hg/bundle2maker << EOF
> remote-changegroup http://localhost:$HGPORT/notbundle10.hg notbundle10.hg
@@ -576,7 +576,7 @@ Not a bundle 1.0
$ hg pull -R clone ssh://user@dummy/repo
pulling from ssh://user@dummy/repo
searching for changes
- remote: b2x:remote-changegroup
+ remote: remote-changegroup
abort: http://localhost:$HGPORT/notbundle10.hg: not a bundle version 1.0
[255]
diff --git a/tests/test-casefolding.t b/tests/test-casefolding.t
--- a/tests/test-casefolding.t
+++ b/tests/test-casefolding.t
@@ -28,7 +28,6 @@ test case collision on rename (issue750)
a
committing manifest
committing changelog
- couldn't read revision branch cache names: * (glob)
committed changeset 0:07f4944404050f47db2e5c5071e0e84e7a27bba9
Case-changing renames should work:
diff --git a/tests/test-cat.t b/tests/test-cat.t
--- a/tests/test-cat.t
+++ b/tests/test-cat.t
@@ -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'
@@ -51,3 +63,8 @@ Test fileset
tmp/h_45116003780e
tmp/r_2
+Test working directory
+
+ $ echo b-wdir > b
+ $ hg cat -r 'wdir()' b
+ b-wdir
diff --git a/tests/test-censor.t b/tests/test-censor.t
new file mode 100644
--- /dev/null
+++ b/tests/test-censor.t
@@ -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 --git a/tests/test-children.t b/tests/test-children.t
--- a/tests/test-children.t
+++ b/tests/test-children.t
@@ -122,4 +122,12 @@ hg children file0 at revision 0 (should
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 --git a/tests/test-churn.t b/tests/test-churn.t
--- a/tests/test-churn.t
+++ b/tests/test-churn.t
@@ -171,4 +171,27 @@ Test multibyte sequences in names
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 --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -65,9 +65,25 @@ No update, with debug option:
#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
+ linking: 1
+ copying: 2
+ copying: 3
+ copying: 4
+ copying: 5
+ copying: 6
+ copying: 7
+ copying: 8
copied 8 files
#endif
$ cd ../c
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -47,6 +47,9 @@ Second branch starting at nullrev:
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
@@ -93,6 +96,10 @@ Template should precede style option
Default style is like normal output:
+ $ echo c >> c
+ $ hg add c
+ $ hg commit -qm ' '
+
$ hg log > log.out
$ hg log --style default > style.out
$ cmp log.out style.out || diff -u log.out style.out
@@ -132,6 +139,8 @@ Default style should also preserve color
$ mv $HGRCPATH-bak $HGRCPATH
+ $ hg --config extensions.strip= strip -q .
+
Revision with no copies (used to print a traceback):
$ hg tip -v --template '\n'
@@ -1868,6 +1877,16 @@ Count filter:
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 +1924,11 @@ Thrown an error if a template function d
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 +2314,14 @@ Test branches inside if statement:
$ 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 +2425,10 @@ Test current bookmark templating
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 --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -178,6 +178,7 @@ check that local configs for the cached
defaults.commit=-d "0 0"
defaults.shelve=--date "0 0"
defaults.tag=-d "0 0"
+ devel.all=true
largefiles.usercache=$TESTTMP/.cache/largefiles
ui.slash=True
ui.interactive=False
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -1096,7 +1096,7 @@ directory)
$ 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 @@ directory)
$ 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 --git a/tests/test-commit-interactive-curses.t b/tests/test-commit-interactive-curses.t
new file mode 100644
--- /dev/null
+++ b/tests/test-commit-interactive-curses.t
@@ -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 --git a/tests/test-record.t b/tests/test-commit-interactive.t
copy from tests/test-record.t
copy to tests/test-commit-interactive.t
--- a/tests/test-record.t
+++ b/tests/test-commit-interactive.t
@@ -15,7 +15,7 @@ Select no files
$ touch empty-rw
$ hg add empty-rw
- $ hg record empty-rw< n
> EOF
diff --git a/empty-rw b/empty-rw
@@ -34,7 +34,7 @@ Select no files
Select files but no hunks
- $ hg record empty-rw< y
> n
> EOF
@@ -55,7 +55,7 @@ Select files but no hunks
Record empty file
- $ hg record -d '0 0' -m empty empty-rw< y
> y
> EOF
@@ -85,7 +85,7 @@ Summary shows we updated to the new cset
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
@@ -106,7 +106,7 @@ Rename empty file
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
@@ -127,7 +127,7 @@ Copy empty file
Delete empty file
$ hg rm empty-copy
- $ hg record -d '3 0' -m delete< y
> EOF
diff --git a/empty-copy b/empty-copy
@@ -149,7 +149,7 @@ 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
@@ -173,7 +173,7 @@ 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
@@ -197,7 +197,7 @@ 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
@@ -227,7 +227,7 @@ Add plain file
> done
$ hg add plain
- $ hg record -d '7 0' -m plain plain< y
> y
> EOF
@@ -235,7 +235,19 @@ Add plain file
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
@@ -262,7 +274,7 @@ Modify end of plain file with username u
$ echo 11 >> plain
$ unset HGUSER
- $ hg record --config ui.username= -d '8 0' -m end plain
+ $ 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]
@@ -272,7 +284,7 @@ Modify end of plain file, also test that
$ HGUSER="test"
$ export HGUSER
- $ hg record --config diff.showfunc=true -d '8 0' -m end plain < y
> y
> EOF
@@ -291,7 +303,7 @@ Modify end of plain file, also test that
Modify end of plain file, no EOL
$ hg tip --template '{node}' >> plain
- $ hg record -d '9 0' -m noeol plain < y
> y
> EOF
@@ -313,7 +325,8 @@ 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
> y
@@ -335,7 +348,10 @@ Modify end of plain file, add EOL
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
@@ -345,7 +361,7 @@ changes numbering
> done
$ echo 2 >> plain2
- $ hg record -d '10 0' -m begin-and-end plain plain2 < y
> y
> y
@@ -421,7 +437,7 @@ Trim beginning, modify end
Record end
- $ hg record -d '11 0' -m end-only plain < y
> n
> y
@@ -474,7 +490,7 @@ Record end
Record beginning
- $ hg record -d '12 0' -m begin-only plain < y
> y
> EOF
@@ -520,7 +536,7 @@ Add to beginning, trim from end
Record end
- $ hg record --traceback -d '13 0' -m end-again plain< y
> n
> y
@@ -561,7 +577,7 @@ Add to beginning, middle, end
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
@@ -625,7 +641,7 @@ Record beginning, middle, and test that
Record end
- $ hg record -d '15 0' -m end-only plain < y
> y
> EOF
@@ -667,7 +683,7 @@ Record end
adding subdir/a
$ echo a >> a
- $ hg record -d '16 0' -m subdir-change a < y
> y
> EOF
@@ -707,7 +723,7 @@ Record end
Help, quit
- $ hg record < ?
> q
> EOF
@@ -731,7 +747,7 @@ Help, quit
Skip
- $ hg record < s
> EOF
diff --git a/subdir/f1 b/subdir/f1
@@ -745,7 +761,7 @@ Skip
No
- $ hg record < n
> EOF
diff --git a/subdir/f1 b/subdir/f1
@@ -759,7 +775,7 @@ No
f, quit
- $ hg record < f
> q
> EOF
@@ -776,7 +792,7 @@ f, quit
s, all
- $ hg record -d '18 0' -mx < s
> a
> EOF
@@ -806,7 +822,7 @@ s, all
f
- $ hg record -d '19 0' -my < f
> EOF
diff --git a/subdir/f1 b/subdir/f1
@@ -835,7 +851,7 @@ Preserve chmod +x
$ chmod +x f1
$ echo a >> f1
- $ hg record -d '20 0' -mz < y
> y
> y
@@ -874,7 +890,7 @@ Preserve chmod +x
Preserve execute permission on original
$ echo b >> f1
- $ hg record -d '21 0' -maa < y
> y
> y
@@ -912,7 +928,7 @@ Preserve chmod -x
$ chmod -x f1
$ echo c >> f1
- $ hg record -d '22 0' -mab < y
> y
> y
@@ -958,7 +974,7 @@ Slightly bogus tests to get almost same
Mock "Preserve chmod +x"
$ echo a >> f1
- $ hg record -d '20 0' -mz < y
> y
> y
@@ -993,7 +1009,7 @@ Mock "Preserve chmod +x"
Mock "Preserve execute permission on original"
$ echo b >> f1
- $ hg record -d '21 0' -maa < y
> y
> y
@@ -1031,7 +1047,7 @@ Mock "Preserve chmod -x"
$ chmod -x f1
$ echo c >> f1
- $ hg record -d '22 0' -mab < y
> y
> y
@@ -1091,7 +1107,7 @@ Abort early when a merge is in progress
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
- $ hg record -m'will abort'
+ $ hg commit -i -m'will abort'
abort: cannot partially commit a merge (use "hg commit" instead)
[255]
@@ -1117,7 +1133,7 @@ Editing patch (and ignoring trailing tex
> 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
@@ -1146,7 +1162,7 @@ Editing patch (and ignoring trailing tex
Trying to edit patch for whole file
$ echo "This is the fourth line" >> editedfile
- $ hg record < e
> q
> EOF
@@ -1170,7 +1186,7 @@ Removing changes from patch
> sed -e 's/^[-+]/ /' "$1" > tmp
> mv tmp "$1"
> __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
> e
> EOF
@@ -1207,7 +1223,7 @@ Invalid patch
> sed s/This/That/ "$1" > tmp
> mv tmp "$1"
> __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
> e
> EOF
@@ -1254,7 +1270,7 @@ Malformed patch - error handling
> sed -e '/^@/p' "$1" > tmp
> mv tmp "$1"
> __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
> e
> EOF
@@ -1281,7 +1297,7 @@ random text in random positions is still
> other' "$1" > tmp
> mv tmp "$1"
> __EOF__
- $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record < y
> e
> EOF
@@ -1321,7 +1337,7 @@ Ignore win32text deprecation warning for
$ echo 'warn = no' >> .hg/hgrc
$ echo d >> subdir/f1
- $ hg record -d '24 0' -mw1 < y
> y
> EOF
@@ -1353,10 +1369,12 @@ Ignore win32text deprecation warning for
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
@@ -1376,4 +1394,41 @@ Test --user when ui.username not set
$ 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 --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -202,8 +202,8 @@ Show all commands + options
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 @@ Show all commands + options
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 @@ Show all commands + options
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 --git a/tests/test-context.py b/tests/test-context.py
--- a/tests/test-context.py
+++ b/tests/test-context.py
@@ -51,7 +51,7 @@ print ctxb.status(ctxa)
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 --git a/tests/test-convert-cvs.t b/tests/test-convert-cvs.t
--- a/tests/test-convert-cvs.t
+++ b/tests/test-convert-cvs.t
@@ -397,11 +397,12 @@ testing debugcvsps
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 @@ testing debugcvsps
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 --git a/tests/test-convert-datesort.t b/tests/test-convert-datesort.t
--- a/tests/test-convert-datesort.t
+++ b/tests/test-convert-datesort.t
@@ -85,9 +85,9 @@ graph converted repo
$ 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 @@ graph converted repo
$ 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 @@ graph converted repo
|\
| o 11 "c0"
| |
- o | 10 "b2x"
+ _ | 10 "b2x"
| |
o | 9 "b1"
| |
- | | o 8 "a7x"
+ | | _ 8 "a7x"
| | |
| | o 7 "a6"
| | |
diff --git a/tests/test-convert-filemap.t b/tests/test-convert-filemap.t
--- a/tests/test-convert-filemap.t
+++ b/tests/test-convert-filemap.t
@@ -387,15 +387,15 @@ test branch closing revision pruning if
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 @@ exercise incremental conversion at the s
1 closeempty
0 closedefault
$ glog -R branchpruning-hg2
- o 1 "closedefault" files:
+ _ 1 "closedefault" files:
|
o 0 "addb" files: b
diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
--- a/tests/test-convert-git.t
+++ b/tests/test-convert-git.t
@@ -170,7 +170,79 @@ Remove the directory, then try to replac
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 --git a/tests/test-convert-svn-encoding.t b/tests/test-convert-svn-encoding.t
--- a/tests/test-convert-svn-encoding.t
+++ b/tests/test-convert-svn-encoding.t
@@ -53,7 +53,6 @@ Convert while testing all possible outpu
source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@1
converting: 0/6 revisions (0.00%)
committing changelog
- couldn't read revision branch cache names: * (glob)
4 hello
source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2
converting: 1/6 revisions (16.67%)
diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -138,7 +138,7 @@ should print a warning that this is not
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 --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t
--- a/tests/test-debugcommands.t
+++ b/tests/test-debugcommands.t
@@ -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 --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t
new file mode 100644
--- /dev/null
+++ b/tests/test-devel-warnings.t
@@ -0,0 +1,90 @@
+
+ $ 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()
+ >
+ > @command('properlocking', [], '')
+ > def properlocking(ui, repo):
+ > """check that reentrance is fine"""
+ > wl = repo.wlock()
+ > lo = repo.lock()
+ > tr = repo.transaction('proper')
+ > tr2 = repo.transaction('proper')
+ > lo2 = repo.lock()
+ > wl2 = repo.wlock()
+ > wl2.release()
+ > lo2.release()
+ > tr2.close()
+ > tr.close()
+ > lo.release()
+ > wl.release()
+ >
+ > @command('nowaitlocking', [], '')
+ > def nowaitlocking(ui, repo):
+ > lo = repo.lock()
+ > wl = repo.wlock(wait=False)
+ > 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
+ devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:11 (buggylocking)
+ devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:13 (buggylocking)
+ $ cat << EOF >> $HGRCPATH
+ > [devel]
+ > all=0
+ > check-locks=1
+ > EOF
+ $ hg buggylocking
+ devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:11 (buggylocking)
+ devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:13 (buggylocking)
+ $ hg buggylocking --traceback
+ devel-warn: 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)
+ devel-warn: "wlock" acquired after "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)
+ $ hg properlocking
+ $ hg nowaitlocking
+ $ cd ..
diff --git a/tests/test-diff-subdir.t b/tests/test-diff-subdir.t
--- a/tests/test-diff-subdir.t
+++ b/tests/test-diff-subdir.t
@@ -44,4 +44,24 @@ inside beta
@@ -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 --git a/tests/test-diff-unified.t b/tests/test-diff-unified.t
--- a/tests/test-diff-unified.t
+++ b/tests/test-diff-unified.t
@@ -286,4 +286,51 @@ Git diff, removing space
-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 --git a/tests/test-diffstat.t b/tests/test-diffstat.t
--- a/tests/test-diffstat.t
+++ b/tests/test-diffstat.t
@@ -69,4 +69,39 @@ Filename with spaces git diffstat:
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 --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -19,6 +19,7 @@ testmod('mercurial.hg')
testmod('mercurial.hgweb.hgwebdir_mod')
testmod('mercurial.match')
testmod('mercurial.minirst')
+testmod('mercurial.patch')
testmod('mercurial.pathutil')
testmod('mercurial.revset')
testmod('mercurial.store')
diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -946,6 +946,9 @@ Older extension is tested with current v
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 @@ disabling in command line overlays with
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 --git a/tests/test-fetch.t b/tests/test-fetch.t
--- a/tests/test-fetch.t
+++ b/tests/test-fetch.t
@@ -339,7 +339,8 @@ pull in change on different branch than
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 --git a/tests/test-fileset-generated.t b/tests/test-fileset-generated.t
--- a/tests/test-fileset-generated.t
+++ b/tests/test-fileset-generated.t
@@ -141,39 +141,34 @@ Test log
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 --git a/tests/test-fileset.t b/tests/test-fileset.t
--- a/tests/test-fileset.t
+++ b/tests/test-fileset.t
@@ -111,6 +111,13 @@ Test files properties
$ 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 @@ Test with a revision
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 --git a/tests/test-gendoc.t b/tests/test-gendoc.t
--- a/tests/test-gendoc.t
+++ b/tests/test-gendoc.t
@@ -1,4 +1,5 @@
#require docutils
+#require gettext
Test document extraction
diff --git a/tests/test-getbundle.t b/tests/test-getbundle.t
--- a/tests/test-getbundle.t
+++ b/tests/test-getbundle.t
@@ -170,7 +170,7 @@ Get branch and merge:
$ hg debuggetbundle repo bundle -t bundle2
$ hg debugbundle bundle
Stream params: {}
- b2x:changegroup -- "{'version': '01'}"
+ changegroup -- "{'version': '01'}"
7704483d56b2a7b5db54dcee7c62378ac629b348
29a4d1f17bd3f0779ca0525bebb1cfb51067c738
713346a995c363120712aed1aee7e04afd867638
diff --git a/tests/test-git-export.t b/tests/test-git-export.t
--- a/tests/test-git-export.t
+++ b/tests/test-git-export.t
@@ -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 --git a/tests/test-globalopts.t b/tests/test-globalopts.t
--- a/tests/test-globalopts.t
+++ b/tests/test-globalopts.t
@@ -309,7 +309,7 @@ Testing -h/--help:
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 @@ Testing -h/--help:
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 --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -1541,6 +1541,9 @@ have 2 filelog topological heads in a li
$ testlog --follow
[]
[]
+ $ testlog -rnull
+ ['null']
+ []
$ echo a > a
$ echo aa > aa
$ echo f > f
@@ -1764,6 +1767,13 @@ Test --follow and multiple files
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 @@ Test --follow and forward --rev
(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 @@ Test --follow-first and backward --rev
('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 @@ issue3772
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 --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -313,7 +313,7 @@ Graft again onto another branch should p
2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
$ hg log --debug -r tip
- changeset: 13:9db0f28fd3747e92c57d015f53b5593aeec53c2d
+ changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
tag: tip
phase: draft
parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
@@ -324,6 +324,7 @@ Graft again onto another branch should p
files+: b
files-: a
extra: branch=default
+ extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
description:
2
@@ -338,10 +339,10 @@ Disallow grafting an already grafted cse
Disallow grafting already grafted csets with the same origin onto each other
$ hg up -q 13
$ hg graft 2
- skipping revision 2:5c095ad7e90f (already grafted to 13:9db0f28fd374)
+ skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
[255]
$ hg graft 7
- skipping already grafted revision 7:ef0ef43d49e7 (13:9db0f28fd374 also has origin 2:5c095ad7e90f)
+ skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
[255]
$ hg up -q 7
@@ -349,7 +350,7 @@ Disallow grafting already grafted csets
skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
[255]
$ hg graft tip
- skipping already grafted revision 13:9db0f28fd374 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
+ skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
[255]
Graft with --log
@@ -543,7 +544,7 @@ Test simple destination
date: Thu Jan 01 00:00:00 1970 +0000
summary: 3
- changeset: 13:9db0f28fd374
+ changeset: 13:7a4785234d87
user: foo
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
@@ -578,7 +579,7 @@ Test simple destination
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
- changeset: 13:9db0f28fd374
+ changeset: 13:7a4785234d87
user: foo
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
@@ -621,7 +622,7 @@ All copies of a cset
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
- changeset: 13:9db0f28fd374
+ changeset: 13:7a4785234d87
user: foo
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
@@ -637,7 +638,7 @@ All copies of a cset
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
- changeset: 22:e95864da75a0
+ changeset: 22:d1cb6591fa4b
branch: dev
tag: tip
user: foo
@@ -649,11 +650,11 @@ graft works on complex revset
$ hg graft 'origin(13) or destination(origin(13))'
skipping ancestor revision 21:7e61b508e709
- skipping ancestor revision 22:e95864da75a0
- skipping revision 2:5c095ad7e90f (already grafted to 22:e95864da75a0)
+ skipping ancestor revision 22:d1cb6591fa4b
+ skipping revision 2:5c095ad7e90f (already grafted to 22:d1cb6591fa4b)
grafting 7:ef0ef43d49e7 "2"
warning: can't find ancestor for 'b' copied from 'a'!
- grafting 13:9db0f28fd374 "2"
+ grafting 13:7a4785234d87 "2"
warning: can't find ancestor for 'b' copied from 'a'!
grafting 19:9627f653b421 "2"
merging b
@@ -664,7 +665,7 @@ graft with --force (still doesn't graft
$ hg graft 19 0 6
skipping ungraftable merge revision 6
skipping ancestor revision 0:68795b066622
- skipping already grafted revision 19:9627f653b421 (22:e95864da75a0 also has origin 2:5c095ad7e90f)
+ skipping already grafted revision 19:9627f653b421 (22:d1cb6591fa4b also has origin 2:5c095ad7e90f)
[255]
$ hg graft 19 0 6 --force
skipping ungraftable merge revision 6
@@ -679,12 +680,12 @@ graft --force after backout
$ hg ci -m 28
$ hg backout 28
reverting a
- changeset 29:8389853bba65 backs out changeset 28:cd42a33e1848
+ changeset 29:53177ba928f6 backs out changeset 28:50a516bb8b57
$ hg graft 28
- skipping ancestor revision 28:cd42a33e1848
+ skipping ancestor revision 28:50a516bb8b57
[255]
$ hg graft 28 --force
- grafting 28:cd42a33e1848 "28"
+ grafting 28:50a516bb8b57 "28"
merging a
$ cat a
abc
@@ -694,7 +695,7 @@ graft --continue after --force
$ echo def > a
$ hg ci -m 31
$ hg graft 28 --force --tool internal:fail
- grafting 28:cd42a33e1848 "28"
+ grafting 28:50a516bb8b57 "28"
abort: unresolved conflicts, can't continue
(use hg resolve and hg graft --continue)
[255]
@@ -707,7 +708,7 @@ graft --continue after --force
$ hg resolve -m a
(no more unresolved files)
$ hg graft -c
- grafting 28:cd42a33e1848 "28"
+ grafting 28:50a516bb8b57 "28"
$ cat a
abc
@@ -719,7 +720,7 @@ but do some destructive editing of the r
$ hg --config extensions.strip= strip 2
saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg (glob)
$ hg graft tmp
- skipping already grafted revision 8:9db0f28fd374 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
+ skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
[255]
Empty graft
@@ -728,5 +729,45 @@ Empty graft
$ hg tag -f something
$ hg graft -qr 27
$ hg graft -f 27
- grafting 27:3d35c4c79e5a "28"
- note: graft of 27:3d35c4c79e5a created no changes to commit
+ grafting 27:ed6c7e54e319 "28"
+ note: graft of 27:ed6c7e54e319 created no changes to commit
+
+ $ cd ..
+
+Graft to duplicate a commit
+
+ $ hg init graftsibling
+ $ cd graftsibling
+ $ touch a
+ $ hg commit -qAm a
+ $ touch b
+ $ hg commit -qAm b
+ $ hg log -G -T '{rev}\n'
+ @ 1
+ |
+ o 0
+
+ $ hg up -q 0
+ $ hg graft -r 1
+ grafting 1:0e067c57feba "b" (tip)
+ $ hg log -G -T '{rev}\n'
+ @ 2
+ |
+ | o 1
+ |/
+ o 0
+
+Graft to duplicate a commit twice
+
+ $ hg up -q 0
+ $ hg graft -r 2
+ grafting 2:044ec77f6389 "b" (tip)
+ $ hg log -G -T '{rev}\n'
+ @ 3
+ |
+ | o 2
+ |/
+ | o 1
+ |/
+ o 0
+
diff --git a/tests/test-grep.t b/tests/test-grep.t
--- a/tests/test-grep.t
+++ b/tests/test-grep.t
@@ -82,6 +82,10 @@ follow
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 --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t
--- a/tests/test-hardlinks.t
+++ b/tests/test-hardlinks.t
@@ -58,6 +58,13 @@ Prepare repo r1:
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 --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -72,7 +72,7 @@ Short help:
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 @@ Short help:
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 @@ Test extension help:
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 @@ Test help option with version option
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 @@ Test command without options
-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 @@ Test that default list of commands omits
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 @@ Test section lookup
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 @@ Dish up an empty repo; serve it cold.
identify
- identify the working copy or specified revision
+ identify the working directory or specified revision
|
diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t
--- a/tests/test-hgrc.t
+++ b/tests/test-hgrc.t
@@ -71,7 +71,7 @@ issue1829: wrong indentation
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 --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -726,7 +726,6 @@ Logs and changes
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -873,7 +874,8 @@ Logs and changes
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
|
@@ -894,8 +896,7 @@ Logs and changes
[+]
[-]
-
-
+
da/foo |
1 |
@@ -1012,11 +1013,13 @@ Logs and changes
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -1869,7 +1872,7 @@ capabilities
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
200 Script output follows
- lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
+ lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1*%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 (glob)
heads
@@ -2049,7 +2052,7 @@ capabilities
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
200 Script output follows
- lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream-preferred stream unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
+ lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream-preferred stream bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1*%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 (glob)
heads
diff --git a/tests/test-hgweb-descend-empties.t b/tests/test-hgweb-descend-empties.t
--- a/tests/test-hgweb-descend-empties.t
+++ b/tests/test-hgweb-descend-empties.t
@@ -81,11 +81,13 @@ manifest with descending
+
name |
size |
permissions |
+
[up] |
diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t
+++ b/tests/test-hgweb-diffs.t
@@ -97,7 +97,8 @@ revision
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
|
@@ -118,8 +119,7 @@ revision
[+]
[-]
-
-
+
a |
1 |
@@ -369,7 +369,8 @@ revision
|
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
|
@@ -390,8 +391,7 @@ revision
[+]
[-]
-
-
+
a |
1 |
diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t
--- a/tests/test-hgweb-empty.t
+++ b/tests/test-hgweb-empty.t
@@ -48,7 +48,6 @@ Some tests for hgweb in an empty reposit
-
+
age |
author |
description |
+
@@ -158,7 +159,6 @@ Some tests for hgweb in an empty reposit
-
+
age |
author |
description |
+
@@ -264,7 +266,6 @@ Some tests for hgweb in an empty reposit
-
@@ -431,11 +432,13 @@ Some tests for hgweb in an empty reposit
+
name |
size |
permissions |
+
[up] |
diff --git a/tests/test-hgweb-filelog.t b/tests/test-hgweb-filelog.t
--- a/tests/test-hgweb-filelog.t
+++ b/tests/test-hgweb-filelog.t
@@ -156,7 +156,6 @@ tip - two revisions
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -266,7 +267,6 @@ second version - two revisions
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -376,7 +378,6 @@ first deleted - one revision
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
@@ -481,7 +484,6 @@ first version - one revision
-
+
age |
author |
description |
+
Thu, 01 Jan 1970 00:00:00 +0000 |
diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t
new file mode 100644
--- /dev/null
+++ b/tests/test-hgweb-json.t
@@ -0,0 +1,1111 @@
+#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
+
+ {
+ "author": "test",
+ "children": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify foo",
+ "diff": [
+ {
+ "blockno": 1,
+ "lines": [
+ {
+ "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
+ "n": 1,
+ "t": "-"
+ },
+ {
+ "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
+ "n": 2,
+ "t": "+"
+ },
+ {
+ "l": "@@ -1,1 +1,1 @@\n",
+ "n": 3,
+ "t": "@"
+ },
+ {
+ "l": "-foo\n",
+ "n": 4,
+ "t": "-"
+ },
+ {
+ "l": "+bar\n",
+ "n": 5,
+ "t": "+"
+ }
+ ]
+ }
+ ],
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
+ "parents": [
+ "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
+ ],
+ "path": "foo"
+ }
+
+comparison/{revision}/{path} shows information about before and after for a file
+
+ $ request json-comparison/f8bbb9024b10/foo
+ 200 Script output follows
+
+ {
+ "author": "test",
+ "children": [],
+ "comparison": [
+ {
+ "lines": [
+ {
+ "ll": "foo",
+ "ln": 1,
+ "rl": "bar",
+ "rn": 1,
+ "t": "replace"
+ }
+ ]
+ }
+ ],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify foo",
+ "leftnode": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
+ "parents": [
+ "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
+ ],
+ "path": "foo",
+ "rightnode": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
+ }
+
+annotate/{revision}/{path} shows annotations for each line
+
+ $ request json-annotate/f8bbb9024b10/foo
+ 200 Script output follows
+
+ {
+ "abspath": "foo",
+ "annotate": [
+ {
+ "abspath": "foo",
+ "author": "test",
+ "desc": "modify foo",
+ "line": "bar\n",
+ "lineno": 1,
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
+ "revdate": [
+ 0.0,
+ 0
+ ],
+ "targetline": 1
+ }
+ ],
+ "author": "test",
+ "children": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "modify foo",
+ "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
+ "parents": [
+ "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
+ ],
+ "permissions": ""
+ }
+
+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 --git a/tests/test-hgweb-removed.t b/tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t
+++ b/tests/test-hgweb-removed.t
@@ -78,7 +78,8 @@ revision
date |
- Thu, 01 Jan 1970 00:00:00 +0000 |
+ Thu, 01 Jan 1970 00:00:00 +0000 |
+
parents |
cb9a9f314b8b |
@@ -99,8 +100,7 @@ revision
[+]
[-]
-
-
+
a |
1 |
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -272,11 +272,13 @@ try bad style
+
name |
size |
permissions |
+
[up] |
diff --git a/tests/test-hgwebdir.t b/tests/test-hgwebdir.t
--- a/tests/test-hgwebdir.t
+++ b/tests/test-hgwebdir.t
@@ -201,6 +201,7 @@ should succeed, slashy names
+
Name |
Description |
@@ -209,6 +210,7 @@ should succeed, slashy names
|
|
+
@@ -699,6 +701,7 @@ should succeed, slashy names
+
Name |
Description |
@@ -707,6 +710,7 @@ should succeed, slashy names
|
|
+
@@ -1128,6 +1132,7 @@ test inexistent and inaccessible repo sh
+
Name |
Description |
@@ -1136,6 +1141,7 @@ test inexistent and inaccessible repo sh
|
|
+
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -268,10 +268,12 @@ hgweb fileannotate, html
+
rev |
line source |
+
diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t
+++ b/tests/test-histedit-arguments.t
@@ -103,6 +103,15 @@ Test that we pick the minimum of a revra
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
--------------------------------------------------------------------
@@ -111,6 +120,13 @@ created (and forgotten) by Mercurial ear
Mercurial earlier than 2.7 by renaming ".hg/histedit-state"
temporarily.
+ $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
+ @ 4 08d9 five
+ |
+ o 3 c8e6 four
+ |
+ o 2 eb57 three
+ |
$ HGEDITOR=cat hg histedit -r 4 --commands - << EOF
> edit 08d98a8350f3 4 five
> EOF
@@ -122,15 +138,23 @@ temporarily.
$ mv .hg/histedit-state .hg/histedit-state.back
$ hg update --quiet --clean 2
+ $ echo alpha >> alpha
$ mv .hg/histedit-state.back .hg/histedit-state
$ hg histedit --continue
- abort: c8e68270e35a is not an ancestor of working directory
- (use "histedit --abort" to clear broken state)
- [255]
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg (glob)
+ $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
+ @ 4 f5ed five
+ |
+ | o 3 c8e6 four
+ |/
+ o 2 eb57 three
+ |
- $ hg histedit --abort
- $ hg update --quiet --clean
+ $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg
+ $ hg strip -q -r f5ed --config extensions.strip=
+ $ hg up -q 08d98a8350f3
Test that missing revisions are detected
---------------------------------------
diff --git a/tests/test-histedit-bookmark-motion.t b/tests/test-histedit-bookmark-motion.t
--- a/tests/test-histedit-bookmark-motion.t
+++ b/tests/test-histedit-bookmark-motion.t
@@ -92,7 +92,7 @@
histedit: moving bookmarks two from 177f92b77385 to b346ab9a313d
histedit: moving bookmarks will-move-backwards from d2ae7f538514 to cb9a9f314b8b
saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-48787b8d-backup.hg (glob)
- saved backup bundle to $TESTTMP/r/.hg/strip-backup/96e494a2d553-60cea58b-backup.hg (glob)
+ saved backup bundle to $TESTTMP/r/.hg/strip-backup/96e494a2d553-3c6c5d92-backup.hg (glob)
$ hg log --graph
@ changeset: 3:cacdfd884a93
| bookmark: five
diff --git a/tests/test-histedit-drop.t b/tests/test-histedit-drop.t
--- a/tests/test-histedit-drop.t
+++ b/tests/test-histedit-drop.t
@@ -96,7 +96,6 @@ log after edit
Check histedit_source
$ hg log --debug --rev f518305ce889
- invalid branchheads cache (visible): tip differs
changeset: 4:f518305ce889c07cb5bd05522176d75590ef3324
tag: tip
phase: draft
diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t
--- a/tests/test-histedit-edit.t
+++ b/tests/test-histedit-edit.t
@@ -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 @@ edit the history
> 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 @@ Go at a random point and try to continue
(use 'hg histedit --continue' or 'hg histedit --abort')
[255]
+Try to delete necessary commit
+ $ hg strip -r 652413b
+ abort: histedit in progress, can't strip 652413bf663e
+ [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
@@ -121,6 +147,34 @@ commit, then edit the revision
$ hg cat e
a
+Stripping necessary commits should not break --abort
+
+ $ hg histedit 1a60820cd1f6 --commands - 2>&1 << EOF| fixbundle
+ > edit 1a60820cd1f6 wat
+ > pick a5e1ba2f7afb foobaz
+ > pick b5f70786f9b0 g
+ > EOF
+ 0 files updated, 0 files merged, 2 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.
+
+ $ mv .hg/histedit-state .hg/histedit-state.bak
+ $ hg strip -q -r b5f70786f9b0
+ $ mv .hg/histedit-state.bak .hg/histedit-state
+ $ hg histedit --abort
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 3 files
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg log -r .
+ changeset: 6:b5f70786f9b0
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: f
+
+
check histedit_source
$ hg log --debug --rev 5
diff --git a/tests/test-histedit-fold-non-commute.t b/tests/test-histedit-fold-non-commute.t
--- a/tests/test-histedit-fold-non-commute.t
+++ b/tests/test-histedit-fold-non-commute.t
@@ -132,6 +132,7 @@ just continue this time
$ hg resolve --mark e
(no more unresolved files)
$ hg histedit --continue 2>&1 | fixbundle
+ 7b4e2f4b7bcd: empty changeset
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -274,6 +275,7 @@ just continue this time
$ hg resolve --mark e
(no more unresolved files)
$ hg histedit --continue 2>&1 | fixbundle
+ 7b4e2f4b7bcd: empty changeset
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 --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t
--- a/tests/test-histedit-fold.t
+++ b/tests/test-histedit-fold.t
@@ -307,6 +307,7 @@ should effectively drop the changes from
$ hg resolve --mark file
(no more unresolved files)
$ hg histedit --continue
+ 251d831eeec5: empty changeset
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
saved backup bundle to $TESTTMP/*-backup.hg (glob)
$ hg logt --graph
diff --git a/tests/test-histedit-non-commute-abort.t b/tests/test-histedit-non-commute-abort.t
--- a/tests/test-histedit-non-commute-abort.t
+++ b/tests/test-histedit-non-commute-abort.t
@@ -70,8 +70,6 @@ edit the history
> pick 652413bf663e f
> EOF
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
- remote changed e which local deleted
- use (c)hanged version or leave (d)eleted? c
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
merging e
warning: conflicts during merge.
diff --git a/tests/test-histedit-non-commute.t b/tests/test-histedit-non-commute.t
--- a/tests/test-histedit-non-commute.t
+++ b/tests/test-histedit-non-commute.t
@@ -170,6 +170,7 @@ just continue this time
$ hg resolve --mark e
(no more unresolved files)
$ hg histedit --continue 2>&1 | fixbundle
+ 7b4e2f4b7bcd: empty changeset
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -253,6 +254,7 @@ second edit also fails, but just continu
$ hg resolve --mark e
(no more unresolved files)
$ hg histedit --continue 2>&1 | fixbundle
+ 7b4e2f4b7bcd: empty changeset
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 --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -64,7 +64,7 @@ Enable obsolete
> fold e860deea161a 4 e
> pick 652413bf663e 5 f
> EOF
- saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-60cea58b-backup.hg (glob)
+ saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-3c6c5d92-backup.hg (glob)
$ hg log --graph --hidden
@ 8:cacdfd884a93 f
|
@@ -427,9 +427,9 @@ Note that there is a few reordering in t
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
- saved backup bundle to $TESTTMP/folding/.hg/strip-backup/58019c66f35f-be4b3835-backup.hg (glob)
- saved backup bundle to $TESTTMP/folding/.hg/strip-backup/83d1858e070b-08306a6b-backup.hg (glob)
- saved backup bundle to $TESTTMP/folding/.hg/strip-backup/859969f5ed7e-86c99c41-backup.hg (glob)
+ saved backup bundle to $TESTTMP/folding/.hg/strip-backup/58019c66f35f-96092fce-backup.hg (glob)
+ saved backup bundle to $TESTTMP/folding/.hg/strip-backup/83d1858e070b-f3469cf8-backup.hg (glob)
+ saved backup bundle to $TESTTMP/folding/.hg/strip-backup/859969f5ed7e-d89a19d7-backup.hg (glob)
$ hg log -G
@ 19:f9daec13fb98 (secret) i
|
diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -12,13 +12,20 @@ commit hooks can see env vars
> 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"
+ > txnabort = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnabort"
> 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_PHASES_MOVED=1 HG_TXNID=TXN:* HG_XNNAME=commit (glob)
+ txnclose hook: HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
@@ -42,8 +49,11 @@ pretxncommit and commit hooks can see bo
$ 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_TXNID=TXN:* HG_XNNAME=commit (glob)
+ txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
$ hg update -C 0
@@ -52,8 +62,11 @@ pretxncommit and commit hooks can see bo
$ 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_TXNID=TXN:* HG_XNNAME=commit (glob)
+ txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
created new head
@@ -62,8 +75,11 @@ pretxncommit and commit hooks can see bo
(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_TXNID=TXN:* HG_XNNAME=commit (glob)
+ txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
@@ -82,15 +98,15 @@ test generic hooks
$ hg pull ../a
pulling from ../a
searching for changes
- prechangegroup hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a
+ prechangegroup hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
- changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a
- incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a
- incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
- incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
+ changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
+ incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
+ incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
+ incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
(run 'hg update' to get a working copy)
tag hooks can see env vars
@@ -103,9 +119,12 @@ tag hooks can see env vars
$ 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_TXNID=TXN:* HG_XNNAME=commit (glob)
tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
+ txnclose hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
$ hg tag -l la
@@ -137,11 +156,13 @@ more there after
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
pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
transaction abort!
+ txnabort hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
rollback completed
abort: pretxncommit.forbid1 hook exited with status 1
[255]
@@ -198,6 +219,9 @@ pushkey hook
pushing to ../a
searching for changes
no changes found
+ pretxnopen hook: HG_TXNNAME=bookmarks
+ pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_XNNAME=bookmarks (glob)
+ txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=bookmarks (glob)
pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1
exporting bookmark foo
[1]
@@ -260,7 +284,7 @@ prechangegroup hook can prevent incoming
$ hg pull ../a
pulling from ../a
searching for changes
- prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a
+ prechangegroup.forbid hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
abort: prechangegroup.forbid hook exited with status 1
[255]
@@ -280,7 +304,7 @@ incoming changes no longer there after
adding file changes
added 1 changesets with 1 changes to 1 files
4:539e4b31b6dc
- pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_URL=file:$TESTTMP/a
+ pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
transaction abort!
rollback completed
abort: pretxnchangegroup.forbid1 hook exited with status 1
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -127,7 +127,7 @@ pull
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
- changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/
+ changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=http://localhost:$HGPORT1/ (glob)
(run 'hg update' to get a working copy)
$ cd ..
diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -119,12 +119,12 @@ OS X has a dummy CA cert that enables us
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,14 +156,14 @@ pull without cacert
$ 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
adding file changes
added 1 changesets with 1 changes to 1 files
- changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
+ changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=https://localhost:$HGPORT/ (glob)
(run 'hg update' to get a working copy)
$ cd ..
@@ -188,28 +188,30 @@ variables in the filename
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 @@ Test server cert which isn't valid yet
$ 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 @@ Test server cert which no longer is vali
$ 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 @@ Fingerprints
$ 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 @@ Prepare for connecting through proxy
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 cacert and fingerprint t
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 --git a/tests/test-import-bypass.t b/tests/test-import-bypass.t
--- a/tests/test-import-bypass.t
+++ b/tests/test-import-bypass.t
@@ -104,6 +104,86 @@ Test --strip
$ 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 @@ Test unsupported combinations
$ 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 --git a/tests/test-import-git.t b/tests/test-import-git.t
--- a/tests/test-import-git.t
+++ b/tests/test-import-git.t
@@ -612,12 +612,114 @@ Renames and strip
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 --git a/tests/test-import.t b/tests/test-import.t
--- a/tests/test-import.t
+++ b/tests/test-import.t
@@ -670,6 +670,25 @@ test -p0
$ 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 --git a/tests/test-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -113,8 +113,6 @@ Largefile in the working copy, keeping t
$ echo "l" | hg merge --config ui.interactive=Yes
remote turned local largefile foo into a normal file
keep (l)argefile or use (n)ormal file? l
- getting changed largefiles
- 0 largefiles updated, 0 removed
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
@@ -249,8 +247,6 @@ swap
$ hg up -Cqr large
$ hg merge -r normal-id
- getting changed largefiles
- 0 largefiles updated, 0 removed
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cat f
@@ -271,8 +267,6 @@ swap
$ hg up -Cqr large
$ hg merge -r normal-same
- getting changed largefiles
- 0 largefiles updated, 0 removed
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cat f
@@ -307,8 +301,6 @@ swap
$ hg merge -r normal2
remote turned local largefile f into a normal file
keep (l)argefile or use (n)ormal file? l
- getting changed largefiles
- 0 largefiles updated, 0 removed
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cat f
@@ -372,8 +364,6 @@ Ancestor: large Parent: large2 Paren
$ hg merge -r normal
remote turned local largefile f into a normal file
keep (l)argefile or use (n)ormal file? l
- getting changed largefiles
- 0 largefiles updated, 0 removed
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cat f
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -473,18 +473,24 @@ record added file alone
$ 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 @@ record added keyword ignored file
$ 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 --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -136,7 +136,7 @@ Test permission of files created by push
#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
@@ -153,3 +153,29 @@ for a forget.)
ENOENT: * (glob)
not removing z: file is already untracked
[1]
+
+Largefiles are accessible from the share's store
+ $ cd ..
+ $ hg share -q src share_dst --config extensions.share=
+ $ hg -R share_dst update -r0
+ getting changed largefiles
+ 1 largefiles updated, 0 removed
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ echo modified > share_dst/large
+ $ hg -R share_dst ci -m modified
+ created new head
+
+Only dirstate is in the local store for the share, and the largefile is in the
+share source's local store. Avoid the extra largefiles added in the unix
+conditional above.
+ $ hash=`hg -R share_dst cat share_dst/.hglf/large`
+ $ echo $hash
+ e2fb5f2139d086ded2cb600d5a91a196e76bf020
+
+ $ find share_dst/.hg/largefiles/* | sort
+ share_dst/.hg/largefiles/dirstate
+
+ $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort
+ src/.hg/largefiles/dirstate
+ src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t
--- a/tests/test-largefiles-misc.t
+++ b/tests/test-largefiles-misc.t
@@ -248,7 +248,7 @@ verify that large files in subrepos hand
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]
@@ -336,6 +336,13 @@ Lock in subrepo, otherwise the change is
../lf_subrepo_archive/subrepo
../lf_subrepo_archive/subrepo/large.txt
../lf_subrepo_archive/subrepo/normal.txt
+ $ cat ../lf_subrepo_archive/.hg_archival.txt
+ repo: 41bd42f10efa43698cc02052ea0977771cba506d
+ node: d56a95e6522858bc08a724c4fe2bdee066d1c30b
+ branch: default
+ latesttag: null
+ latesttagdistance: 4
+ changessincelatesttag: 4
Test update with subrepos.
@@ -357,11 +364,17 @@ Test update with subrepos.
$ hg update -C
getting changed largefiles
1 largefiles updated, 0 removed
- getting changed largefiles
- 0 largefiles updated, 0 removed
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 +456,10 @@ Test actions on largefiles using relativ
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 +467,30 @@ Test actions on largefiles using relativ
| 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 +501,33 @@ Test actions on largefiles using relativ
? 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
=========================================================
@@ -737,8 +803,6 @@ merge action 'd' for 'local renamed dire
R d1/f
$ hg merge
merging d2/f and d1/f to d2/f
- getting changed largefiles
- 0 largefiles updated, 0 removed
1 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cd ..
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -581,8 +581,6 @@ Test 3507 (both normal files and largefi
C sub2/large6
C sub2/large7
$ hg up -C '.^'
- getting changed largefiles
- 0 largefiles updated, 0 removed
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg remove large
$ hg addremove --traceback
@@ -1183,12 +1181,12 @@ rebased or not.
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
@@ -1431,8 +1429,6 @@ Rollback on largefiles.
verify that largefile .orig file no longer is overwritten on every update -C:
$ hg update --clean
- getting changed largefiles
- 0 largefiles updated, 0 removed
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat sub2/large7.orig
mistake
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -46,18 +46,31 @@ changeset graph
$ 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
-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 @@ log -f -r 1:tip
$ 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 -r null
+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 @@ Also check when maxrev < lastrevfilelog
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,70 @@ issue3772: hg log -r :null showing revis
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
+
+ $ hg log -r 'wdir()' -Tjson
+ [
+ {
+ "rev": null,
+ "node": null,
+ "branch": "default",
+ "phase": "draft",
+ "user": "test",
+ "date": [*, 0], (glob)
+ "desc": "",
+ "bookmarks": [],
+ "tags": ["tip"],
+ "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"]
+ }
+ ]
+
+ $ hg log -r 'wdir()' -Tjson -q
+ [
+ {
+ "rev": null,
+ "node": null
+ }
+ ]
+
+ $ hg log -r 'wdir()' -Tjson --debug
+ [
+ {
+ "rev": null,
+ "node": null,
+ "branch": "default",
+ "phase": "draft",
+ "user": "test",
+ "date": [*, 0], (glob)
+ "desc": "",
+ "bookmarks": [],
+ "tags": ["tip"],
+ "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
+ "manifest": null,
+ "extra": {"branch": "default"},
+ "modified": [],
+ "added": [],
+ "removed": []
+ }
+ ]
+
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 --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -603,7 +603,8 @@ update is a merge ...
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 @@ update should also have --tool
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 --git a/tests/test-module-imports.t b/tests/test-module-imports.t
--- a/tests/test-module-imports.t
+++ b/tests/test-module-imports.t
@@ -21,6 +21,9 @@ hidden by deduplication algorithm in the
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
@@ -29,11 +32,11 @@ these may expose other cycles.
relative: error, merge, util
mercurial/revset.py mixed imports
stdlib: parser
- relative: discovery, error, hbisect, phases, util
+ relative: error, hbisect, phases, util
mercurial/templater.py mixed imports
stdlib: parser
relative: config, error, templatefilters, templatekw, util
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 --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t
--- a/tests/test-mq-eol.t
+++ b/tests/test-mq-eol.t
@@ -60,7 +60,7 @@ should fail in strict mode
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 @@ invalid eol
$ 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 @@ Test .rej file EOL are left unchanged
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 @@ Test .rej file EOL are left unchanged
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 --git a/tests/test-mq-missingfiles.t b/tests/test-mq-missingfiles.t
--- a/tests/test-mq-missingfiles.t
+++ b/tests/test-mq-missingfiles.t
@@ -44,7 +44,7 @@ Push patch with missing target:
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 @@ Test missing renamed file
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 @@ Push git patch with missing target:
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 --git a/tests/test-mq-qpush-exact.t b/tests/test-mq-qpush-exact.t
--- a/tests/test-mq-qpush-exact.t
+++ b/tests/test-mq-qpush-exact.t
@@ -203,7 +203,7 @@ qpush --exact --force with changes to a
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 @@ qpush --exact --force with changes to a
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 --git a/tests/test-mq-qpush-fail.t b/tests/test-mq-qpush-fail.t
--- a/tests/test-mq-qpush-fail.t
+++ b/tests/test-mq-qpush-fail.t
@@ -284,7 +284,7 @@ test qpush --force and backup files
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 --git a/tests/test-mq-subrepo-svn.t b/tests/test-mq-subrepo-svn.t
--- a/tests/test-mq-subrepo-svn.t
+++ b/tests/test-mq-subrepo-svn.t
@@ -50,7 +50,7 @@ qnew on repo w/svn subrepo
$ 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 --git a/tests/test-mq-subrepo.t b/tests/test-mq-subrepo.t
--- a/tests/test-mq-subrepo.t
+++ b/tests/test-mq-subrepo.t
@@ -102,7 +102,7 @@ handle subrepos safely on qnew
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 @@ handle subrepos safely on qnew
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 @@ handle subrepos safely on qrefresh
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 @@ handle subrepos safely on qrefresh
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 @@ handle subrepos safely on qrecord
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 @@ handle subrepos safely on qrecord
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 @@ handle subrepos safely on qrecord
+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 --git a/tests/test-mq.t b/tests/test-mq.t
--- a/tests/test-mq.t
+++ b/tests/test-mq.t
@@ -311,14 +311,13 @@ qpop
qpush with dump of tag cache
Dump the tag cache to ensure that it has exactly one head after qpush.
- $ rm -f .hg/cache/tags
+ $ rm -f .hg/cache/tags2-visible
$ hg tags > /dev/null
-.hg/cache/tags (pre qpush):
+.hg/cache/tags2-visible (pre qpush):
- $ cat .hg/cache/tags
+ $ cat .hg/cache/tags2-visible
1 [\da-f]{40} (re)
-
$ hg qpush
applying test.patch
now at: test.patch
@@ -326,11 +325,10 @@ Dump the tag cache to ensure that it has
2: draft
$ hg tags > /dev/null
-.hg/cache/tags (post qpush):
+.hg/cache/tags2-visible (post qpush):
- $ cat .hg/cache/tags
+ $ cat .hg/cache/tags2-visible
2 [\da-f]{40} (re)
-
$ checkundo qpush
$ cd ..
@@ -870,7 +868,7 @@ qpush failure
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 --git a/tests/test-obsolete-tag-cache.t b/tests/test-obsolete-tag-cache.t
new file mode 100644
--- /dev/null
+++ b/tests/test-obsolete-tag-cache.t
@@ -0,0 +1,113 @@
+ $ cat >> $HGRCPATH << EOF
+ > [extensions]
+ > blackbox=
+ > rebase=
+ > mock=$TESTDIR/mockblackbox.py
+ >
+ > [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
+ $ hg tag -m 'test head 2 tag' head2
+
+ $ hg log -G -T '{rev}:{node|short} {tags} {desc}\n'
+ @ 5:2942a772f72a tip test head 2 tag
+ |
+ o 4:042eb6bfcc49 head2 newhead
+ |
+ | o 3:c3cb30f2d2cd test2 tag
+ | |
+ | o 2:d75775ffbc6b test2 first
+ | |
+ | o 1:5f97d42da03f test tag
+ |/
+ o 0:55482a6fb4b1 test1 initial
+
+
+Trigger tags cache population by doing something that accesses tags info
+
+ $ hg tags
+ tip 5:2942a772f72a
+ head2 4:042eb6bfcc49
+ test2 2:d75775ffbc6b
+ test1 0:55482a6fb4b1
+
+ $ cat .hg/cache/tags2-visible
+ 5 2942a772f72a444bef4bef13874d515f50fa27b6
+ 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
+ 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
+ d75775ffbc6bca1794d300f5571272879bd280da test2
+
+Hiding a non-tip changeset should change filtered hash and cause tags recompute
+
+ $ hg debugobsolete -d '0 0' c3cb30f2d2cd0aae008cc91a07876e3c5131fd22 -u dummyuser
+
+ $ hg tags
+ tip 5:2942a772f72a
+ head2 4:042eb6bfcc49
+ test1 0:55482a6fb4b1
+
+ $ cat .hg/cache/tags2-visible
+ 5 2942a772f72a444bef4bef13874d515f50fa27b6 f34fbc9a9769ba9eff5aff3d008a6b49f85c08b1
+ 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
+ 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
+
+ $ hg blackbox -l 4
+ 1970/01/01 00:00:00 bob> tags
+ 1970/01/01 00:00:00 bob> 2/2 cache hits/lookups in * seconds (glob)
+ 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 2 tags
+ 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
+
+Hiding another changeset should cause the filtered hash to change
+
+ $ hg debugobsolete -d '0 0' d75775ffbc6bca1794d300f5571272879bd280da -u dummyuser
+ $ hg debugobsolete -d '0 0' 5f97d42da03fd56f3b228b03dfe48af5c0adf75b -u dummyuser
+
+ $ hg tags
+ tip 5:2942a772f72a
+ head2 4:042eb6bfcc49
+
+ $ cat .hg/cache/tags2-visible
+ 5 2942a772f72a444bef4bef13874d515f50fa27b6 2fce1eec33263d08a4d04293960fc73a555230e4
+ 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
+
+ $ hg blackbox -l 4
+ 1970/01/01 00:00:00 bob> tags
+ 1970/01/01 00:00:00 bob> 1/1 cache hits/lookups in * seconds (glob)
+ 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
+ 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
+
+Resolving tags on an unfiltered repo writes a separate tags cache
+
+ $ hg --hidden tags
+ tip 5:2942a772f72a
+ head2 4:042eb6bfcc49
+ test2 2:d75775ffbc6b
+ test1 0:55482a6fb4b1
+
+ $ cat .hg/cache/tags2
+ 5 2942a772f72a444bef4bef13874d515f50fa27b6
+ 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
+ 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
+ d75775ffbc6bca1794d300f5571272879bd280da test2
+
+ $ hg blackbox -l 4
+ 1970/01/01 00:00:00 bob> --hidden tags
+ 1970/01/01 00:00:00 bob> 2/2 cache hits/lookups in * seconds (glob)
+ 1970/01/01 00:00:00 bob> writing .hg/cache/tags2 with 3 tags
+ 1970/01/01 00:00:00 bob> --hidden tags exited 0 after * seconds (glob)
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -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 --git a/tests/test-phases.t b/tests/test-phases.t
--- a/tests/test-phases.t
+++ b/tests/test-phases.t
@@ -456,8 +456,12 @@ move changeset backward
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 @@ move changeset forward and backward
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 --git a/tests/test-pull.t b/tests/test-pull.t
--- a/tests/test-pull.t
+++ b/tests/test-pull.t
@@ -76,7 +76,7 @@ Test 'file:' uri handling:
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 --git a/tests/test-push-http.t b/tests/test-push-http.t
--- a/tests/test-push-http.t
+++ b/tests/test-push-http.t
@@ -67,7 +67,7 @@ expect success
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
- remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
+ remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
% serve errors
$ hg rollback
repository tip rolled back to revision 0 (undo serve)
@@ -83,7 +83,7 @@ expect success, server lacks the httphea
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
- remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
+ remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
% serve errors
$ hg rollback
repository tip rolled back to revision 0 (undo serve)
@@ -99,7 +99,7 @@ expect success, server lacks the unbundl
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
- remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
+ remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
% serve errors
$ hg rollback
repository tip rolled back to revision 0 (undo serve)
diff --git a/tests/test-push-warn.t b/tests/test-push-warn.t
--- a/tests/test-push-warn.t
+++ b/tests/test-push-warn.t
@@ -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 @@ multiple new heads but also doesn't repo
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 --git a/tests/test-qrecord.t b/tests/test-qrecord.t
--- a/tests/test-qrecord.t
+++ b/tests/test-qrecord.t
@@ -60,7 +60,7 @@ help record (record)
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 --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -322,6 +322,6 @@ Check that the right ancestors is used w
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 --git a/tests/test-rebase-named-branches.t b/tests/test-rebase-named-branches.t
--- a/tests/test-rebase-named-branches.t
+++ b/tests/test-rebase-named-branches.t
@@ -352,7 +352,7 @@ rebase 'c1' to the branch head 'c2' that
$ 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 @@ rebase 'c1' to the branch head 'c2' that
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 --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t
--- a/tests/test-rebase-pull.t
+++ b/tests/test-rebase-pull.t
@@ -165,5 +165,47 @@ pull --rebase works when a specific revi
|
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 --git a/tests/test-record.t b/tests/test-record.t
--- a/tests/test-record.t
+++ b/tests/test-record.t
@@ -10,6 +10,59 @@ Set up a repo
$ 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 no files
-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 < | | | | |