--- a/contrib/mercurial.spec Wed Sep 01 10:13:55 2010 +0200
+++ b/contrib/mercurial.spec Sat Sep 11 00:40:19 2010 +0200
@@ -1,4 +1,4 @@
-Summary: Mercurial -- a distributed SCM
+Summary: A fast, lightweight Source Control Management system
Name: mercurial
Version: snapshot
Release: 0
@@ -40,8 +40,8 @@
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir}
-install contrib/hgk $RPM_BUILD_ROOT%{_bindir}
-install contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}
+install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}
+install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}
bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
mkdir -p $bash_completion_dir
@@ -52,11 +52,11 @@
install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial
mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir}
-install contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}
-install contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}
+install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}
+install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d
-install contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
+install -m 644 contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
%clean
rm -rf $RPM_BUILD_ROOT
@@ -66,15 +66,17 @@
%doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi
%doc %attr(644,root,root) %{_mandir}/man?/hg*
%doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc
-%{_sysconfdir}/bash_completion.d/mercurial.sh
+%dir %{_datadir}/zsh/
+%dir %{_datadir}/zsh/site-functions/
%{_datadir}/zsh/site-functions/_mercurial
+%dir %{_datadir}/emacs/site-lisp/
%{_datadir}/emacs/site-lisp/mercurial.el
%{_datadir}/emacs/site-lisp/mq.el
%{_bindir}/hg
%{_bindir}/hgk
%{_bindir}/hg-ssh
%dir %{_sysconfdir}/bash_completion.d/
-%dir %{_datadir}/zsh/site-functions/
+%config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh
%dir %{_sysconfdir}/mercurial
%dir %{_sysconfdir}/mercurial/hgrc.d
%config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
--- a/contrib/win32/mercurial.iss Wed Sep 01 10:13:55 2010 +0200
+++ b/contrib/win32/mercurial.iss Sat Sep 11 00:40:19 2010 +0200
@@ -52,6 +52,10 @@
Source: contrib\hgk; DestDir: {app}/Contrib; DestName: hgk.tcl
Source: contrib\xml.rnc; DestDir: {app}/Contrib
Source: contrib\shrink-revlog.py; DestDir: {app}/Contrib
+Source: contrib\mercurial.el; DestDir: {app}/Contrib
+Source: contrib\mq.el; DestDir: {app}/Contrib
+Source: contrib\hgweb.fcgi; DestDir: {app}/Contrib
+Source: contrib\hgweb.wsgi; DestDir: {app}/Contrib
Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme
Source: contrib\mergetools.hgrc; DestDir: {tmp};
Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; Check: CheckFile; AfterInstall: ConcatenateFiles;
--- a/contrib/zsh_completion Wed Sep 01 10:13:55 2010 +0200
+++ b/contrib/zsh_completion Sat Sep 11 00:40:19 2010 +0200
@@ -14,7 +14,7 @@
# compinit
#
# Copyright (C) 2005, 2006 Steve Borho <steve@borho.org>
-# Copyright (C) 2006-9 Brendan Cully <brendan@kublai.com>
+# Copyright (C) 2006-10 Brendan Cully <brendan@kublai.com>
#
# Permission is hereby granted, without written agreement and without
# licence or royalty fees, to use, copy, modify, and distribute this
@@ -766,6 +766,31 @@
':revision:_hg_tags'
}
+## extensions ##
+
+# bookmarks
+_hg_bookmarks() {
+ typeset -a bookmark bookmarks
+
+ _hg_cmd bookmarks | while read -A bookmark
+ do
+ if test -z ${bookmark[-1]:#[0-9]*}
+ then
+ bookmarks+=($bookmark[-2])
+ fi
+ done
+ (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks
+}
+
+_hg_cmd_bookmarks() {
+ _arguments -s -w : $_hg_global_opts \
+ '(--force -f)'{-f,--force}'[force]' \
+ '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_tags' \
+ '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \
+ '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
+ ':bookmark:_hg_bookmarks'
+}
+
# HGK
_hg_cmd_view() {
_arguments -s -w : $_hg_global_opts \
@@ -948,4 +973,34 @@
':revision:_hg_tags'
}
+# Patchbomb
+_hg_cmd_email() {
+ _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
+ '(--git -g)'{-g,--git}'[use git extended diff format]' \
+ '--plain[omit hg patch header]' \
+ '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
+ '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
+ '--bundlename[name of the bundle attachment file (default: bundle)]:' \
+ '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
+ '--force[run even when remote repository is unrelated (with -b/--bundle)]' \
+ '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_tags' \
+ '--intro[send an introduction email for a single patch]' \
+ '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \
+ '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \
+ '*--bcc[email addresses of blind carbon copy recipients]:email:' \
+ '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \
+ '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \
+ '--date[use the given date as the sending date]:date:' \
+ '--desc[use the given file as the series description]:files:_files' \
+ '(--from -f)'{-f,--from}'[email address of sender]:email:' \
+ '(--test -n)'{-n,--test}'[print messages that would be sent]' \
+ '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \
+ '*--reply-to[email addresses replies should be sent to]:email:' \
+ '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \
+ '--in-reply-to[message identifier to reply to]:msgid:' \
+ '*--flag[flags to add in subject prefixes]:flag:' \
+ '*'{-t,--to}'[email addresses of recipients]:email:' \
+ ':revision:_hg_revrange'
+}
+
_hg "$@"
--- a/hgext/bookmarks.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/bookmarks.py Sat Sep 11 00:40:19 2010 +0200
@@ -18,7 +18,7 @@
By default, when several bookmarks point to the same changeset, they
will all move forward together. It is possible to obtain a more
git-like experience by adding the following configuration option to
-your .hgrc::
+your configuration file::
[bookmarks]
track.current = True
@@ -451,8 +451,8 @@
ui.status(_("deleting remote bookmark %s\n") % b)
new = '' # delete
else:
- ui.warn(_('bookmark %s does not exist on the local'
- ' or remote repository!\n') % b)
+ ui.warn(_('bookmark %s does not exist on the local '
+ 'or remote repository!\n') % b)
return 2
old = rb.get(b, '')
r = other.pushkey('bookmarks', b, old, new)
--- a/hgext/churn.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/churn.py Sat Sep 11 00:40:19 2010 +0200
@@ -129,8 +129,14 @@
aliases = repo.wjoin('.hgchurn')
if aliases:
for l in open(aliases, "r"):
- alias, actual = l.split('=' in l and '=' or None, 1)
- amap[alias.strip()] = actual.strip()
+ try:
+ alias, actual = l.split('=' in l and '=' or None, 1)
+ amap[alias.strip()] = actual.strip()
+ except ValueError:
+ l = l.strip()
+ if l:
+ ui.warn(_("skipping malformed alias: %s\n" % l))
+ continue
rate = countrate(ui, repo, amap, *pats, **opts).items()
if not rate:
--- a/hgext/color.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/color.py Sat Sep 11 00:40:19 2010 +0200
@@ -29,7 +29,7 @@
function (aka ANSI escape codes). This module also provides the
render_text function, which can be used to add effects to any text.
-Default effects may be overridden from the .hgrc file::
+Default effects may be overridden from your configuration file::
[color]
status.modified = blue bold underline red_background
@@ -77,9 +77,9 @@
'''
-import os, sys
+import os
-from mercurial import commands, dispatch, extensions, ui as uimod
+from mercurial import commands, dispatch, extensions, ui as uimod, util
from mercurial.i18n import _
# start and stop parameters for effects
@@ -209,9 +209,12 @@
elif mode != 'ansi':
return
def colorcmd(orig, ui_, opts, cmd, cmdfunc):
- if (opts['color'] == 'always' or
- (opts['color'] == 'auto' and (os.environ.get('TERM') != 'dumb'
- and ui_.formatted()))):
+ coloropt = opts['color']
+ auto = coloropt == 'auto'
+ always = util.parsebool(coloropt)
+ if (always or
+ (always is None and
+ (auto and (os.environ.get('TERM') != 'dumb' and ui_.formatted())))):
colorui._colormode = mode
colorui.__bases__ = (ui_.__class__,)
ui_.__class__ = colorui
@@ -220,9 +223,10 @@
return orig(ui_, opts, cmd, cmdfunc)
extensions.wrapfunction(dispatch, '_runcommand', colorcmd)
-commands.globalopts.append(('', 'color', 'auto',
- _("when to colorize (always, auto, or never)"),
- _('TYPE')))
+commands.globalopts.append(
+ ('', 'color', 'auto',
+ _("when to colorize (boolean, always, auto, or never)"),
+ _('TYPE')))
try:
import re, pywintypes, win32console as win32c
@@ -254,8 +258,10 @@
'inverse': win32c.COMMON_LVB_REVERSE_VIDEO, # double-byte charsets only
}
- stdout = win32c.GetStdHandle(win32c.STD_OUTPUT_HANDLE)
try:
+ stdout = win32c.GetStdHandle(win32c.STD_OUTPUT_HANDLE)
+ if stdout is None:
+ raise ImportError()
origattr = stdout.GetConsoleScreenBufferInfo()['Attributes']
except pywintypes.error:
# stdout may be defined but not support
--- a/hgext/convert/__init__.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/convert/__init__.py Sat Sep 11 00:40:19 2010 +0200
@@ -40,7 +40,7 @@
(given in a format understood by the source).
If no destination directory name is specified, it defaults to the
- basename of the source with '-hg' appended. If the destination
+ basename of the source with ``-hg`` appended. If the destination
repository doesn't exist, it will be created.
By default, all sources except Mercurial will use --branchsort.
@@ -67,14 +67,17 @@
<source ID> <destination ID>
If the file doesn't exist, it's automatically created. It's
- updated on each commit copied, so convert-repo can be interrupted
+ updated on each commit copied, so :hg:`convert` can be interrupted
and can be run repeatedly to copy new commits.
- The [username mapping] file is a simple text file that maps each
- source commit author to a destination commit author. It is handy
- for source SCMs that use unix logins to identify authors (eg:
- CVS). One line per author mapping and the line format is:
- srcauthor=whatever string you want
+ The authormap is a simple text file that maps each source commit
+ author to a destination commit author. It is handy for source SCMs
+ that use unix logins to identify authors (eg: CVS). One line per
+ author mapping and the line format is::
+
+ source author = destination author
+
+ Empty lines and lines starting with a ``#`` are ignored.
The filemap is a file that allows filtering and remapping of files
and directories. Each line can contain one of the following
@@ -86,25 +89,29 @@
rename path/to/source path/to/destination
- Comment lines start with '#'. A specified path matches if it
+ Comment lines start with ``#``. A specified path matches if it
equals the full relative name of a file or one of its parent
- directories. The 'include' or 'exclude' directive with the longest
- matching path applies, so line order does not matter.
+ directories. The ``include`` or ``exclude`` directive with the
+ longest matching path applies, so line order does not matter.
- The 'include' directive causes a file, or all files under a
+ The ``include`` directive causes a file, or all files under a
directory, to be included in the destination repository, and the
exclusion of all other files and directories not explicitly
- included. The 'exclude' directive causes files or directories to
- be omitted. The 'rename' directive renames a file or directory if
+ included. The ``exclude`` directive causes files or directories to
+ be omitted. The ``rename`` directive renames a file or directory if
it is converted. To rename from a subdirectory into the root of
- the repository, use '.' as the path to rename to.
+ the repository, use ``.`` as the path to rename to.
The splicemap is a file that allows insertion of synthetic
history, letting you specify the parents of a revision. This is
useful if you want to e.g. give a Subversion merge two parents, or
graft two disconnected series of history together. Each entry
contains a key, followed by a space, followed by one or two
- comma-separated values. The key is the revision ID in the source
+ comma-separated values::
+
+ key parent1, parent2
+
+ The key is the revision ID in the source
revision control system whose parents should be modified (same
format as a key in .hg/shamap). The values are the revision IDs
(in either the source or destination revision control system) that
@@ -118,11 +125,15 @@
conjunction with a splicemap, it allows for a powerful combination
to help fix even the most badly mismanaged repositories and turn them
into nicely structured Mercurial repositories. The branchmap contains
- lines of the form "original_branch_name new_branch_name".
- "original_branch_name" is the name of the branch in the source
- repository, and "new_branch_name" is the name of the branch is the
- destination repository. This can be used to (for instance) move code
- in one repository from "default" to a named branch.
+ lines of the form::
+
+ original_branch_name new_branch_name
+
+ where "original_branch_name" is the name of the branch in the
+ source repository, and "new_branch_name" is the name of the branch
+ is the destination repository. No whitespace is allowed in the
+ branch names. This can be used to (for instance) move code in one
+ repository from "default" to a named branch.
Mercurial Source
----------------
@@ -263,16 +274,19 @@
cmdtable = {
"convert":
(convert,
- [('A', 'authors', '',
- _('username mapping filename'), _('FILE')),
+ [('', 'authors', '',
+ _('username mapping filename (DEPRECATED, use --authormap instead)'),
+ _('FILE')),
+ ('s', 'source-type', '',
+ _('source repository type'), _('TYPE')),
('d', 'dest-type', '',
_('destination repository type'), _('TYPE')),
+ ('r', 'rev', '',
+ _('import up to target revision REV'), _('REV')),
+ ('A', 'authormap', '',
+ _('remap usernames using this file'), _('FILE')),
('', 'filemap', '',
_('remap file names using contents of file'), _('FILE')),
- ('r', 'rev', '',
- _('import up to target revision REV'), _('REV')),
- ('s', 'source-type', '',
- _('source repository type'), _('TYPE')),
('', 'splicemap', '',
_('splice synthesized history into place'), _('FILE')),
('', 'branchmap', '',
--- a/hgext/convert/bzr.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/convert/bzr.py Sat Sep 11 00:40:19 2010 +0200
@@ -61,7 +61,7 @@
try:
tree = dir.open_workingtree(recommend_upgrade=False)
branch = tree.branch
- except (errors.NoWorkingTree, errors.NotLocalUrl), e:
+ except (errors.NoWorkingTree, errors.NotLocalUrl):
tree = None
branch = dir.open_branch()
if (tree is not None and tree.bzrdir.root_transport.base !=
--- a/hgext/convert/convcmd.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/convert/convcmd.py Sat Sep 11 00:40:19 2010 +0200
@@ -112,8 +112,8 @@
if authorfile and os.path.exists(authorfile):
self.readauthormap(authorfile)
# Extend/Override with new author map if necessary
- if opts.get('authors'):
- self.readauthormap(opts.get('authors'))
+ if opts.get('authormap'):
+ self.readauthormap(opts.get('authormap'))
self.authorfile = self.dest.authorfile()
self.splicemap = mapfile(ui, opts.get('splicemap'))
@@ -392,6 +392,10 @@
orig_encoding = encoding.encoding
encoding.encoding = 'UTF-8'
+ # support --authors as an alias for --authormap
+ if not opts.get('authormap'):
+ opts['authormap'] = opts.get('authors')
+
if not dest:
dest = hg.defaultdest(src) + "-hg"
ui.status(_("assuming destination %s\n") % dest)
--- a/hgext/convert/cvs.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/convert/cvs.py Sat Sep 11 00:40:19 2010 +0200
@@ -53,8 +53,6 @@
try:
os.chdir(self.path)
id = None
- state = 0
- filerevids = {}
cache = 'update'
if not self.ui.configbool('convert', 'cvsps.cache', True):
--- a/hgext/convert/git.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/convert/git.py Sat Sep 11 00:40:19 2010 +0200
@@ -7,6 +7,7 @@
import os
from mercurial import util
+from mercurial.node import hex, nullid
from mercurial.i18n import _
from common import NoRepo, commit, converter_source, checktool
@@ -59,7 +60,7 @@
return heads
def catfile(self, rev, type):
- if rev == "0" * 40:
+ if rev == hex(nullid):
raise IOError()
data, ret = self.gitread("git cat-file %s %s" % (type, rev))
if ret:
--- a/hgext/eol.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/eol.py Sat Sep 11 00:40:19 2010 +0200
@@ -66,7 +66,7 @@
"""
from mercurial.i18n import _
-from mercurial import util, config, extensions, commands, match, cmdutil
+from mercurial import util, config, extensions, match
import re, os
# Matches a lone LF, i.e., one that is not part of CRLF.
--- a/hgext/gpg.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/gpg.py Sat Sep 11 00:40:19 2010 +0200
@@ -227,7 +227,7 @@
data = node2txt(repo, n, sigver)
sig = mygpg.sign(data)
if not sig:
- raise util.Abort(_("Error while signing"))
+ raise util.abort(_("error while signing"))
sig = binascii.b2a_base64(sig)
sig = sig.replace("\n", "")
sigmessage += "%s %s %s\n" % (hexnode, sigver, sig)
--- a/hgext/hgk.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/hgk.py Sat Sep 11 00:40:19 2010 +0200
@@ -19,7 +19,7 @@
The :hg:`view` command will launch the hgk Tcl script. For this command
to work, hgk must be in your search path. Alternately, you can specify
-the path to hgk in your .hgrc file::
+the path to hgk in your configuration file::
[hgk]
path=/location/of/hgk
--- a/hgext/inotify/client.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/inotify/client.py Sat Sep 11 00:40:19 2010 +0200
@@ -21,7 +21,6 @@
Raise QueryFailed if something went wrong
"""
def decorated_function(self, *args):
- result = None
try:
return function(self, *args)
except (OSError, socket.error), err:
--- a/hgext/keyword.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/keyword.py Sat Sep 11 00:40:19 2010 +0200
@@ -35,6 +35,9 @@
change history. The mechanism can be regarded as a convenience for the
current user or for archive distribution.
+Keywords expand to the changeset data pertaining to the latest change
+relative to the working directory parent of each file.
+
Configuration is done in the [keyword], [keywordset] and [keywordmaps]
sections of hgrc files.
@@ -511,14 +514,14 @@
self.lines = kwt.shrinklines(self.fname, self.lines)
def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None,
- opts=None):
+ opts=None, prefix=''):
'''Monkeypatch patch.diff to avoid expansion except when
comparing against working dir.'''
if node2 is not None:
kwt.match = util.never
elif node1 is not None and node1 != repo['.'].node():
kwt.restrict = True
- return orig(repo, node1, node2, match, changes, opts)
+ return orig(repo, node1, node2, match, changes, opts, prefix)
def kwweb_skip(orig, web, req, tmpl):
'''Wraps webcommands.x turning off keyword expansion.'''
--- a/hgext/mq.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/mq.py Sat Sep 11 00:40:19 2010 +0200
@@ -1756,7 +1756,6 @@
"""print the patches already applied"""
q = repo.mq
- l = len(q.applied)
if patch:
if patch not in q.series:
@@ -2107,7 +2106,7 @@
if not files:
raise util.Abort(_('qfold requires at least one patch name'))
if not q.check_toppatch(repo)[0]:
- raise util.Abort(_('No patches applied'))
+ raise util.Abort(_('no patches applied'))
q.check_localchanges(repo)
message = cmdutil.logmessage(opts)
@@ -2121,7 +2120,7 @@
for f in files:
p = q.lookup(f)
if p in patches or p == parent:
- ui.warn(_('Skipping already folded patch %s') % p)
+ ui.warn(_('Skipping already folded patch %s\n') % p)
if q.isapplied(p):
raise util.Abort(_('qfold cannot fold already applied patch %s') % p)
patches.append(p)
@@ -2134,7 +2133,7 @@
pf = q.join(p)
(patchsuccess, files, fuzz) = q.patch(repo, pf)
if not patchsuccess:
- raise util.Abort(_('Error folding patch %s') % p)
+ raise util.Abort(_('error folding patch %s') % p)
patch.updatedir(ui, repo, files)
if not message:
@@ -2884,7 +2883,7 @@
else:
repopath = cmdutil.findrepo(os.getcwd())
if not repopath:
- raise util.Abort(_('There is no Mercurial repository here '
+ raise util.Abort(_('there is no Mercurial repository here '
'(.hg not found)'))
repo = hg.repository(ui, repopath)
return qinit(ui, repo, True)
--- a/hgext/pager.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/pager.py Sat Sep 11 00:40:19 2010 +0200
@@ -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.
#
-# To load the extension, add it to your .hgrc file:
+# To load the extension, add it to your configuration file:
#
# [extension]
# pager =
@@ -46,7 +46,7 @@
If pager.attend is present, pager.ignore will be ignored.
To ignore global commands like :hg:`version` or :hg:`help`, you have
-to specify them in the global .hgrc
+to specify them in your user configuration file.
'''
import sys, os, signal, shlex, errno
--- a/hgext/patchbomb.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/patchbomb.py Sat Sep 11 00:40:19 2010 +0200
@@ -22,9 +22,9 @@
and References headers, so they will show up as a sequence in threaded
mail and news readers, and in mail archives.
-With the -d/--diffstat option, you will be prompted for each changeset
-with a diffstat summary and the changeset summary, so you can be sure
-you are sending the right changes.
+With the -d/--diffstat or -c/--confirm options, you will be presented
+with a final summary of all messages and asked for confirmation before
+the messages are sent.
To configure other defaults, add a section like this to your hgrc
file::
@@ -81,9 +81,7 @@
from mercurial.node import bin
def prompt(ui, prompt, default=None, rest=':'):
- if not ui.interactive():
- if default is not None:
- return default
+ if not ui.interactive() and default is None:
raise util.Abort(_("%s Please enter a valid value" % (prompt + rest)))
if default:
prompt += ' [%s]' % default
@@ -96,27 +94,18 @@
return default
ui.warn(_('Please enter a valid value.\n'))
-def cdiffstat(ui, summary, patchlines):
- s = patch.diffstat(patchlines)
- if summary:
- ui.write(summary, '\n')
- ui.write(s, '\n')
- ans = prompt(ui, _('does the diffstat above look okay?'), 'y')
- if not ans.lower().startswith('y'):
- raise util.Abort(_('diffstat rejected'))
- return s
-
def introneeded(opts, number):
'''is an introductory message required?'''
return number > 1 or opts.get('intro') or opts.get('desc')
-def makepatch(ui, repo, patch, opts, _charsets, idx, total, patchname=None):
+def makepatch(ui, repo, patchlines, opts, _charsets, idx, total,
+ patchname=None):
desc = []
node = None
body = ''
- for line in patch:
+ for line in patchlines:
if line.startswith('#'):
if line.startswith('# Node ID'):
node = line.split()[-1]
@@ -134,21 +123,22 @@
body += '\n\n\n'
if opts.get('plain'):
- while patch and patch[0].startswith('# '):
- patch.pop(0)
- if patch:
- patch.pop(0)
- while patch and not patch[0].strip():
- patch.pop(0)
+ while patchlines and patchlines[0].startswith('# '):
+ patchlines.pop(0)
+ if patchlines:
+ patchlines.pop(0)
+ while patchlines and not patchlines[0].strip():
+ patchlines.pop(0)
+ ds = patch.diffstat(patchlines)
if opts.get('diffstat'):
- body += cdiffstat(ui, '\n'.join(desc), patch) + '\n\n'
+ body += ds + '\n\n'
if opts.get('attach') or opts.get('inline'):
msg = email.MIMEMultipart.MIMEMultipart()
if body:
msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test')))
- p = mail.mimetextpatch('\n'.join(patch), 'x-patch', opts.get('test'))
+ p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch', opts.get('test'))
binnode = bin(node)
# if node is mq patch, it will have the patch file's name as a tag
if not patchname:
@@ -167,7 +157,7 @@
p['Content-Disposition'] = disposition + '; filename=' + patchname
msg.attach(p)
else:
- body += '\n'.join(patch)
+ body += '\n'.join(patchlines)
msg = mail.mimetextpatch(body, display=opts.get('test'))
flag = ' '.join(opts.get('flag'))
@@ -182,7 +172,7 @@
subj = '[PATCH %0*d of %d%s] %s' % (tlen, idx, total, flag, subj)
msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test'))
msg['X-Mercurial-Node'] = node
- return msg, subj
+ return msg, subj, ds
def patchbomb(ui, repo, *revs, **opts):
'''send changesets by email
@@ -352,17 +342,16 @@
prompt(ui, 'Subject: ', rest=subj))
body = ''
- if opts.get('diffstat'):
- d = cdiffstat(ui, _('Final summary:\n'), jumbo)
- if d:
- body = '\n' + d
+ ds = patch.diffstat(jumbo)
+ if ds and opts.get('diffstat'):
+ body = '\n' + ds
body = getdescription(body, sender)
msg = mail.mimeencode(ui, body, _charsets, opts.get('test'))
msg['Subject'] = mail.headencode(ui, subj, _charsets,
opts.get('test'))
- msgs.insert(0, (msg, subj))
+ msgs.insert(0, (msg, subj, ds))
return msgs
def getbundlemsgs(bundle):
@@ -381,7 +370,7 @@
email.Encoders.encode_base64(datapart)
msg.attach(datapart)
msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test'))
- return [(msg, subj)]
+ return [(msg, subj, None)]
sender = (opts.get('from') or ui.config('email', 'from') or
ui.config('patchbomb', 'from') or
@@ -394,17 +383,28 @@
else:
msgs = getpatchmsgs(list(getpatches(revs)))
+ showaddrs = []
+
def getaddrs(opt, prpt=None, default=None):
addrs = opts.get(opt.replace('-', '_'))
+ if opt != 'reply-to':
+ showaddr = '%s:' % opt.capitalize()
+ else:
+ showaddr = 'Reply-To:'
+
if addrs:
+ showaddrs.append('%s %s' % (showaddr, ', '.join(addrs)))
return mail.addrlistencode(ui, addrs, _charsets,
opts.get('test'))
- addrs = (ui.config('email', opt) or
- ui.config('patchbomb', opt) or '')
+ addrs = ui.config('email', opt) or ui.config('patchbomb', opt) or ''
if not addrs and prpt:
addrs = prompt(ui, prpt, default)
+ if addrs:
+ showaddr = '%s %s' % (showaddr, addrs)
+ showaddrs.append(showaddr)
+
return mail.addrlistencode(ui, [addrs], _charsets, opts.get('test'))
to = getaddrs('to', 'To')
@@ -412,6 +412,20 @@
bcc = getaddrs('bcc')
replyto = getaddrs('reply-to')
+ if opts.get('diffstat') or opts.get('confirm'):
+ ui.write(_('\nFinal summary:\n\n'))
+ ui.write('From: %s\n' % sender)
+ for addr in showaddrs:
+ ui.write('%s\n' % addr)
+ for m, subj, ds in msgs:
+ ui.write('Subject: %s\n' % subj)
+ if ds:
+ ui.write(ds)
+ ui.write('\n')
+ if ui.promptchoice(_('are you sure you want to send (yn)?'),
+ (_('&Yes'), _('&No'))):
+ raise util.Abort(_('patchbomb canceled'))
+
ui.write('\n')
parent = opts.get('in_reply_to') or None
@@ -427,7 +441,7 @@
sender_addr = email.Utils.parseaddr(sender)[1]
sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
sendmail = None
- for m, subj in msgs:
+ for m, subj, ds in msgs:
try:
m['Message-Id'] = genmsgid(m['X-Mercurial-Node'])
except TypeError:
@@ -495,6 +509,7 @@
('i', 'inline', None, _('send patches as inline attachments')),
('', 'bcc', [], _('email addresses of blind carbon copy recipients')),
('c', 'cc', [], _('email addresses of copy recipients')),
+ ('', 'confirm', None, _('ask for confirmation before sending')),
('d', 'diffstat', None, _('add diffstat output to messages')),
('', 'date', '', _('use the given date as the sending date')),
('', 'desc', '', _('use the given file as the series description')),
--- a/hgext/rebase.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/rebase.py Sat Sep 11 00:40:19 2010 +0200
@@ -14,7 +14,7 @@
http://mercurial.selenic.com/wiki/RebaseExtension
'''
-from mercurial import hg, util, repair, merge, cmdutil, commands, error
+from mercurial import hg, util, repair, merge, cmdutil, commands
from mercurial import extensions, ancestor, copies, patch
from mercurial.commands import templateopts
from mercurial.node import nullrev
--- a/hgext/relink.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/relink.py Sat Sep 11 00:40:19 2010 +0200
@@ -7,7 +7,7 @@
"""recreates hardlinks between repository clones"""
-from mercurial import cmdutil, hg, util
+from mercurial import hg, util
from mercurial.i18n import _
import os, stat
--- a/hgext/transplant.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/transplant.py Sat Sep 11 00:40:19 2010 +0200
@@ -234,7 +234,7 @@
p2 = node
self.log(user, date, message, p1, p2, merge=merge)
self.ui.write(str(inst) + '\n')
- raise util.Abort(_('Fix up the merge and run '
+ raise util.Abort(_('fix up the merge and run '
'hg transplant --continue'))
else:
files = None
--- a/hgext/zeroconf/__init__.py Wed Sep 01 10:13:55 2010 +0200
+++ b/hgext/zeroconf/__init__.py Sat Sep 11 00:40:19 2010 +0200
@@ -27,7 +27,7 @@
import socket, time, os
import Zeroconf
-from mercurial import ui, hg, encoding
+from mercurial import ui, hg, encoding, util
from mercurial import extensions
from mercurial.hgweb import hgweb_mod
from mercurial.hgweb import hgwebdir_mod
@@ -107,7 +107,7 @@
path = self.repo.ui.config("web", "prefix", "").strip('/')
desc = self.repo.ui.config("web", "description", name)
publish(name, desc, path,
- int(self.repo.ui.config("web", "port", 8000)))
+ util.getport(self.repo.ui.config("web", "port", 8000)))
class hgwebdirzc(hgwebdir_mod.hgwebdir):
def __init__(self, conf, baseui=None):
@@ -119,7 +119,7 @@
name = os.path.basename(repo)
path = (prefix + repo).strip('/')
desc = u.config('web', 'description', name)
- publish(name, desc, path, int(u.config("web", "port", 8000)))
+ publish(name, desc, path, util.getport(u.config("web", "port", 8000)))
# listen
--- a/mercurial/archival.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/archival.py Sat Sep 11 00:40:19 2010 +0200
@@ -236,7 +236,7 @@
if repo.ui.configbool("ui", "archivemeta", True):
def metadata():
base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
- hex(repo.changelog.node(0)), hex(node), ctx.branch())
+ repo[0].hex(), hex(node), ctx.branch())
tags = ''.join('tag: %s\n' % t for t in ctx.tags()
if repo.tagtype(t) == 'global')
--- a/mercurial/cmdutil.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/cmdutil.py Sat Sep 11 00:40:19 2010 +0200
@@ -9,8 +9,8 @@
from i18n import _
import os, sys, errno, re, glob, tempfile
import util, templater, patch, error, encoding, templatekw
-import match as _match
-import similar, revset
+import match as matchmod
+import similar, revset, subrepo
revrangesep = ':'
@@ -247,7 +247,7 @@
return list(pats)
ret = []
for p in pats:
- kind, name = _match._patsplit(p, None)
+ kind, name = matchmod._patsplit(p, None)
if kind is None:
try:
globbed = glob.glob(name)
@@ -262,18 +262,19 @@
def match(repo, pats=[], opts={}, globbed=False, default='relpath'):
if not globbed and default == 'relpath':
pats = expandpats(pats or [])
- m = _match.match(repo.root, repo.getcwd(), pats,
- opts.get('include'), opts.get('exclude'), default)
+ m = matchmod.match(repo.root, repo.getcwd(), pats,
+ opts.get('include'), opts.get('exclude'), default,
+ auditor=repo.auditor)
def badfn(f, msg):
repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
m.bad = badfn
return m
def matchall(repo):
- return _match.always(repo.root, repo.getcwd())
+ return matchmod.always(repo.root, repo.getcwd())
def matchfiles(repo, files):
- return _match.exact(repo.root, repo.getcwd(), files)
+ return matchmod.exact(repo.root, repo.getcwd(), files)
def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None):
if dry_run is None:
@@ -464,7 +465,7 @@
# srcs: list of (hgsep, hgsep, ossep, bool)
# return: function that takes hgsep and returns ossep
def targetpathafterfn(pat, dest, srcs):
- if _match.patkind(pat):
+ if matchmod.patkind(pat):
# a mercurial pattern
res = lambda p: os.path.join(dest,
os.path.basename(util.localpath(p)))
@@ -512,7 +513,7 @@
dest = pats.pop()
destdirexists = os.path.isdir(dest) and not os.path.islink(dest)
if not destdirexists:
- if len(pats) > 1 or _match.patkind(pats[0]):
+ if len(pats) > 1 or matchmod.patkind(pats[0]):
raise util.Abort(_('with multiple sources, destination must be an '
'existing directory'))
if util.endswithsep(dest):
@@ -654,7 +655,8 @@
single(rev, seqno + 1, fp)
def diffordiffstat(ui, repo, diffopts, node1, node2, match,
- changes=None, stat=False, fp=None):
+ changes=None, stat=False, fp=None, prefix='',
+ listsubrepos=False):
'''show diff or diffstat.'''
if fp is None:
write = ui.write
@@ -667,16 +669,27 @@
width = 80
if not ui.plain():
width = util.termwidth()
- chunks = patch.diff(repo, node1, node2, match, changes, diffopts)
+ chunks = patch.diff(repo, node1, node2, match, changes, diffopts,
+ prefix=prefix)
for chunk, label in patch.diffstatui(util.iterlines(chunks),
width=width,
git=diffopts.git):
write(chunk, label=label)
else:
for chunk, label in patch.diffui(repo, node1, node2, match,
- changes, diffopts):
+ changes, diffopts, prefix=prefix):
write(chunk, label=label)
+ if listsubrepos:
+ ctx1 = repo[node1]
+ ctx2 = repo[node2]
+ for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
+ if node2 is not None:
+ node2 = ctx2.substate[subpath][1]
+ submatch = matchmod.narrowmatcher(subpath, match)
+ sub.diff(diffopts, node2, submatch, changes=changes,
+ stat=stat, fp=fp, prefix=prefix)
+
class changeset_printer(object):
'''show changeset information when templating not requested.'''
--- a/mercurial/commands.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/commands.py Sat Sep 11 00:40:19 2010 +0200
@@ -59,7 +59,8 @@
if ui.verbose or not exact:
ui.status(_('adding %s\n') % m.rel(f))
if not opts.get('dry_run'):
- bad += [f for f in repo[None].add(names) if f in m.files()]
+ rejected = repo[None].add(names)
+ bad += [f for f in rejected if f in m.files()]
return bad and 1 or 0
def addremove(ui, repo, *pats, **opts):
@@ -335,6 +336,15 @@
else:
ui.write(_("The first bad revision is:\n"))
displayer.show(repo[nodes[0]])
+ parents = repo[nodes[0]].parents()
+ if len(parents) > 1:
+ side = good and state['bad'] or state['good']
+ num = len(set(i.node() for i in parents) & set(side))
+ if num == 1:
+ common = parents[0].ancestor(parents[1])
+ ui.write(_('Not all ancestors of this changeset have been'
+ ' checked.\nTo check the other ancestors, start'
+ ' from the common ancestor, %s.\n' % common))
else:
# multiple possible revisions
if good:
@@ -410,14 +420,19 @@
return
# update state
- node = repo.lookup(rev or '.')
+
+ if rev:
+ nodes = [repo.lookup(i) for i in cmdutil.revrange(repo, [rev])]
+ else:
+ nodes = [repo.lookup('.')]
+
if good or bad or skip:
if good:
- state['good'].append(node)
+ state['good'] += nodes
elif bad:
- state['bad'].append(node)
+ state['bad'] += nodes
elif skip:
- state['skip'].append(node)
+ state['skip'] += nodes
hbisect.save_state(repo, state)
if not check_state(state):
@@ -839,7 +854,7 @@
lookup = r.lookup
elif len(args) == 2:
if not repo:
- raise util.Abort(_("There is no Mercurial repository here "
+ raise util.Abort(_("there is no Mercurial repository here "
"(.hg not found)"))
rev1, rev2 = args
r = repo.changelog
@@ -1214,9 +1229,15 @@
ui.write(line)
ui.write("\n")
-def debugdata(ui, file_, rev):
+def debugdata(ui, repo, file_, rev):
"""dump the contents of a data file revision"""
- r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i")
+ r = None
+ if repo:
+ filelog = repo.file(file_)
+ if len(filelog):
+ r = filelog
+ if not r:
+ r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i")
try:
ui.write(r.revision(r.lookup(rev)))
except KeyError:
@@ -1234,9 +1255,15 @@
m = util.matchdate(range)
ui.write("match: %s\n" % m(d[0]))
-def debugindex(ui, file_):
+def debugindex(ui, repo, file_):
"""dump the contents of an index file"""
- r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
+ r = None
+ if repo:
+ filelog = repo.file(file_)
+ if len(filelog):
+ r = filelog
+ if not r:
+ r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
ui.write(" rev offset length base linkrev"
" nodeid p1 p2\n")
for i in r:
@@ -1249,9 +1276,15 @@
i, r.start(i), r.length(i), r.base(i), r.linkrev(i),
short(node), short(pp[0]), short(pp[1])))
-def debugindexdot(ui, file_):
+def debugindexdot(ui, repo, file_):
"""dump an index DAG as a graphviz dot file"""
- r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
+ r = None
+ if repo:
+ filelog = repo.file(file_)
+ if len(filelog):
+ r = filelog
+ if not r:
+ r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
ui.write("digraph G {\n")
for i in r:
node = r.node(i)
@@ -1335,7 +1368,8 @@
if patchproblems:
if ui.config('ui', 'patch'):
ui.write(_(" (Current patch tool may be incompatible with patch,"
- " or misconfigured. Please check your .hgrc file)\n"))
+ " or misconfigured. Please check your configuration"
+ " file)\n"))
else:
ui.write(_(" Internal patcher failure, please report this error"
" to http://mercurial.selenic.com/bts/\n"))
@@ -1351,19 +1385,21 @@
if not cmdpath:
if editor == 'vi':
ui.write(_(" No commit editor set and can't find vi in PATH\n"))
- ui.write(_(" (specify a commit editor in your .hgrc file)\n"))
+ ui.write(_(" (specify a commit editor in your configuration"
+ " file)\n"))
else:
ui.write(_(" Can't find editor '%s' in PATH\n") % editor)
- ui.write(_(" (specify a commit editor in your .hgrc file)\n"))
+ ui.write(_(" (specify a commit editor in your configuration"
+ " file)\n"))
problems += 1
# check username
ui.status(_("Checking username...\n"))
try:
- user = ui.username()
+ ui.username()
except util.Abort, e:
ui.write(" %s\n" % e)
- ui.write(_(" (specify a username in your .hgrc file)\n"))
+ ui.write(_(" (specify a username in your configuration file)\n"))
problems += 1
if not problems:
@@ -1450,7 +1486,8 @@
diffopts = patch.diffopts(ui, opts)
m = cmdutil.match(repo, pats, opts)
- cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat)
+ cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
+ listsubrepos=opts.get('subrepos'))
def export(ui, repo, *changesets, **opts):
"""dump the header and diffs for one or more changesets
@@ -2102,7 +2139,7 @@
"""
if not repo and not source:
- raise util.Abort(_("There is no Mercurial repository here "
+ raise util.Abort(_("there is no Mercurial repository here "
"(.hg not found)"))
hexfunc = ui.debugflag and hex or short
@@ -2724,8 +2761,8 @@
Show definition of symbolic path name NAME. If no name is given,
show definition of all available names.
- Path names are defined in the [paths] section of
- ``/etc/mercurial/hgrc`` and ``$HOME/.hgrc``. If run inside a
+ Path names are defined in the [paths] section of your
+ configuration file and in ``/etc/mercurial/hgrc``. If run inside a
repository, ``.hg/hgrc`` is used, too.
The path names ``default`` and ``default-push`` have a special
@@ -2795,7 +2832,7 @@
try:
revs = [other.lookup(rev) for rev in revs]
except error.CapabilityError:
- err = _("Other repository doesn't support revision lookup, "
+ err = _("other repository doesn't support revision lookup, "
"so a rev cannot be specified.")
raise util.Abort(err)
@@ -2910,21 +2947,24 @@
ui.warn(_('not removing %s: file is untracked\n') % m.rel(f))
ret = 1
- def warn(files, reason):
- for f in files:
- ui.warn(_('not removing %s: file %s (use -f to force removal)\n')
- % (m.rel(f), reason))
- ret = 1
-
if force:
remove, forget = modified + deleted + clean, added
elif after:
remove, forget = deleted, []
- warn(modified + added + clean, _('still exists'))
+ for f in modified + added + clean:
+ ui.warn(_('not removing %s: file still exists (use -f'
+ ' to force removal)\n') % m.rel(f))
+ ret = 1
else:
remove, forget = deleted + clean, []
- warn(modified, _('is modified'))
- warn(added, _('has been marked for add'))
+ for f in modified:
+ ui.warn(_('not removing %s: file is modified (use -f'
+ ' to force removal)\n') % m.rel(f))
+ ret = 1
+ for f in added:
+ ui.warn(_('not removing %s: file has been marked for add (use -f'
+ ' to force removal)\n') % m.rel(f))
+ ret = 1
for f in sorted(remove + forget):
if ui.verbose or not m.exact(f):
@@ -2960,11 +3000,11 @@
"""redo merges or set/view the merge status of files
Merges with unresolved conflicts are often the result of
- non-interactive merging using the ``internal:merge`` hgrc setting,
- or a command-line merge tool like ``diff3``. The resolve command
- is used to manage the files involved in a merge, after :hg:`merge`
- has been run, and before :hg:`commit` is run (i.e. the working
- directory must have two parents).
+ non-interactive merging using the ``internal:merge`` configuration
+ setting, or a command-line merge tool like ``diff3``. The resolve
+ command is used to manage the files involved in a merge, after
+ :hg:`merge` has been run, and before :hg:`commit` is run (i.e. the
+ working directory must have two parents).
The resolve command can be used in the following ways:
@@ -3332,7 +3372,7 @@
# this way we can check if something was given in the command-line
if opts.get('port'):
- opts['port'] = int(opts.get('port'))
+ opts['port'] = util.getport(opts.get('port'))
baseui = repo and repo.baseui or ui
optlist = ("name templates style address port prefix ipv6"
@@ -3454,7 +3494,8 @@
show = ui.quiet and states[:4] or states[:5]
stat = repo.status(node1, node2, cmdutil.match(repo, pats, opts),
- 'ignored' in show, 'clean' in show, 'unknown' in show)
+ 'ignored' in show, 'clean' in show, 'unknown' in show,
+ opts.get('subrepos'))
changestates = zip(states, 'MAR!?IC', stat)
if (opts.get('all') or opts.get('copies')) and not opts.get('no_status'):
@@ -3967,6 +4008,11 @@
_('guess renamed files by similarity (0<=s<=100)'), _('SIMILARITY'))
]
+subrepoopts = [
+ ('S', 'subrepos', None,
+ _('recurse into subrepositories'))
+]
+
table = {
"^add": (add, walkopts + dryrunopts, _('[OPTION]... [FILE]...')),
"addremove":
@@ -4153,7 +4199,7 @@
_('revision'), _('REV')),
('c', 'change', '',
_('change made by revision'), _('REV'))
- ] + diffopts + diffopts2 + walkopts,
+ ] + diffopts + diffopts2 + walkopts + subrepoopts,
_('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...')),
"^export":
(export,
@@ -4430,7 +4476,7 @@
_('show difference from revision'), _('REV')),
('', 'change', '',
_('list the changed files of a revision'), _('REV')),
- ] + walkopts,
+ ] + walkopts + subrepoopts,
_('[OPTION]... [FILE]...')),
"tag":
(tag,
@@ -4470,7 +4516,7 @@
"version": (version_, []),
}
-norepo = ("clone init version help debugcommands debugcomplete debugdata"
- " debugindex debugindexdot debugdate debuginstall debugfsinfo"
- " debugpushkey")
-optionalrepo = ("identify paths serve showconfig debugancestor debugdag")
+norepo = ("clone init version help debugcommands debugcomplete"
+ " debugdate debuginstall debugfsinfo debugpushkey")
+optionalrepo = ("identify paths serve showconfig debugancestor debugdag"
+ " debugdata debugindex debugindexdot")
--- a/mercurial/context.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/context.py Sat Sep 11 00:40:19 2010 +0200
@@ -198,7 +198,7 @@
if match(fn):
yield fn
for fn in sorted(fset):
- if match.bad(fn, _('No such file in rev %s') % self) and match(fn):
+ if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
yield fn
def sub(self, path):
--- a/mercurial/dagparser.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/dagparser.py Sat Sep 11 00:40:19 2010 +0200
@@ -268,7 +268,7 @@
s += c
i += 1
c = nextch()
- raise util.Abort("invalid character in dag description: %s..." % s)
+ raise util.Abort(_("invalid character in dag description: %s...") % s)
def dagtextlines(events,
addspaces=True,
@@ -296,14 +296,14 @@
# sanity check
if r != wantr:
- raise util.Abort("Expected id %i, got %i" % (wantr, r))
+ raise util.Abort(_("expected id %i, got %i") % (wantr, r))
if not ps:
ps = [-1]
else:
for p in ps:
if p >= r:
- raise util.Abort("Parent id %i is larger than "
- "current id %i" % (p, r))
+ raise util.Abort(_("parent id %i is larger than "
+ "current id %i") % (p, r))
wantr += 1
# new root?
--- a/mercurial/dirstate.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/dirstate.py Sat Sep 11 00:40:19 2010 +0200
@@ -497,14 +497,25 @@
elif match.files() and not match.anypats(): # match.match, no patterns
skipstep3 = True
- files = set(match.files())
+ files = sorted(match.files())
+ subrepos.sort()
+ i, j = 0, 0
+ while i < len(files) and j < len(subrepos):
+ subpath = subrepos[j] + "/"
+ if not files[i].startswith(subpath):
+ i += 1
+ continue
+ while files and files[i].startswith(subpath):
+ del files[i]
+ j += 1
+
if not files or '.' in files:
files = ['']
results = dict.fromkeys(subrepos)
results['.hg'] = None
# step 1: find all explicit files
- for ff in sorted(files):
+ for ff in files:
nf = normalize(normpath(ff), False)
if nf in results:
continue
--- a/mercurial/dispatch.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/dispatch.py Sat Sep 11 00:40:19 2010 +0200
@@ -190,6 +190,7 @@
class cmdalias(object):
def __init__(self, name, definition, cmdtable):
self.name = self.cmd = name
+ self.cmdname = ''
self.definition = definition
self.args = []
self.opts = []
@@ -234,7 +235,7 @@
return
args = shlex.split(self.definition)
- cmd = args.pop(0)
+ self.cmdname = cmd = args.pop(0)
args = map(util.expandpath, args)
for invalidarg in ("--cwd", "-R", "--repository", "--repo"):
@@ -286,12 +287,18 @@
def __call__(self, ui, *args, **opts):
if self.shadows:
- ui.debug("alias '%s' shadows command\n" % self.name)
+ ui.debug("alias '%s' shadows command '%s'\n" %
+ (self.name, self.cmdname))
if self.definition.startswith('!'):
return self.fn(ui, *args, **opts)
else:
- return util.checksignature(self.fn)(ui, *args, **opts)
+ try:
+ util.checksignature(self.fn)(ui, *args, **opts)
+ except error.SignatureError:
+ args = ' '.join([self.cmdname] + self.args)
+ ui.debug("alias '%s' expands to '%s'\n" % (self.name, args))
+ raise
def addaliases(ui, cmdtable):
# aliases are processed after extensions have been loaded, so they
@@ -463,9 +470,9 @@
cmd, func, args, options, cmdoptions = _parse(lui, args)
if options["config"]:
- raise util.Abort(_("Option --config may not be abbreviated!"))
+ raise util.Abort(_("option --config may not be abbreviated!"))
if options["cwd"]:
- raise util.Abort(_("Option --cwd may not be abbreviated!"))
+ raise util.Abort(_("option --cwd may not be abbreviated!"))
if options["repository"]:
raise util.Abort(_(
"Option -R has to be separated from other options (e.g. not -qR) "
--- a/mercurial/encoding.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/encoding.py Sat Sep 11 00:40:19 2010 +0200
@@ -6,7 +6,7 @@
# GNU General Public License version 2 or any later version.
import error
-import sys, unicodedata, locale, os
+import unicodedata, locale, os
def _getpreferredencoding():
'''
--- a/mercurial/hbisect.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/hbisect.py Sat Sep 11 00:40:19 2010 +0200
@@ -63,7 +63,7 @@
if not ancestors: # now we're confused
if len(state['bad']) == 1 and len(state['good']) == 1:
raise util.Abort(_("starting revisions are not directly related"))
- raise util.Abort(_("Inconsistent state, %s:%s is good and bad")
+ raise util.Abort(_("inconsistent state, %s:%s is good and bad")
% (badrev, short(bad)))
# build children dict
--- a/mercurial/help.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/help.py Sat Sep 11 00:40:19 2010 +0200
@@ -83,7 +83,7 @@
return loader
helptable = [
- (["config"], _("Configuration Files"), loaddoc('config')),
+ (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
(["dates"], _("Date Formats"), loaddoc('dates')),
(["patterns"], _("File Name Patterns"), loaddoc('patterns')),
(['environment', 'env'], _('Environment Variables'),
--- a/mercurial/help/diffs.txt Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/help/diffs.txt Sat Sep 11 00:40:19 2010 +0200
@@ -25,5 +25,5 @@
To make Mercurial produce the git extended diff format, use the --git
option available for many commands, or set 'git = True' in the [diff]
-section of your hgrc. You do not need to set this option when
-importing diffs in this format or using them in the mq extension.
+section of your configuration file. You do not need to set this option
+when importing diffs in this format or using them in the mq extension.
--- a/mercurial/help/environment.txt Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/help/environment.txt Sat Sep 11 00:40:19 2010 +0200
@@ -8,7 +8,7 @@
HGEDITOR
This is the name of the editor to run when committing. See EDITOR.
- (deprecated, use .hgrc)
+ (deprecated, use configuration file)
HGENCODING
This overrides the default locale setting detected by Mercurial.
@@ -29,13 +29,13 @@
will be executed with three arguments: local file, remote file,
ancestor file.
- (deprecated, use .hgrc)
+ (deprecated, use configuration file)
HGRCPATH
- A list of files or directories to search for hgrc files. Item
- separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set,
- platform default search path is used. If empty, only the .hg/hgrc
- from the current repository is read.
+ A list of files or directories to search for configuration
+ files. Item separator is ":" on Unix, ";" on Windows. If HGRCPATH
+ is not set, platform default search path is used. If empty, only
+ the .hg/hgrc from the current repository is read.
For each element in HGRCPATH:
@@ -43,9 +43,9 @@
- otherwise, the file itself will be added
HGPLAIN
- When set, this disables any options in .hgrc that might change
- Mercurial's default output. This includes encoding, defaults,
- verbose mode, debug mode, quiet mode, tracebacks, and
+ When set, this disables any configuration settings that might
+ change Mercurial's default output. This includes encoding,
+ defaults, verbose mode, debug mode, quiet mode, tracebacks, and
localization. This can be useful when scripting against Mercurial
in the face of existing user configuration.
@@ -57,12 +57,12 @@
available values will be considered in this order:
- HGUSER (deprecated)
- - hgrc files from the HGRCPATH
+ - configuration files from the HGRCPATH
- EMAIL
- interactive prompt
- LOGNAME (with ``@hostname`` appended)
- (deprecated, use .hgrc)
+ (deprecated, use configuration file)
EMAIL
May be used as the author of a commit; see HGUSER.
--- a/mercurial/help/extensions.txt Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/help/extensions.txt Sat Sep 11 00:40:19 2010 +0200
@@ -11,9 +11,9 @@
Mercurial. It is thus up to the user to activate extensions as
needed.
-To enable the "foo" extension, either shipped with Mercurial or in
-the Python search path, create an entry for it in your hgrc, like
-this::
+To enable the "foo" extension, either shipped with Mercurial or in the
+Python search path, create an entry for it in your configuration file,
+like this::
[extensions]
foo =
@@ -23,8 +23,8 @@
[extensions]
myfeature = ~/.hgext/myfeature.py
-To explicitly disable an extension enabled in an hgrc of broader
-scope, prepend its path with !::
+To explicitly disable an extension enabled in a configuration file of
+broader scope, prepend its path with !::
[extensions]
# disabling extension bar residing in /path/to/extension/bar.py
--- a/mercurial/help/urls.txt Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/help/urls.txt Sat Sep 11 00:40:19 2010 +0200
@@ -35,11 +35,11 @@
Host *
Compression yes
- Alternatively specify "ssh -C" as your ssh command in your hgrc or
- with the --ssh command line option.
+ Alternatively specify "ssh -C" as your ssh command in your
+ configuration file or with the --ssh command line option.
-These URLs can all be stored in your hgrc with path aliases under the
-[paths] section like so::
+These URLs can all be stored in your configuration file with path
+aliases under the [paths] section like so::
[paths]
alias1 = URL1
--- a/mercurial/hg.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/hg.py Sat Sep 11 00:40:19 2010 +0200
@@ -311,7 +311,8 @@
# we need to re-init the repo after manually copying the data
# into it
dest_repo = repository(ui, dest)
- src_repo.hook('outgoing', source='clone', node='0'*40)
+ src_repo.hook('outgoing', source='clone',
+ node=node.hex(node.nullid))
else:
try:
dest_repo = repository(ui, dest, create=True)
--- a/mercurial/hgweb/common.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/hgweb/common.py Sat Sep 11 00:40:19 2010 +0200
@@ -9,6 +9,7 @@
import errno, mimetypes, os
HTTP_OK = 200
+HTTP_NOT_MODIFIED = 304
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_FORBIDDEN = 403
@@ -152,3 +153,9 @@
return (config("web", "contact") or
config("ui", "username") or
os.environ.get("EMAIL") or "")
+
+def caching(web, req):
+ tag = str(web.mtime)
+ if req.env.get('HTTP_IF_NONE_MATCH') == tag:
+ raise ErrorResponse(HTTP_NOT_MODIFIED)
+ req.headers.append(('ETag', tag))
--- a/mercurial/hgweb/hgweb_mod.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/hgweb/hgweb_mod.py Sat Sep 11 00:40:19 2010 +0200
@@ -6,9 +6,9 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-import os, sys, urllib
-from mercurial import ui, hg, hook, error, encoding, templater, util
-from common import get_mtime, ErrorResponse, permhooks
+import os
+from mercurial import ui, hg, hook, error, encoding, templater
+from common import get_mtime, ErrorResponse, permhooks, caching
from common import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
from request import wsgirequest
import webcommands, protocol, webutil
@@ -178,6 +178,7 @@
req.form['cmd'] = [tmpl.cache['default']]
cmd = req.form['cmd'][0]
+ caching(self, req) # sets ETag header or raises NOT_MODIFIED
if cmd not in webcommands.__all__:
msg = 'no such method: %s' % cmd
raise ErrorResponse(HTTP_BAD_REQUEST, msg)
--- a/mercurial/hgweb/server.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/hgweb/server.py Sat Sep 11 00:40:19 2010 +0200
@@ -269,7 +269,7 @@
import mimetypes; mimetypes.init()
address = ui.config('web', 'address', '')
- port = int(ui.config('web', 'port', 8000))
+ port = util.getport(ui.config('web', 'port', 8000))
try:
return cls(ui, app, (address, port), handler)
except socket.error, inst:
--- a/mercurial/hgweb/webcommands.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/hgweb/webcommands.py Sat Sep 11 00:40:19 2010 +0200
@@ -116,12 +116,11 @@
morevars['rev'] = query
def changelist(**map):
- cl = web.repo.changelog
count = 0
qw = query.lower().split()
def revgen():
- for i in xrange(len(cl) - 1, 0, -100):
+ for i in xrange(len(web.repo) - 1, 0, -100):
l = []
for j in xrange(max(0, i - 100), i + 1):
ctx = web.repo[j]
@@ -164,10 +163,10 @@
if count >= revcount:
break
- cl = web.repo.changelog
+ tip = web.repo['tip']
parity = paritygen(web.stripecount)
- return tmpl('search', query=query, node=hex(cl.tip()),
+ return tmpl('search', query=query, node=tip.hex(),
entries=changelist, archives=web.archivelist("tip"),
morevars=morevars, lessvars=lessvars)
@@ -224,8 +223,7 @@
morevars = copy.copy(tmpl.defaults['sessionvars'])
morevars['revcount'] = revcount * 2
- cl = web.repo.changelog
- count = len(cl)
+ count = len(web.repo)
pos = ctx.rev()
start = max(0, pos - revcount + 1)
end = min(count, start + revcount)
@@ -385,7 +383,6 @@
latestentry=lambda **x: entries(True, 1, **x))
def branches(web, req, tmpl):
- b = web.repo.branchtags()
tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems())
heads = web.repo.heads()
parity = paritygen(web.stripecount)
@@ -467,19 +464,19 @@
yield l
- cl = web.repo.changelog
- count = len(cl)
+ tip = web.repo['tip']
+ count = len(web.repo)
start = max(0, count - web.maxchanges)
end = min(count, start + web.maxchanges)
return tmpl("summary",
desc=web.config("web", "description", "unknown"),
owner=get_contact(web.config) or "unknown",
- lastchange=cl.read(cl.tip())[2],
+ lastchange=tip.date(),
tags=tagentries,
branches=branches,
shortlog=changelist,
- node=hex(cl.tip()),
+ node=tip.hex(),
archives=web.archivelist("tip"))
def filediff(web, req, tmpl):
--- a/mercurial/httprepo.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/httprepo.py Sat Sep 11 00:40:19 2010 +0200
@@ -6,12 +6,11 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-from node import bin, hex, nullid
+from node import nullid
from i18n import _
-import repo, changegroup, statichttprepo, error, url, util, wireproto
+import changegroup, statichttprepo, error, url, util, wireproto
import os, urllib, urllib2, urlparse, zlib, httplib
import errno, socket
-import encoding
def zgenerator(f):
zd = zlib.decompressobj()
--- a/mercurial/localrepo.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/localrepo.py Sat Sep 11 00:40:19 2010 +0200
@@ -28,6 +28,7 @@
self.root = os.path.realpath(util.expandpath(path))
self.path = os.path.join(self.root, ".hg")
self.origroot = path
+ self.auditor = util.path_auditor(self.root, self._checknested)
self.opener = util.opener(self.path)
self.wopener = util.opener(self.root)
self.baseui = baseui
@@ -111,6 +112,44 @@
self._datafilters = {}
self._transref = self._lockref = self._wlockref = None
+ def _checknested(self, path):
+ """Determine if path is a legal nested repository."""
+ if not path.startswith(self.root):
+ return False
+ subpath = path[len(self.root) + 1:]
+
+ # XXX: Checking against the current working copy is wrong in
+ # the sense that it can reject things like
+ #
+ # $ hg cat -r 10 sub/x.txt
+ #
+ # if sub/ is no longer a subrepository in the working copy
+ # parent revision.
+ #
+ # However, it can of course also allow things that would have
+ # been rejected before, such as the above cat command if sub/
+ # is a subrepository now, but was a normal directory before.
+ # The old path auditor would have rejected by mistake since it
+ # panics when it sees sub/.hg/.
+ #
+ # All in all, checking against the working copy seems sensible
+ # since we want to prevent access to nested repositories on
+ # the filesystem *now*.
+ ctx = self[None]
+ parts = util.splitpath(subpath)
+ while parts:
+ prefix = os.sep.join(parts)
+ if prefix in ctx.substate:
+ if prefix == subpath:
+ return True
+ else:
+ sub = ctx.sub(prefix)
+ return sub.checknested(subpath[len(prefix) + 1:])
+ else:
+ parts.pop()
+ return False
+
+
@propertycache
def changelog(self):
c = changelog.changelog(self.sopener)
@@ -337,8 +376,7 @@
return partial
- def branchmap(self):
- '''returns a dictionary {branch: [branchheads]}'''
+ def updatebranchcache(self):
tip = self.changelog.tip()
if self._branchcache is not None and self._branchcachetip == tip:
return self._branchcache
@@ -355,6 +393,9 @@
# this private cache holds all heads (not just tips)
self._branchcache = partial
+ def branchmap(self):
+ '''returns a dictionary {branch: [branchheads]}'''
+ self.updatebranchcache()
return self._branchcache
def branchtags(self):
@@ -875,7 +916,7 @@
# commit subs
if subs or removedsubs:
state = wctx.substate.copy()
- for s in subs:
+ for s in sorted(subs):
sub = wctx.sub(s)
self.ui.status(_('committing subrepository %s\n') %
subrepo.relpath(sub))
@@ -976,7 +1017,7 @@
tr.close()
if self._branchcache:
- self.branchtags()
+ self.updatebranchcache()
return n
finally:
if tr:
@@ -1011,7 +1052,8 @@
return self[node].walk(match)
def status(self, node1='.', node2=None, match=None,
- ignored=False, clean=False, unknown=False):
+ ignored=False, clean=False, unknown=False,
+ listsubrepos=False):
"""return status of files between two nodes or node and working directory
If node1 is None, use the first dirstate parent instead.
@@ -1117,6 +1159,24 @@
removed = mf1.keys()
r = modified, added, removed, deleted, unknown, ignored, clean
+
+ if listsubrepos:
+ for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
+ if working:
+ rev2 = None
+ else:
+ rev2 = ctx2.substate[subpath][1]
+ try:
+ submatch = matchmod.narrowmatcher(subpath, match)
+ s = sub.status(rev2, match=submatch, ignored=listignored,
+ clean=listclean, unknown=listunknown,
+ listsubrepos=True)
+ for rfiles, sfiles in zip(r, s):
+ rfiles.extend("%s/%s" % (subpath, f) for f in sfiles)
+ except error.LookupError:
+ self.ui.status(_("skipping missing subrepository: %s\n")
+ % subpath)
+
[l.sort() for l in r]
return r
@@ -1203,7 +1263,7 @@
cg = remote.changegroup(fetch, 'pull')
else:
if not remote.capable('changegroupsubset'):
- raise util.Abort(_("Partial pull cannot be done because "
+ raise util.Abort(_("partial pull cannot be done because "
"other repository doesn't support "
"changegroupsubset."))
cg = remote.changegroupsubset(fetch, heads, 'pull')
@@ -1700,7 +1760,7 @@
if changesets > 0:
# forcefully update the on-disk branch cache
self.ui.debug("updating the branch cache\n")
- self.branchtags()
+ self.updatebranchcache()
self.hook("changegroup", node=hex(cl.node(clstart)),
source=srctype, url=url)
--- a/mercurial/mail.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/mail.py Sat Sep 11 00:40:19 2010 +0200
@@ -36,8 +36,8 @@
s = smtplib.SMTP(local_hostname=local_hostname)
mailhost = ui.config('smtp', 'host')
if not mailhost:
- raise util.Abort(_('no [smtp]host in hgrc - cannot send mail'))
- mailport = int(ui.config('smtp', 'port', 25))
+ raise util.Abort(_('smtp.host not configured - cannot send mail'))
+ mailport = util.getport(ui.config('smtp', 'port', 25))
ui.note(_('sending mail: smtp host %s, port %s\n') %
(mailhost, mailport))
s.connect(host=mailhost, port=mailport)
--- a/mercurial/match.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/match.py Sat Sep 11 00:40:19 2010 +0200
@@ -7,10 +7,11 @@
import re
import util
+from i18n import _
class match(object):
def __init__(self, root, cwd, patterns, include=[], exclude=[],
- default='glob', exact=False):
+ default='glob', exact=False, auditor=None):
"""build an object to match a set of file patterns
arguments:
@@ -38,14 +39,16 @@
self._anypats = bool(include or exclude)
if include:
- im = _buildmatch(_normalize(include, 'glob', root, cwd), '(?:/|$)')
+ im = _buildmatch(_normalize(include, 'glob', root, cwd, auditor),
+ '(?:/|$)')
if exclude:
- em = _buildmatch(_normalize(exclude, 'glob', root, cwd), '(?:/|$)')
+ em = _buildmatch(_normalize(exclude, 'glob', root, cwd, auditor),
+ '(?:/|$)')
if exact:
self._files = patterns
pm = self.exact
elif patterns:
- pats = _normalize(patterns, default, root, cwd)
+ pats = _normalize(patterns, default, root, cwd, auditor)
self._files = _roots(pats)
self._anypats = self._anypats or _anypats(pats)
pm = _buildmatch(pats, '$')
@@ -107,6 +110,37 @@
def __init__(self, root, cwd):
match.__init__(self, root, cwd, [])
+class narrowmatcher(match):
+ """Adapt a matcher to work on a subdirectory only.
+
+ The paths are remapped to remove/insert the path as needed:
+
+ >>> m1 = match('root', '', ['a.txt', 'sub/b.txt'])
+ >>> m2 = narrowmatcher('sub', m1)
+ >>> bool(m2('a.txt'))
+ False
+ >>> bool(m2('b.txt'))
+ True
+ >>> bool(m2.matchfn('a.txt'))
+ False
+ >>> bool(m2.matchfn('b.txt'))
+ True
+ >>> m2.files()
+ ['b.txt']
+ >>> m2.exact('b.txt')
+ True
+ """
+
+ def __init__(self, path, matcher):
+ self._path = path
+ self._matcher = matcher
+
+ self._files = [f[len(path) + 1:] for f in matcher._files
+ if f.startswith(path + "/")]
+ self._anypats = matcher._anypats
+ self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
+ self._fmap = set(self._files)
+
def patkind(pat):
return _patsplit(pat, None)[0]
@@ -214,14 +248,14 @@
try:
re.compile('(?:%s)' % _regex(k, p, tail))
except re.error:
- raise util.Abort("invalid pattern (%s): %s" % (k, p))
- raise util.Abort("invalid pattern")
+ raise util.Abort(_("invalid pattern (%s): %s") % (k, p))
+ raise util.Abort(_("invalid pattern"))
-def _normalize(names, default, root, cwd):
+def _normalize(names, default, root, cwd, auditor):
pats = []
for kind, name in [_patsplit(p, default) for p in names]:
if kind in ('glob', 'relpath'):
- name = util.canonpath(root, cwd, name)
+ name = util.canonpath(root, cwd, name, auditor)
elif kind in ('relglob', 'path'):
name = util.normpath(name)
--- a/mercurial/patch.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/patch.py Sat Sep 11 00:40:19 2010 +0200
@@ -1284,7 +1284,7 @@
if eolmode is None:
eolmode = ui.config('patch', 'eol', 'strict')
if eolmode.lower() not in eolmodes:
- raise util.Abort(_('Unsupported line endings type: %s') % eolmode)
+ raise util.Abort(_('unsupported line endings type: %s') % eolmode)
eolmode = eolmode.lower()
try:
@@ -1352,7 +1352,7 @@
'''print base85-encoded binary diff'''
def gitindex(text):
if not text:
- return '0' * 40
+ return hex(nullid)
l = len(text)
s = util.sha1('blob %d\0' % l)
s.update(text)
@@ -1404,7 +1404,7 @@
context=get('unified', getter=ui.config))
def diff(repo, node1=None, node2=None, match=None, changes=None, opts=None,
- losedatafn=None):
+ losedatafn=None, prefix=''):
'''yields diff of changes to files between two nodes, or node and
working directory.
@@ -1418,6 +1418,9 @@
called with the name of current file being diffed as 'fn'. If set
to None, patches will always be upgraded to git format when
necessary.
+
+ prefix is a filename prefix that is prepended to all filenames on
+ display (used for subrepos).
'''
if opts is None:
@@ -1462,7 +1465,7 @@
copy = copies.copies(repo, ctx1, ctx2, repo[nullid])[0]
difffn = lambda opts, losedata: trydiff(repo, revs, ctx1, ctx2,
- modified, added, removed, copy, getfilectx, opts, losedata)
+ modified, added, removed, copy, getfilectx, opts, losedata, prefix)
if opts.upgrade and not opts.git:
try:
def losedata(fn):
@@ -1518,7 +1521,10 @@
header.append('new mode %s\n' % nmode)
def trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
- copy, getfilectx, opts, losedatafn):
+ copy, getfilectx, opts, losedatafn, prefix):
+
+ def join(f):
+ return os.path.join(prefix, f)
date1 = util.datestr(ctx1.date())
man1 = ctx1.manifest()
@@ -1557,8 +1563,8 @@
gone.add(a)
else:
op = 'copy'
- header.append('%s from %s\n' % (op, a))
- header.append('%s to %s\n' % (op, f))
+ header.append('%s from %s\n' % (op, join(a)))
+ header.append('%s to %s\n' % (op, join(f)))
to = getfilectx(a, ctx1).data()
else:
losedatafn(f)
@@ -1600,7 +1606,7 @@
elif binary or nflag != oflag:
losedatafn(f)
if opts.git:
- header.insert(0, mdiff.diffline(revs, a, b, opts))
+ header.insert(0, mdiff.diffline(revs, join(a), join(b), opts))
if dodiff:
if dodiff == 'binary':
@@ -1609,7 +1615,7 @@
text = mdiff.unidiff(to, date1,
# ctx2 date may be dynamic
tn, util.datestr(ctx2.date()),
- a, b, revs, opts=opts)
+ join(a), join(b), revs, opts=opts)
if header and (text or len(header) > 1):
yield ''.join(header)
if text:
--- a/mercurial/repair.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/repair.py Sat Sep 11 00:40:19 2010 +0200
@@ -35,7 +35,7 @@
def _collectextranodes(repo, files, link):
"""return the nodes that have to be saved before the strip"""
- def collectone(revlog):
+ def collectone(cl, revlog):
extra = []
startrev = count = len(revlog)
# find the truncation point of the revlog
@@ -57,12 +57,12 @@
extranodes = {}
cl = repo.changelog
- extra = collectone(repo.manifest)
+ extra = collectone(cl, repo.manifest)
if extra:
extranodes[1] = extra
for fname in files:
f = repo.file(fname)
- extra = collectone(f)
+ extra = collectone(cl, f)
if extra:
extranodes[fname] = extra
--- a/mercurial/revset.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/revset.py Sat Sep 11 00:40:19 2010 +0200
@@ -7,7 +7,7 @@
import re
import parser, util, error, discovery
-import match as _match
+import match as matchmod
from i18n import _
elements = {
@@ -292,7 +292,7 @@
def hasfile(repo, subset, x):
pat = getstring(x, _("file wants a pattern"))
- m = _match.match(repo.root, repo.getcwd(), [pat])
+ m = matchmod.match(repo.root, repo.getcwd(), [pat])
s = []
for r in subset:
for f in repo[r].files():
@@ -303,7 +303,7 @@
def contains(repo, subset, x):
pat = getstring(x, _("contains wants a pattern"))
- m = _match.match(repo.root, repo.getcwd(), [pat])
+ m = matchmod.match(repo.root, repo.getcwd(), [pat])
s = []
if m.files() == [pat]:
for r in subset:
@@ -319,7 +319,7 @@
return s
def checkstatus(repo, subset, pat, field):
- m = _match.match(repo.root, repo.getcwd(), [pat])
+ m = matchmod.match(repo.root, repo.getcwd(), [pat])
s = []
fast = (m.files() == [pat])
for r in subset:
--- a/mercurial/simplemerge.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/simplemerge.py Sat Sep 11 00:40:19 2010 +0200
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# Copyright (C) 2004, 2005 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
--- a/mercurial/sshrepo.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/sshrepo.py Sat Sep 11 00:40:19 2010 +0200
@@ -6,7 +6,7 @@
# GNU General Public License version 2 or any later version.
from i18n import _
-import repo, util, error, wireproto
+import util, error, wireproto
import re
class remotelock(object):
--- a/mercurial/sshserver.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/sshserver.py Sat Sep 11 00:40:19 2010 +0200
@@ -6,7 +6,6 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-from i18n import _
import util, hook, wireproto
import os, sys
--- a/mercurial/store.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/store.py Sat Sep 11 00:40:19 2010 +0200
@@ -163,7 +163,7 @@
mode = None
return mode
-_data = 'data 00manifest.d 00manifest.i 00changelog.d 00changelog.i'
+_data = 'data 00manifest.d 00manifest.i 00changelog.d 00changelog.i'
class basicstore(object):
'''base class for local repository stores'''
--- a/mercurial/subrepo.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/subrepo.py Sat Sep 11 00:40:19 2010 +0200
@@ -7,7 +7,7 @@
import errno, os, re, xml.dom.minidom, shutil, urlparse, posixpath
from i18n import _
-import config, util, node, error
+import config, util, node, error, cmdutil
hg = None
nullstate = ('', '', 'empty')
@@ -184,6 +184,16 @@
return repo.ui.config('paths', 'default-push', repo.root)
return repo.ui.config('paths', 'default', repo.root)
+def itersubrepos(ctx1, ctx2):
+ """find subrepos in ctx1 or ctx2"""
+ # Create a (subpath, ctx) mapping where we prefer subpaths from
+ # ctx1. The subpaths from ctx2 are important when the .hgsub file
+ # has been modified (in ctx2) but not yet committed (in ctx1).
+ subpaths = dict.fromkeys(ctx2.substate, ctx2)
+ subpaths.update(dict.fromkeys(ctx1.substate, ctx1))
+ for subpath, ctx in sorted(subpaths.iteritems()):
+ yield subpath, ctx.sub(subpath)
+
def subrepo(ctx, path):
"""return instance of the right subrepo class for subrepo in path"""
# subrepo inherently violates our import layering rules
@@ -210,6 +220,10 @@
"""
raise NotImplementedError
+ def checknested(path):
+ """check if path is a subrepository within this repository"""
+ return False
+
def commit(self, text, user, date):
"""commit the current changes to the subrepo with the given
log message. Use given user and date if possible. Return the
@@ -242,6 +256,12 @@
raise NotImplementedError
+ def status(self, rev2, **opts):
+ return [], [], [], [], [], [], []
+
+ def diff(self, diffopts, node2, match, prefix, **opts):
+ pass
+
class hgsubrepo(abstractsubrepo):
def __init__(self, ctx, path, state):
self._path = path
@@ -271,6 +291,32 @@
addpathconfig('default-push', defpushpath)
fp.close()
+ def status(self, rev2, **opts):
+ try:
+ rev1 = self._state[1]
+ ctx1 = self._repo[rev1]
+ ctx2 = self._repo[rev2]
+ return self._repo.status(ctx1, ctx2, **opts)
+ except error.RepoLookupError, inst:
+ self._repo.ui.warn(_("warning: %s in %s\n")
+ % (inst, relpath(self)))
+ return [], [], [], [], [], [], []
+
+ def diff(self, diffopts, node2, match, prefix, **opts):
+ try:
+ node1 = node.bin(self._state[1])
+ # We currently expect node2 to come from substate and be
+ # in hex format
+ if node2 is not None:
+ node2 = node.bin(node2)
+ cmdutil.diffordiffstat(self._repo.ui, self._repo, diffopts,
+ node1, node2, match,
+ prefix=os.path.join(prefix, self._path),
+ listsubrepos=True, **opts)
+ except error.RepoLookupError, inst:
+ self._repo.ui.warn(_("warning: %s in %s\n")
+ % (inst, relpath(self)))
+
def dirty(self):
r = self._state[1]
if r == '':
@@ -280,6 +326,9 @@
return True
return w.dirty() # working directory changed
+ def checknested(self, path):
+ return self._repo._checknested(self._repo.wjoin(path))
+
def commit(self, text, user, date):
self._repo.ui.debug("committing subrepo %s\n" % relpath(self))
n = self._repo.commit(text, user, date)
@@ -410,7 +459,7 @@
raise util.Abort(_('cannot commit svn externals'))
commitinfo = self._svncommand(['commit', '-m', text])
self._ui.status(commitinfo)
- newrev = re.search('Committed revision ([\d]+).', commitinfo)
+ newrev = re.search('Committed revision ([0-9]+).', commitinfo)
if not newrev:
raise util.Abort(commitinfo.splitlines()[-1])
newrev = newrev.groups()[0]
@@ -427,7 +476,7 @@
def get(self, state):
status = self._svncommand(['checkout', state[0], '--revision', state[1]])
- if not re.search('Checked out revision [\d]+.', status):
+ if not re.search('Checked out revision [0-9]+.', status):
raise util.Abort(status.splitlines()[-1])
self._ui.status(status)
--- a/mercurial/ui.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/ui.py Sat Sep 11 00:40:19 2010 +0200
@@ -9,9 +9,6 @@
import errno, getpass, os, socket, sys, tempfile, traceback
import config, util, error
-_booleans = {'1': True, 'yes': True, 'true': True, 'on': True,
- '0': False, 'no': False, 'false': False, 'off': False}
-
class ui(object):
def __init__(self, src=None):
self._buffers = []
@@ -149,10 +146,11 @@
return default
if isinstance(v, bool):
return v
- if v.lower() not in _booleans:
+ b = util.parsebool(v)
+ if b is None:
raise error.ConfigError(_("%s.%s not a boolean ('%s')")
% (section, name, v))
- return _booleans[v.lower()]
+ return b
def configlist(self, section, name, default=None, untrusted=False):
"""Return a list of comma/space separated strings"""
--- a/mercurial/util.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/util.py Sat Sep 11 00:40:19 2010 +0200
@@ -17,7 +17,7 @@
import error, osutil, encoding
import errno, re, shutil, sys, tempfile, traceback
import os, stat, time, calendar, textwrap, unicodedata, signal
-import imp
+import imp, socket
# Python compatibility
@@ -292,7 +292,7 @@
b.reverse()
return os.sep.join((['..'] * len(a)) + b) or '.'
-def canonpath(root, cwd, myname):
+def canonpath(root, cwd, myname, auditor=None):
"""return the canonical path of myname, given cwd and root"""
if endswithsep(root):
rootsep = root
@@ -302,10 +302,11 @@
if not os.path.isabs(name):
name = os.path.join(root, cwd, name)
name = os.path.normpath(name)
- audit_path = path_auditor(root)
+ if auditor is None:
+ auditor = path_auditor(root)
if name != rootsep and name.startswith(rootsep):
name = name[len(rootsep):]
- audit_path(name)
+ auditor(name)
return pconvert(name)
elif name == root:
return ''
@@ -329,7 +330,7 @@
return ''
rel.reverse()
name = os.path.join(*rel)
- audit_path(name)
+ auditor(name)
return pconvert(name)
dirname, basename = os.path.split(name)
rel.append(basename)
@@ -491,12 +492,15 @@
- starts at the root of a windows drive
- contains ".."
- traverses a symlink (e.g. a/symlink_here/b)
- - inside a nested repository'''
+ - inside a nested repository (a callback can be used to approve
+ some nested repositories, e.g., subrepositories)
+ '''
- def __init__(self, root):
+ def __init__(self, root, callback=None):
self.audited = set()
self.auditeddir = set()
self.root = root
+ self.callback = callback
def __call__(self, path):
if path in self.audited:
@@ -529,8 +533,9 @@
(path, prefix))
elif (stat.S_ISDIR(st.st_mode) and
os.path.isdir(os.path.join(curpath, '.hg'))):
- raise Abort(_('path %r is inside repo %r') %
- (path, prefix))
+ if not self.callback or not self.callback(curpath):
+ raise Abort(_('path %r is inside repo %r') %
+ (path, prefix))
parts.pop()
prefixes = []
while parts:
@@ -835,9 +840,9 @@
def __init__(self, base, audit=True):
self.base = base
if audit:
- self.audit_path = path_auditor(base)
+ self.auditor = path_auditor(base)
else:
- self.audit_path = always
+ self.auditor = always
self.createmode = None
@propertycache
@@ -850,7 +855,7 @@
os.chmod(name, self.createmode & 0666)
def __call__(self, path, mode="r", text=False, atomictemp=False):
- self.audit_path(path)
+ self.auditor(path)
f = os.path.join(self.base, path)
if not text and "b" not in mode:
@@ -875,7 +880,7 @@
return fp
def symlink(self, src, dst):
- self.audit_path(dst)
+ self.auditor(dst)
linkname = os.path.join(self.base, dst)
try:
os.unlink(linkname)
@@ -945,7 +950,7 @@
buf += chunk
return buf
-
+
def filechunkiter(f, size=65536, limit=None):
"""Create a generator that produces the data in the file size
(default 65536) bytes at a time, up to optional limit (default is
@@ -1064,7 +1069,7 @@
else:
break
else:
- raise Abort(_('invalid date: %r ') % date)
+ raise Abort(_('invalid date: %r') % date)
# validate explicit (probably user-specified) date and
# time zone offset. values must fit in signed 32 bits for
# current 32-bit linux runtimes. timezones go from UTC-12
@@ -1414,3 +1419,30 @@
r = re.compile(r'%s(%s)' % (prefix, '|'.join(mapping.keys())))
return r.sub(lambda x: fn(mapping[x.group()[1:]]), s)
+def getport(port):
+ """Return the port for a given network service.
+
+ If port is an integer, it's returned as is. If it's a string, it's
+ looked up using socket.getservbyname(). If there's no matching
+ service, util.Abort is raised.
+ """
+ try:
+ return int(port)
+ except ValueError:
+ pass
+
+ try:
+ return socket.getservbyname(port)
+ except socket.error:
+ raise Abort(_("no port number associated with service '%s'") % port)
+
+_booleans = {'1': True, 'yes': True, 'true': True, 'on': True, 'always': True,
+ '0': False, 'no': False, 'false': False, 'off': False,
+ 'never': False}
+
+def parsebool(s):
+ """Parse s into a boolean.
+
+ If s is not a valid boolean, returns None.
+ """
+ return _booleans.get(s.lower(), None)
--- a/mercurial/verify.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/verify.py Sat Sep 11 00:40:19 2010 +0200
@@ -199,7 +199,7 @@
for f, f2, size in repo.store.datafiles():
if not f:
err(None, _("cannot decode filename '%s'") % f2)
- elif size > 0:
+ elif size > 0 or not revlogv1:
storefiles.add(f)
files = sorted(set(filenodes) | set(filelinkrevs))
--- a/mercurial/windows.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/windows.py Sat Sep 11 00:40:19 2010 +0200
@@ -288,7 +288,7 @@
'''atomically rename file src to dst, replacing dst if it exists'''
try:
os.rename(src, dst)
- except OSError, err: # FIXME: check err (EEXIST ?)
+ except OSError: # FIXME: check err (EEXIST ?)
# On windows, rename to existing file is not allowed, so we
# must delete destination first. But if a file is open, unlink
--- a/mercurial/wireproto.py Wed Sep 01 10:13:55 2010 +0200
+++ b/mercurial/wireproto.py Sat Sep 11 00:40:19 2010 +0200
@@ -10,7 +10,7 @@
from node import bin, hex
import changegroup as changegroupmod
import repo, error, encoding, util, store
-import pushkey as pushkey_
+import pushkey as pushkeymod
# list of nodes encoding / decoding
@@ -123,7 +123,7 @@
_('push failed:'), output)
try:
ret = int(ret)
- except ValueError, err:
+ except ValueError:
raise error.ResponseError(
_('push failed (unexpected response):'), ret)
@@ -202,7 +202,7 @@
return "capabilities: %s\n" % (capabilities(repo, proto))
def listkeys(repo, proto, namespace):
- d = pushkey_.list(repo, namespace).items()
+ d = pushkeymod.list(repo, namespace).items()
t = '\n'.join(['%s\t%s' % (k.encode('string-escape'),
v.encode('string-escape')) for k, v in d])
return t
@@ -217,7 +217,7 @@
return "%s %s\n" % (success, r)
def pushkey(repo, proto, namespace, key, old, new):
- r = pushkey_.push(repo, namespace, key, old, new)
+ r = pushkeymod.push(repo, namespace, key, old, new)
return '%s\n' % int(r)
def _allowstream(ui):
--- a/tests/get-with-headers.py Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/get-with-headers.py Sat Sep 11 00:40:19 2010 +0200
@@ -12,18 +12,40 @@
except ImportError:
pass
-headers = [h.lower() for h in sys.argv[3:]]
-conn = httplib.HTTPConnection(sys.argv[1])
-conn.request("GET", sys.argv[2])
-response = conn.getresponse()
-print response.status, response.reason
-for h in headers:
- if response.getheader(h, None) is not None:
- print "%s: %s" % (h, response.getheader(h))
-print
-data = response.read()
-sys.stdout.write(data)
+twice = False
+if '--twice' in sys.argv:
+ sys.argv.remove('--twice')
+ twice = True
+
+tag = None
+def request(host, path, show):
+
+ global tag
+ headers = {}
+ if tag:
+ headers['If-None-Match'] = tag
-if 200 <= response.status <= 299:
+ conn = httplib.HTTPConnection(host)
+ conn.request("GET", path, None, headers)
+ response = conn.getresponse()
+ print response.status, response.reason
+ for h in [h.lower() for h in show]:
+ if response.getheader(h, None) is not None:
+ print "%s: %s" % (h, response.getheader(h))
+
+ print
+ data = response.read()
+ sys.stdout.write(data)
+
+ if twice and response.getheader('ETag', None):
+ tag = response.getheader('ETag')
+
+ return response.status
+
+status = request(sys.argv[1], sys.argv[2], sys.argv[3:])
+if twice:
+ status = request(sys.argv[1], sys.argv[2], sys.argv[3:])
+
+if 200 <= status <= 305:
sys.exit(0)
sys.exit(1)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/revlog-formatv0.py Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+# Copyright 2010 Intevation GmbH
+# Author(s):
+# Thomas Arendsen Hein <thomas@intevation.de>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+"""Create a Mercurial repository in revlog format 0
+
+changeset: 0:a1ef0b125355
+tag: tip
+user: user
+date: Thu Jan 01 00:00:00 1970 +0000
+files: empty
+description:
+empty file
+"""
+
+import os, sys
+
+files = [
+ ('formatv0/.hg/00changelog.i',
+ '000000000000004400000000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '0000a1ef0b125355d27765928be600cfe85784284ab3'),
+ ('formatv0/.hg/00changelog.d',
+ '756163613935613961356635353036303562366138343738336237'
+ '61623536363738616436356635380a757365720a3020300a656d70'
+ '74790a0a656d7074792066696c65'),
+ ('formatv0/.hg/00manifest.i',
+ '000000000000003000000000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '0000aca95a9a5f550605b6a84783b7ab56678ad65f58'),
+ ('formatv0/.hg/00manifest.d',
+ '75656d707479006238306465356431333837353835343163356630'
+ '35323635616431343461623966613836643164620a'),
+ ('formatv0/.hg/data/empty.i',
+ '000000000000000000000000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '0000b80de5d138758541c5f05265ad144ab9fa86d1db'),
+ ('formatv0/.hg/data/empty.d',
+ ''),
+]
+
+def makedirs(name):
+ """recursive directory creation"""
+ parent = os.path.dirname(name)
+ if parent:
+ makedirs(parent)
+ os.mkdir(name)
+
+makedirs(os.path.join(*'formatv0/.hg/data'.split('/')))
+
+for name, data in files:
+ f = open(name, 'wb')
+ f.write(data.decode('hex'))
+ f.close()
+
+sys.exit(0)
--- a/tests/test-addremove.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-addremove.t Sat Sep 11 00:40:19 2010 +0200
@@ -5,19 +5,19 @@
$ hg -v addremove
adding dir/bar
adding foo
- $ hg -v commit -m "add 1" -d "1000000 0"
+ $ hg -v commit -m "add 1"
dir/bar
foo
- committed changeset 0:d44511117907
+ committed changeset 0:6f7f953567a2
$ cd dir/
$ touch ../foo_2 bar_2
$ hg -v addremove
adding dir/bar_2
adding foo_2
- $ hg -v commit -m "add 2" -d "1000000 0"
+ $ hg -v commit -m "add 2"
dir/bar_2
foo_2
- committed changeset 1:a85812e0561a
+ committed changeset 1:e65414bf35c5
$ cd ..
$ hg init sim
--- a/tests/test-backwards-remove.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-backwards-remove.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,12 +1,12 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ ls
a
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ hg co 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
--- a/tests/test-basic.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-basic.t Sat Sep 11 00:40:19 2010 +0200
@@ -8,15 +8,15 @@
$ echo a > a
$ hg add a
- $ hg commit -m test -d "1000000 0"
+ $ hg commit -m test
This command is ancient:
$ hg history
- changeset: 0:0acdaf898367
+ changeset: 0:acb14030fe0a
tag: tip
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: test
--- a/tests/test-bheads Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-#!/bin/sh
-
-heads()
-{
- hg heads --template '{rev}: {desc|firstline|strip} ({branches})\n' "$@"
-}
-
-hg init a
-cd a
-echo 'root' >root
-hg add root
-hg commit -m "Adding root node"
-heads
-echo '-------'
-heads .
-
-echo '======='
-echo 'a' >a
-hg add a
-hg branch a
-hg commit -m "Adding a branch"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg update -C 0
-echo 'b' >b
-hg add b
-hg branch b
-hg commit -m "Adding b branch"
-heads
-echo '-------'
-heads .
-
-echo '======='
-echo 'bh1' >bh1
-hg add bh1
-hg commit -m "Adding b branch head 1"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg update -C 2
-echo 'bh2' >bh2
-hg add bh2
-hg commit -m "Adding b branch head 2"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg update -C 2
-echo 'bh3' >bh3
-hg add bh3
-hg commit -m "Adding b branch head 3"
-heads
-echo '-------'
-heads .
-
-echo '======='
-hg merge 4
-hg commit -m "Merging b branch head 2 and b branch head 3"
-heads
-echo '-------'
-heads .
-
-echo '======='
-echo 'c' >c
-hg add c
-hg branch c
-hg commit -m "Adding c branch"
-heads
-echo '-------'
-heads .
-
-echo '======='
-heads -r 3 .
-echo $?
-echo '-------'
-heads -r 2 .
-echo $?
-echo '-------'
-hg update -C 4
-echo $?
-echo '-------'
-heads -r 3 .
-echo $?
-echo '-------'
-heads -r 2 .
-echo $?
-echo '-------'
-heads -r 7 .
-echo $?
-
-echo '======='
-for i in 0 1 2 3 4 5 6 7; do
- hg update -C "$i"
- heads
- echo '-------'
- heads .
- echo '-------'
-done
-
-echo '======='
-for i in a b c z; do
- heads "$i"
- echo '-------'
-done
-
-echo '======='
-heads 0 1 2 3 4 5 6 7
-
-echo '% topological heads'
-heads -t
-
-echo '______________'
-cd ..
-
-hg init newheadmsg
-cd newheadmsg
-
-echo '% created new head message'
-echo '% init: no msg'
-echo 1 > a
-hg ci -Am "a0: Initial root"
-echo 2 >> a
-hg ci -m "a1 (HN)"
-
-hg branch b
-echo 1 > b
-hg ci -Am "b2: Initial root for branch b"
-echo 2 >> b
-hg ci -m "b3 (HN)"
-
-echo '% case NN: msg'
-hg up -q null
-hg branch -f b
-echo 1 > bb
-hg ci -Am "b4 (NN): new topo root for branch b"
-
-echo '% case HN: no msg'
-echo 2 >> bb
-hg ci -m "b5 (HN)"
-
-echo '% case BN: msg'
-hg branch -f default
-echo 1 > aa
-hg ci -Am "a6 (BN): new branch root"
-
-echo '% case CN: msg'
-hg up -q 4
-echo 3 >> bbb
-hg ci -Am "b7 (CN): regular new head"
-
-echo '% case BB: msg'
-hg up -q 4
-hg merge -q 3
-hg branch -f default
-hg ci -m "a8 (BB): weird new branch root"
-
-echo '% case CB: msg'
-hg up -q 4
-hg merge -q 1
-hg ci -m "b9 (CB): new head from branch merge"
-
-echo '% case HB: no msg'
-hg up -q 7
-hg merge -q 6
-hg ci -m "b10 (HB): continuing head from branch merge"
-
-echo '% case CC: msg'
-hg up -q 4
-hg merge -q 2
-hg ci -m "b11 (CC): new head from merge"
-
-echo '% case CH: no msg'
-hg up -q 2
-hg merge -q 10
-hg ci -m "b12 (CH): continuing head from merge"
-
-echo '% case HH: no msg'
-hg merge -q 3
-hg ci -m "b12 (HH): merging two heads"
-
--- a/tests/test-bheads.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-0: Adding root node ()
--------
-0: Adding root node ()
-=======
-marked working directory as branch a
-1: Adding a branch (a)
-0: Adding root node ()
--------
-1: Adding a branch (a)
-=======
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch b
-2: Adding b branch (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-2: Adding b branch (b)
-=======
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-3: Adding b branch head 1 (b)
-=======
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-=======
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-5: Adding b branch head 3 (b)
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-5: Adding b branch head 3 (b)
-4: Adding b branch head 2 (b)
-3: Adding b branch head 1 (b)
-=======
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-=======
-marked working directory as branch c
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-7: Adding c branch (c)
-=======
-no open branch heads found on branches c (started at 3)
-1
--------
-7: Adding c branch (c)
-0
--------
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-0
--------
-3: Adding b branch head 1 (b)
-0
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-0
--------
-no open branch heads found on branches b (started at 7)
-1
-=======
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-0: Adding root node ()
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-1: Adding a branch (a)
--------
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
--------
-7: Adding c branch (c)
--------
-=======
-1: Adding a branch (a)
--------
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
--------
-7: Adding c branch (c)
--------
-abort: unknown revision 'z'!
--------
-=======
-7: Adding c branch (c)
-6: Merging b branch head 2 and b branch head 3 (b)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-0: Adding root node ()
-% topological heads
-7: Adding c branch (c)
-3: Adding b branch head 1 (b)
-1: Adding a branch (a)
-______________
-% created new head message
-% init: no msg
-adding a
-marked working directory as branch b
-adding b
-% case NN: msg
-marked working directory as branch b
-adding bb
-created new head
-% case HN: no msg
-% case BN: msg
-marked working directory as branch default
-adding aa
-created new head
-% case CN: msg
-adding bbb
-created new head
-% case BB: msg
-marked working directory as branch default
-created new head
-% case CB: msg
-created new head
-% case HB: no msg
-% case CC: msg
-created new head
-% case CH: no msg
-% case HH: no msg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bheads.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,377 @@
+ $ heads()
+ > {
+ > hg heads --template '{rev}: {desc|firstline|strip} ({branches})\n' "$@"
+ > }
+
+ $ hg init a
+ $ cd a
+ $ echo 'root' >root
+ $ hg add root
+ $ hg commit -m "Adding root node"
+ $ heads
+ 0: Adding root node ()
+-------
+ $ heads .
+ 0: Adding root node ()
+
+=======
+
+ $ echo 'a' >a
+ $ hg add a
+ $ hg branch a
+ marked working directory as branch a
+ $ hg commit -m "Adding a branch"
+ $ heads
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+-------
+ $ heads .
+ 1: Adding a branch (a)
+
+=======
+
+ $ hg update -C 0
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ echo 'b' >b
+ $ hg add b
+ $ hg branch b
+ marked working directory as branch b
+ $ hg commit -m "Adding b branch"
+ $ heads
+ 2: Adding b branch (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+-------
+ $ heads .
+ 2: Adding b branch (b)
+
+=======
+
+ $ echo 'bh1' >bh1
+ $ hg add bh1
+ $ hg commit -m "Adding b branch head 1"
+ $ heads
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+-------
+ $ heads .
+ 3: Adding b branch head 1 (b)
+
+=======
+
+ $ hg update -C 2
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ echo 'bh2' >bh2
+ $ hg add bh2
+ $ hg commit -m "Adding b branch head 2"
+ created new head
+ $ heads
+ 4: Adding b branch head 2 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ $ heads .
+ 4: Adding b branch head 2 (b)
+ 3: Adding b branch head 1 (b)
+
+=======
+
+ $ hg update -C 2
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ echo 'bh3' >bh3
+ $ hg add bh3
+ $ hg commit -m "Adding b branch head 3"
+ created new head
+ $ heads
+ 5: Adding b branch head 3 (b)
+ 4: Adding b branch head 2 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+-------
+ $ heads .
+ 5: Adding b branch head 3 (b)
+ 4: Adding b branch head 2 (b)
+ 3: Adding b branch head 1 (b)
+
+=======
+
+ $ hg merge 4
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg commit -m "Merging b branch head 2 and b branch head 3"
+ $ heads
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+-------
+ $ heads .
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+
+=======
+
+ $ echo 'c' >c
+ $ hg add c
+ $ hg branch c
+ marked working directory as branch c
+ $ hg commit -m "Adding c branch"
+ $ heads
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+-------
+ $ heads .
+ 7: Adding c branch (c)
+
+=======
+
+ $ heads -r 3 .
+ no open branch heads found on branches c (started at 3)
+ $ echo $?
+ 0
+ $ heads -r 2 .
+ 7: Adding c branch (c)
+ $ echo $?
+ 0
+-------
+ $ hg update -C 4
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ $ echo $?
+ 0
+-------
+ $ heads -r 3 .
+ 3: Adding b branch head 1 (b)
+ $ echo $?
+ 0
+-------
+ $ heads -r 2 .
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ $ echo $?
+ 0
+-------
+ $ heads -r 7 .
+ no open branch heads found on branches b (started at 7)
+ $ echo $?
+ 0
+
+=======
+
+ $ for i in 0 1 2 3 4 5 6 7; do
+ > hg update -C "$i"
+ > heads
+ > echo '-------'
+ > heads .
+ > echo '-------'
+ > done
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 0: Adding root node ()
+ -------
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 1: Adding a branch (a)
+ -------
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ -------
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ -------
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ -------
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ -------
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ -------
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+ -------
+ 7: Adding c branch (c)
+ -------
+
+=======
+
+ $ for i in a b c z; do
+ > heads "$i"
+ > echo '-------'
+ > done
+ 1: Adding a branch (a)
+ -------
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ -------
+ 7: Adding c branch (c)
+ -------
+ abort: unknown revision 'z'!
+ -------
+
+=======
+
+ $ heads 0 1 2 3 4 5 6 7
+ 7: Adding c branch (c)
+ 6: Merging b branch head 2 and b branch head 3 (b)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+ 0: Adding root node ()
+
+Topological heads:
+
+ $ heads -t
+ 7: Adding c branch (c)
+ 3: Adding b branch head 1 (b)
+ 1: Adding a branch (a)
+
+ $ cd ..
+______________
+
+"created new head" message tests
+
+ $ hg init newheadmsg
+ $ cd newheadmsg
+
+Init: no msg
+
+ $ echo 1 > a
+ $ hg ci -Am "a0: Initial root"
+ adding a
+ $ echo 2 >> a
+ $ hg ci -m "a1 (HN)"
+
+ $ hg branch b
+ marked working directory as branch b
+ $ echo 1 > b
+ $ hg ci -Am "b2: Initial root for branch b"
+ adding b
+ $ echo 2 >> b
+ $ hg ci -m "b3 (HN)"
+
+Case NN: msg
+
+ $ hg up -q null
+ $ hg branch -f b
+ marked working directory as branch b
+ $ echo 1 > bb
+ $ hg ci -Am "b4 (NN): new topo root for branch b"
+ adding bb
+ created new head
+
+Case HN: no msg
+
+ $ echo 2 >> bb
+ $ hg ci -m "b5 (HN)"
+
+Case BN: msg
+
+ $ hg branch -f default
+ marked working directory as branch default
+ $ echo 1 > aa
+ $ hg ci -Am "a6 (BN): new branch root"
+ adding aa
+ created new head
+
+Case CN: msg
+
+ $ hg up -q 4
+ $ echo 3 >> bbb
+ $ hg ci -Am "b7 (CN): regular new head"
+ adding bbb
+ created new head
+
+Case BB: msg
+
+ $ hg up -q 4
+ $ hg merge -q 3
+ $ hg branch -f default
+ marked working directory as branch default
+ $ hg ci -m "a8 (BB): weird new branch root"
+ created new head
+
+Case CB: msg
+
+ $ hg up -q 4
+ $ hg merge -q 1
+ $ hg ci -m "b9 (CB): new head from branch merge"
+ created new head
+
+Case HB: no msg
+
+ $ hg up -q 7
+ $ hg merge -q 6
+ $ hg ci -m "b10 (HB): continuing head from branch merge"
+
+Case CC: msg
+
+ $ hg up -q 4
+ $ hg merge -q 2
+ $ hg ci -m "b11 (CC): new head from merge"
+ created new head
+
+Case CH: no msg
+
+ $ hg up -q 2
+ $ hg merge -q 10
+ $ hg ci -m "b12 (CH): continuing head from merge"
+
+Case HH: no msg
+
+ $ hg merge -q 3
+ $ hg ci -m "b12 (HH): merging two heads"
+
--- a/tests/test-bisect Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-#!/bin/sh
-
-set -e
-
-echo % init
-hg init
-
-echo % committing changes
-count=0
-echo > a
-while test $count -lt 32 ; do
- echo 'a' >> a
- test $count -eq 0 && hg add
- hg ci -m "msg $count" -d "$count 0"
- echo % committed changeset $count
- count=`expr $count + 1`
-done
-
-echo % log
-hg log
-
-echo % hg up -C
-hg up -C
-
-echo % bisect test
-hg bisect -r
-hg bisect -b
-hg bisect -g 1
-hg bisect -g
-echo skip
-hg bisect -s
-hg bisect -g
-hg bisect -g
-hg bisect -b
-hg bisect -g
-
-echo % bisect reverse test
-hg bisect -r
-hg bisect -b null
-hg bisect -g tip
-hg bisect -g
-echo skip
-hg bisect -s
-hg bisect -g
-hg bisect -g
-hg bisect -b
-hg bisect -g
-
-hg bisect -r
-hg bisect -g tip
-hg bisect -b tip || echo error
-
-hg bisect -r
-hg bisect -g null
-hg bisect -bU tip
-hg id
-
-echo % reproduce AssertionError, issue1228 and issue1182
-hg bisect -r
-hg bisect -b 4
-hg bisect -g 0
-hg bisect -s
-hg bisect -s
-hg bisect -s
-
-echo % reproduce non converging bisect, issue1182
-hg bisect -r
-hg bisect -g 0
-hg bisect -b 2
-hg bisect -s
-
-echo % test no action
-hg bisect -r
-hg bisect || echo failure
-
-echo % reproduce AssertionError, issue1445
-hg bisect -r
-hg bisect -b 6
-hg bisect -g 0
-hg bisect -s
-hg bisect -s
-hg bisect -s
-hg bisect -s
-hg bisect -g
-
-set +e
-
-echo % test invalid command
-# assuming that the shell returns 127 if command not found ...
-hg bisect -r
-hg bisect --command 'exit 127'
-
-echo % test bisecting command
-cat > script.py <<EOF
-#!/usr/bin/env python
-import sys
-from mercurial import ui, hg
-repo = hg.repository(ui.ui(), '.')
-if repo['.'].rev() < 6:
- sys.exit(1)
-EOF
-chmod +x script.py
-hg bisect -r
-hg bisect --good tip
-hg bisect --bad 0
-hg bisect --command "'`pwd`/script.py' and some parameters"
-true
--- a/tests/test-bisect.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-% init
-% committing changes
-adding a
-% committed changeset 0
-% committed changeset 1
-% committed changeset 2
-% committed changeset 3
-% committed changeset 4
-% committed changeset 5
-% committed changeset 6
-% committed changeset 7
-% committed changeset 8
-% committed changeset 9
-% committed changeset 10
-% committed changeset 11
-% committed changeset 12
-% committed changeset 13
-% committed changeset 14
-% committed changeset 15
-% committed changeset 16
-% committed changeset 17
-% committed changeset 18
-% committed changeset 19
-% committed changeset 20
-% committed changeset 21
-% committed changeset 22
-% committed changeset 23
-% committed changeset 24
-% committed changeset 25
-% committed changeset 26
-% committed changeset 27
-% committed changeset 28
-% committed changeset 29
-% committed changeset 30
-% committed changeset 31
-% log
-changeset: 31:58c80a7c8a40
-tag: tip
-user: test
-date: Thu Jan 01 00:00:31 1970 +0000
-summary: msg 31
-
-changeset: 30:ed2d2f24b11c
-user: test
-date: Thu Jan 01 00:00:30 1970 +0000
-summary: msg 30
-
-changeset: 29:b5bd63375ab9
-user: test
-date: Thu Jan 01 00:00:29 1970 +0000
-summary: msg 29
-
-changeset: 28:8e0c2264c8af
-user: test
-date: Thu Jan 01 00:00:28 1970 +0000
-summary: msg 28
-
-changeset: 27:288867a866e9
-user: test
-date: Thu Jan 01 00:00:27 1970 +0000
-summary: msg 27
-
-changeset: 26:3efc6fd51aeb
-user: test
-date: Thu Jan 01 00:00:26 1970 +0000
-summary: msg 26
-
-changeset: 25:02a84173a97a
-user: test
-date: Thu Jan 01 00:00:25 1970 +0000
-summary: msg 25
-
-changeset: 24:10e0acd3809e
-user: test
-date: Thu Jan 01 00:00:24 1970 +0000
-summary: msg 24
-
-changeset: 23:5ec79163bff4
-user: test
-date: Thu Jan 01 00:00:23 1970 +0000
-summary: msg 23
-
-changeset: 22:06c7993750ce
-user: test
-date: Thu Jan 01 00:00:22 1970 +0000
-summary: msg 22
-
-changeset: 21:e5db6aa3fe2a
-user: test
-date: Thu Jan 01 00:00:21 1970 +0000
-summary: msg 21
-
-changeset: 20:7128fb4fdbc9
-user: test
-date: Thu Jan 01 00:00:20 1970 +0000
-summary: msg 20
-
-changeset: 19:52798545b482
-user: test
-date: Thu Jan 01 00:00:19 1970 +0000
-summary: msg 19
-
-changeset: 18:86977a90077e
-user: test
-date: Thu Jan 01 00:00:18 1970 +0000
-summary: msg 18
-
-changeset: 17:03515f4a9080
-user: test
-date: Thu Jan 01 00:00:17 1970 +0000
-summary: msg 17
-
-changeset: 16:a2e6ea4973e9
-user: test
-date: Thu Jan 01 00:00:16 1970 +0000
-summary: msg 16
-
-changeset: 15:e7fa0811edb0
-user: test
-date: Thu Jan 01 00:00:15 1970 +0000
-summary: msg 15
-
-changeset: 14:ce8f0998e922
-user: test
-date: Thu Jan 01 00:00:14 1970 +0000
-summary: msg 14
-
-changeset: 13:9d7d07bc967c
-user: test
-date: Thu Jan 01 00:00:13 1970 +0000
-summary: msg 13
-
-changeset: 12:1941b52820a5
-user: test
-date: Thu Jan 01 00:00:12 1970 +0000
-summary: msg 12
-
-changeset: 11:7b4cd9578619
-user: test
-date: Thu Jan 01 00:00:11 1970 +0000
-summary: msg 11
-
-changeset: 10:7c5eff49a6b6
-user: test
-date: Thu Jan 01 00:00:10 1970 +0000
-summary: msg 10
-
-changeset: 9:eb44510ef29a
-user: test
-date: Thu Jan 01 00:00:09 1970 +0000
-summary: msg 9
-
-changeset: 8:453eb4dba229
-user: test
-date: Thu Jan 01 00:00:08 1970 +0000
-summary: msg 8
-
-changeset: 7:03750880c6b5
-user: test
-date: Thu Jan 01 00:00:07 1970 +0000
-summary: msg 7
-
-changeset: 6:a3d5c6fdf0d3
-user: test
-date: Thu Jan 01 00:00:06 1970 +0000
-summary: msg 6
-
-changeset: 5:7874a09ea728
-user: test
-date: Thu Jan 01 00:00:05 1970 +0000
-summary: msg 5
-
-changeset: 4:9b2ba8336a65
-user: test
-date: Thu Jan 01 00:00:04 1970 +0000
-summary: msg 4
-
-changeset: 3:b53bea5e2fcb
-user: test
-date: Thu Jan 01 00:00:03 1970 +0000
-summary: msg 3
-
-changeset: 2:db07c04beaca
-user: test
-date: Thu Jan 01 00:00:02 1970 +0000
-summary: msg 2
-
-changeset: 1:5cd978ea5149
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: msg 1
-
-changeset: 0:b99c7b9c8e11
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: msg 0
-
-% hg up -C
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% bisect test
-Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-skip
-Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first bad revision is:
-changeset: 29:b5bd63375ab9
-user: test
-date: Thu Jan 01 00:00:29 1970 +0000
-summary: msg 29
-
-% bisect reverse test
-Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-skip
-Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first good revision is:
-changeset: 1:5cd978ea5149
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: msg 1
-
-abort: starting revisions are not directly related
-error
-Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
-5cd978ea5149
-% reproduce AssertionError, issue1228 and issue1182
-Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Due to skipped revisions, the first bad revision could be any of:
-changeset: 1:5cd978ea5149
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: msg 1
-
-changeset: 2:db07c04beaca
-user: test
-date: Thu Jan 01 00:00:02 1970 +0000
-summary: msg 2
-
-changeset: 3:b53bea5e2fcb
-user: test
-date: Thu Jan 01 00:00:03 1970 +0000
-summary: msg 3
-
-changeset: 4:9b2ba8336a65
-user: test
-date: Thu Jan 01 00:00:04 1970 +0000
-summary: msg 4
-
-% reproduce non converging bisect, issue1182
-Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Due to skipped revisions, the first bad revision could be any of:
-changeset: 1:5cd978ea5149
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: msg 1
-
-changeset: 2:db07c04beaca
-user: test
-date: Thu Jan 01 00:00:02 1970 +0000
-summary: msg 2
-
-% test no action
-abort: cannot bisect (no known good revisions)
-failure
-% reproduce AssertionError, issue1445
-Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-The first bad revision is:
-changeset: 6:a3d5c6fdf0d3
-user: test
-date: Thu Jan 01 00:00:06 1970 +0000
-summary: msg 6
-
-% test invalid command
-abort: failed to execute exit 127
-% test bisecting command
-Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Changeset 15:e7fa0811edb0: good
-Changeset 7:03750880c6b5: good
-Changeset 3:b53bea5e2fcb: bad
-Changeset 5:7874a09ea728: bad
-Changeset 6:a3d5c6fdf0d3: good
-The first good revision is:
-changeset: 6:a3d5c6fdf0d3
-user: test
-date: Thu Jan 01 00:00:06 1970 +0000
-summary: msg 6
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-bisect.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,418 @@
+ $ set -e
+ $ hg init
+
+
+committing changes
+
+ $ count=0
+ $ echo > a
+ $ while test $count -lt 32 ; do
+ > echo 'a' >> a
+ > test $count -eq 0 && hg add
+ > hg ci -m "msg $count" -d "$count 0"
+ > count=`expr $count + 1`
+ > done
+ adding a
+
+
+ $ hg log
+ changeset: 31:58c80a7c8a40
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:31 1970 +0000
+ summary: msg 31
+
+ changeset: 30:ed2d2f24b11c
+ user: test
+ date: Thu Jan 01 00:00:30 1970 +0000
+ summary: msg 30
+
+ changeset: 29:b5bd63375ab9
+ user: test
+ date: Thu Jan 01 00:00:29 1970 +0000
+ summary: msg 29
+
+ changeset: 28:8e0c2264c8af
+ user: test
+ date: Thu Jan 01 00:00:28 1970 +0000
+ summary: msg 28
+
+ changeset: 27:288867a866e9
+ user: test
+ date: Thu Jan 01 00:00:27 1970 +0000
+ summary: msg 27
+
+ changeset: 26:3efc6fd51aeb
+ user: test
+ date: Thu Jan 01 00:00:26 1970 +0000
+ summary: msg 26
+
+ changeset: 25:02a84173a97a
+ user: test
+ date: Thu Jan 01 00:00:25 1970 +0000
+ summary: msg 25
+
+ changeset: 24:10e0acd3809e
+ user: test
+ date: Thu Jan 01 00:00:24 1970 +0000
+ summary: msg 24
+
+ changeset: 23:5ec79163bff4
+ user: test
+ date: Thu Jan 01 00:00:23 1970 +0000
+ summary: msg 23
+
+ changeset: 22:06c7993750ce
+ user: test
+ date: Thu Jan 01 00:00:22 1970 +0000
+ summary: msg 22
+
+ changeset: 21:e5db6aa3fe2a
+ user: test
+ date: Thu Jan 01 00:00:21 1970 +0000
+ summary: msg 21
+
+ changeset: 20:7128fb4fdbc9
+ user: test
+ date: Thu Jan 01 00:00:20 1970 +0000
+ summary: msg 20
+
+ changeset: 19:52798545b482
+ user: test
+ date: Thu Jan 01 00:00:19 1970 +0000
+ summary: msg 19
+
+ changeset: 18:86977a90077e
+ user: test
+ date: Thu Jan 01 00:00:18 1970 +0000
+ summary: msg 18
+
+ changeset: 17:03515f4a9080
+ user: test
+ date: Thu Jan 01 00:00:17 1970 +0000
+ summary: msg 17
+
+ changeset: 16:a2e6ea4973e9
+ user: test
+ date: Thu Jan 01 00:00:16 1970 +0000
+ summary: msg 16
+
+ changeset: 15:e7fa0811edb0
+ user: test
+ date: Thu Jan 01 00:00:15 1970 +0000
+ summary: msg 15
+
+ changeset: 14:ce8f0998e922
+ user: test
+ date: Thu Jan 01 00:00:14 1970 +0000
+ summary: msg 14
+
+ changeset: 13:9d7d07bc967c
+ user: test
+ date: Thu Jan 01 00:00:13 1970 +0000
+ summary: msg 13
+
+ changeset: 12:1941b52820a5
+ user: test
+ date: Thu Jan 01 00:00:12 1970 +0000
+ summary: msg 12
+
+ changeset: 11:7b4cd9578619
+ user: test
+ date: Thu Jan 01 00:00:11 1970 +0000
+ summary: msg 11
+
+ changeset: 10:7c5eff49a6b6
+ user: test
+ date: Thu Jan 01 00:00:10 1970 +0000
+ summary: msg 10
+
+ changeset: 9:eb44510ef29a
+ user: test
+ date: Thu Jan 01 00:00:09 1970 +0000
+ summary: msg 9
+
+ changeset: 8:453eb4dba229
+ user: test
+ date: Thu Jan 01 00:00:08 1970 +0000
+ summary: msg 8
+
+ changeset: 7:03750880c6b5
+ user: test
+ date: Thu Jan 01 00:00:07 1970 +0000
+ summary: msg 7
+
+ changeset: 6:a3d5c6fdf0d3
+ user: test
+ date: Thu Jan 01 00:00:06 1970 +0000
+ summary: msg 6
+
+ changeset: 5:7874a09ea728
+ user: test
+ date: Thu Jan 01 00:00:05 1970 +0000
+ summary: msg 5
+
+ changeset: 4:9b2ba8336a65
+ user: test
+ date: Thu Jan 01 00:00:04 1970 +0000
+ summary: msg 4
+
+ changeset: 3:b53bea5e2fcb
+ user: test
+ date: Thu Jan 01 00:00:03 1970 +0000
+ summary: msg 3
+
+ changeset: 2:db07c04beaca
+ user: test
+ date: Thu Jan 01 00:00:02 1970 +0000
+ summary: msg 2
+
+ changeset: 1:5cd978ea5149
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: msg 1
+
+ changeset: 0:b99c7b9c8e11
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: msg 0
+
+
+ $ hg up -C
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+bisect test
+
+ $ hg bisect -r
+ $ hg bisect -b
+ $ hg bisect -g 1
+ Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+skip
+
+ $ hg bisect -s
+ Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -b
+ Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ The first bad revision is:
+ changeset: 29:b5bd63375ab9
+ user: test
+ date: Thu Jan 01 00:00:29 1970 +0000
+ summary: msg 29
+
+
+mark revsets instead of single revs
+
+ $ hg bisect -r
+ $ hg bisect -b "0::3"
+ $ hg bisect -s "13::16"
+ $ hg bisect -g "26::tip"
+ Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat .hg/bisect.state
+ skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
+ skip ce8f0998e922c179e80819d5066fbe46e2998784
+ skip e7fa0811edb063f6319531f0d0a865882138e180
+ skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
+ bad b99c7b9c8e11558adef3fad9af211c58d46f325b
+ bad 5cd978ea51499179507ee7b6f340d2dbaa401185
+ bad db07c04beaca44cf24832541e7f4a2346a95275b
+ bad b53bea5e2fcb30d3e00bd3409507a5659ce0fd8b
+ good 3efc6fd51aeb8594398044c6c846ca59ae021203
+ good 288867a866e9adb7a29880b66936c874b80f4651
+ good 8e0c2264c8af790daf3585ada0669d93dee09c83
+ good b5bd63375ab9a290419f2024b7f4ee9ea7ce90a8
+ good ed2d2f24b11c368fa8aa0da9f4e1db580abade59
+ good 58c80a7c8a4025a94cedaf7b4a4e3124e8909a96
+
+bisect reverse test
+
+ $ hg bisect -r
+ $ hg bisect -b null
+ $ hg bisect -g tip
+ Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+skip
+
+ $ hg bisect -s
+ Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -b
+ Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ The first good revision is:
+ changeset: 1:5cd978ea5149
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: msg 1
+
+
+ $ hg bisect -r
+ $ hg bisect -g tip
+ $ hg bisect -b tip || echo error
+ abort: starting revisions are not directly related
+ error
+
+ $ hg bisect -r
+ $ hg bisect -g null
+ $ hg bisect -bU tip
+ Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
+ $ hg id
+ 5cd978ea5149
+
+
+reproduce AssertionError, issue1228 and issue1182
+
+ $ hg bisect -r
+ $ hg bisect -b 4
+ $ hg bisect -g 0
+ Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Due to skipped revisions, the first bad revision could be any of:
+ changeset: 1:5cd978ea5149
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: msg 1
+
+ changeset: 2:db07c04beaca
+ user: test
+ date: Thu Jan 01 00:00:02 1970 +0000
+ summary: msg 2
+
+ changeset: 3:b53bea5e2fcb
+ user: test
+ date: Thu Jan 01 00:00:03 1970 +0000
+ summary: msg 3
+
+ changeset: 4:9b2ba8336a65
+ user: test
+ date: Thu Jan 01 00:00:04 1970 +0000
+ summary: msg 4
+
+
+
+reproduce non converging bisect, issue1182
+
+ $ hg bisect -r
+ $ hg bisect -g 0
+ $ hg bisect -b 2
+ Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Due to skipped revisions, the first bad revision could be any of:
+ changeset: 1:5cd978ea5149
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: msg 1
+
+ changeset: 2:db07c04beaca
+ user: test
+ date: Thu Jan 01 00:00:02 1970 +0000
+ summary: msg 2
+
+
+
+test no action
+
+ $ hg bisect -r
+ $ hg bisect || echo failure
+ abort: cannot bisect (no known good revisions)
+ failure
+
+
+reproduce AssertionError, issue1445
+
+ $ hg bisect -r
+ $ hg bisect -b 6
+ $ hg bisect -g 0
+ Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -s
+ Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -g
+ The first bad revision is:
+ changeset: 6:a3d5c6fdf0d3
+ user: test
+ date: Thu Jan 01 00:00:06 1970 +0000
+ summary: msg 6
+
+
+ $ set +e
+
+test invalid command
+assuming that the shell returns 127 if command not found ...
+
+ $ hg bisect -r
+ $ hg bisect --command 'exit 127'
+ abort: failed to execute exit 127
+
+
+test bisecting command
+
+ $ cat > script.py <<EOF
+ > #!/usr/bin/env python
+ > import sys
+ > from mercurial import ui, hg
+ > repo = hg.repository(ui.ui(), '.')
+ > if repo['.'].rev() < 6:
+ > sys.exit(1)
+ > EOF
+ $ chmod +x script.py
+ $ hg bisect -r
+ $ hg bisect --good tip
+ $ hg bisect --bad 0
+ Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect --command "'`pwd`/script.py' and some parameters"
+ Changeset 15:e7fa0811edb0: good
+ Changeset 7:03750880c6b5: good
+ Changeset 3:b53bea5e2fcb: bad
+ Changeset 5:7874a09ea728: bad
+ Changeset 6:a3d5c6fdf0d3: good
+ The first good revision is:
+ changeset: 6:a3d5c6fdf0d3
+ user: test
+ date: Thu Jan 01 00:00:06 1970 +0000
+ summary: msg 6
+
--- a/tests/test-bisect2.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-bisect2.t Sat Sep 11 00:40:19 2010 +0200
@@ -394,3 +394,35 @@
$ hg bisect -g 14
abort: starting revisions are not directly related
$ hg bisect --reset
+
+end at merge: 17 bad, 11 good (but 9 is first bad)
+
+ $ hg bisect -r
+ $ hg bisect -b 17
+ $ hg bisect -g 11
+ Testing changeset 13:b0a32c86eb31 (5 changesets remaining, ~2 tests)
+ 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ hg bisect -g
+ Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
+ 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg bisect -b
+ The first bad revision is:
+ changeset: 15:857b178a7cf3
+ parent: 13:b0a32c86eb31
+ parent: 10:429fcd26f52d
+ user: test
+ date: Thu Jan 01 00:00:15 1970 +0000
+ summary: merge 10,13
+
+ Not all ancestors of this changeset have been checked.
+ To check the other ancestors, start from the common ancestor, dab8161ac8fc.
+ $ hg bisect -g 8 # dab8161ac8fc
+ Testing changeset 9:3c77083deb4a (3 changesets remaining, ~1 tests)
+ 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ $ hg bisect -b
+ The first bad revision is:
+ changeset: 9:3c77083deb4a
+ user: test
+ date: Thu Jan 01 00:00:09 1970 +0000
+ summary: 9
+
--- a/tests/test-bookmarks-strip.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-bookmarks-strip.t Sat Sep 11 00:40:19 2010 +0200
@@ -13,7 +13,7 @@
commit first revision
- $ hg ci -m 1 -u user -d "1 0"
+ $ hg ci -m 1
set bookmark
@@ -23,7 +23,7 @@
commit second revision
- $ hg ci -m 2 -u usr -d "1 0"
+ $ hg ci -m 2
set bookmark
@@ -38,14 +38,14 @@
commit new head
- $ hg ci -m 3 -u user -d "1 0"
+ $ hg ci -m 3
created new head
bookmarks updated?
$ hg book
- test 1:16b24da7e457
- test2 1:16b24da7e457
+ test 1:25e1ee7a0081
+ test2 1:25e1ee7a0081
strip to revision 1
@@ -55,6 +55,6 @@
list bookmarks
$ hg book
- * test 1:9f1b7e78eff8
- * test2 1:9f1b7e78eff8
+ * test 1:8cf31af87a2b
+ * test2 1:8cf31af87a2b
--- a/tests/test-bundle-r.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-bundle-r.t Sat Sep 11 00:40:19 2010 +0200
@@ -2,30 +2,30 @@
$ cd test
$ echo "0" >> afile
$ hg add afile
- $ hg commit -m "0.0" -d "1000000 0"
+ $ hg commit -m "0.0"
$ echo "1" >> afile
- $ hg commit -m "0.1" -d "1000000 0"
+ $ hg commit -m "0.1"
$ echo "2" >> afile
- $ hg commit -m "0.2" -d "1000000 0"
+ $ hg commit -m "0.2"
$ echo "3" >> afile
- $ hg commit -m "0.3" -d "1000000 0"
+ $ hg commit -m "0.3"
$ hg update -C 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo "1" >> afile
- $ hg commit -m "1.1" -d "1000000 0"
+ $ hg commit -m "1.1"
created new head
$ echo "2" >> afile
- $ hg commit -m "1.2" -d "1000000 0"
+ $ hg commit -m "1.2"
$ echo "a line" > fred
$ echo "3" >> afile
$ hg add fred
- $ hg commit -m "1.3" -d "1000000 0"
+ $ hg commit -m "1.3"
$ hg mv afile adifferentfile
- $ hg commit -m "1.3m" -d "1000000 0"
+ $ hg commit -m "1.3m"
$ hg update -C 3
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg mv afile anotherfile
- $ hg commit -m "0.3m" -d "1000000 0"
+ $ hg commit -m "0.3m"
$ hg debugindex .hg/store/data/afile.i
rev offset length base linkrev nodeid p1 p2
0 0 3 0 0 362fef284ce2 000000000000 000000000000
@@ -79,7 +79,7 @@
crosschecking files in changesets and manifests
checking files
1 files, 1 changesets, 1 total revisions
- 0:5649c9d34dd8
+ 0:f9ee2f85a263
searching for changes
2 changesets found
adding changesets
@@ -92,7 +92,7 @@
crosschecking files in changesets and manifests
checking files
1 files, 2 changesets, 2 total revisions
- 1:10b2180f755b
+ 1:34c2bf6b0626
searching for changes
3 changesets found
adding changesets
@@ -105,7 +105,7 @@
crosschecking files in changesets and manifests
checking files
1 files, 3 changesets, 3 total revisions
- 2:d62976ca1e50
+ 2:e38ba6f5b7e0
searching for changes
4 changesets found
adding changesets
@@ -118,7 +118,7 @@
crosschecking files in changesets and manifests
checking files
1 files, 4 changesets, 4 total revisions
- 3:ac69c658229d
+ 3:eebf5a27f8ca
searching for changes
2 changesets found
adding changesets
@@ -131,7 +131,7 @@
crosschecking files in changesets and manifests
checking files
1 files, 2 changesets, 2 total revisions
- 1:5f4f3ceb285e
+ 1:095197eb4973
searching for changes
3 changesets found
adding changesets
@@ -144,7 +144,7 @@
crosschecking files in changesets and manifests
checking files
1 files, 3 changesets, 3 total revisions
- 2:024e4e7df376
+ 2:1bb50a9436a7
searching for changes
4 changesets found
adding changesets
@@ -157,7 +157,7 @@
crosschecking files in changesets and manifests
checking files
2 files, 4 changesets, 5 total revisions
- 3:1e3f6b843bd6
+ 3:7373c1169842
searching for changes
5 changesets found
adding changesets
@@ -170,7 +170,7 @@
crosschecking files in changesets and manifests
checking files
3 files, 5 changesets, 6 total revisions
- 4:27f57c869697
+ 4:a6a34bfa0076
searching for changes
5 changesets found
adding changesets
@@ -183,7 +183,7 @@
crosschecking files in changesets and manifests
checking files
2 files, 5 changesets, 5 total revisions
- 4:088ff9d6e1e1
+ 4:aa35859c02ea
$ cd test-8
$ hg pull ../test-7
pulling from ../test-7
@@ -242,17 +242,17 @@
revision 2
$ hg tip -q
- 2:d62976ca1e50
+ 2:e38ba6f5b7e0
$ hg unbundle ../test-bundle-should-fail.hg
adding changesets
transaction abort!
rollback completed
- abort: 00changelog.i@ac69c658229d: unknown parent!
+ abort: 00changelog.i@eebf5a27f8ca: unknown parent!
revision 2
$ hg tip -q
- 2:d62976ca1e50
+ 2:e38ba6f5b7e0
$ hg unbundle ../test-bundle-all.hg
adding changesets
adding manifests
@@ -263,7 +263,7 @@
revision 8
$ hg tip -q
- 8:088ff9d6e1e1
+ 8:aa35859c02ea
$ hg verify
checking changesets
checking manifests
@@ -276,7 +276,7 @@
revision 2
$ hg tip -q
- 2:d62976ca1e50
+ 2:e38ba6f5b7e0
$ hg unbundle ../test-bundle-branch1.hg
adding changesets
adding manifests
@@ -287,7 +287,7 @@
revision 4
$ hg tip -q
- 4:088ff9d6e1e1
+ 4:aa35859c02ea
$ hg verify
checking changesets
checking manifests
@@ -306,7 +306,7 @@
revision 6
$ hg tip -q
- 6:27f57c869697
+ 6:a6a34bfa0076
$ hg verify
checking changesets
checking manifests
@@ -325,7 +325,7 @@
revision 4
$ hg tip -q
- 4:088ff9d6e1e1
+ 4:aa35859c02ea
$ hg verify
checking changesets
checking manifests
@@ -340,7 +340,7 @@
adifferentfile
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
- $ hg ci -m merge -d "1000000 0"
+ $ hg ci -m merge
$ cd ..
$ hg -R test bundle --base 2 test-bundle-head.hg
7 changesets found
@@ -358,7 +358,7 @@
revision 9
$ hg tip -q
- 9:e3061ea42e4c
+ 9:905597b0d5d4
$ hg verify
checking changesets
checking manifests
--- a/tests/test-bundle.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-bundle.t Sat Sep 11 00:40:19 2010 +0200
@@ -6,30 +6,30 @@
$ cd test
$ echo 0 > afile
$ hg add afile
- $ hg commit -m "0.0" -d "1000000 0"
+ $ hg commit -m "0.0"
$ echo 1 >> afile
- $ hg commit -m "0.1" -d "1000000 0"
+ $ hg commit -m "0.1"
$ echo 2 >> afile
- $ hg commit -m "0.2" -d "1000000 0"
+ $ hg commit -m "0.2"
$ echo 3 >> afile
- $ hg commit -m "0.3" -d "1000000 0"
+ $ hg commit -m "0.3"
$ hg update -C 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo 1 >> afile
- $ hg commit -m "1.1" -d "1000000 0"
+ $ hg commit -m "1.1"
created new head
$ echo 2 >> afile
- $ hg commit -m "1.2" -d "1000000 0"
+ $ hg commit -m "1.2"
$ echo "a line" > fred
$ echo 3 >> afile
$ hg add fred
- $ hg commit -m "1.3" -d "1000000 0"
+ $ hg commit -m "1.3"
$ hg mv afile adifferentfile
- $ hg commit -m "1.3m" -d "1000000 0"
+ $ hg commit -m "1.3m"
$ hg update -C 3
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg mv afile anotherfile
- $ hg commit -m "0.3m" -d "1000000 0"
+ $ hg commit -m "0.3m"
$ hg verify
checking changesets
checking manifests
@@ -139,52 +139,52 @@
$ hg init empty
$ cd empty
$ hg -R bundle://../full.hg log
- changeset: 8:088ff9d6e1e1
+ changeset: 8:aa35859c02ea
tag: tip
- parent: 3:ac69c658229d
+ parent: 3:eebf5a27f8ca
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.3m
- changeset: 7:27f57c869697
+ changeset: 7:a6a34bfa0076
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3m
- changeset: 6:1e3f6b843bd6
+ changeset: 6:7373c1169842
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3
- changeset: 5:024e4e7df376
+ changeset: 5:1bb50a9436a7
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.2
- changeset: 4:5f4f3ceb285e
- parent: 0:5649c9d34dd8
+ changeset: 4:095197eb4973
+ parent: 0:f9ee2f85a263
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.1
- changeset: 3:ac69c658229d
+ changeset: 3:eebf5a27f8ca
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.3
- changeset: 2:d62976ca1e50
+ changeset: 2:e38ba6f5b7e0
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.2
- changeset: 1:10b2180f755b
+ changeset: 1:34c2bf6b0626
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.1
- changeset: 0:5649c9d34dd8
+ changeset: 0:f9ee2f85a263
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.0
@@ -198,7 +198,7 @@
hg -R bundle://../full.hg verify
$ hg pull bundle://../full.hg
- changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:../full.hg
+ changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg
pulling from bundle://../full.hg
requesting all changes
adding changesets
@@ -221,7 +221,7 @@
Pull full.hg into empty again (using -R; with hook)
$ hg -R empty pull full.hg
- changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
+ changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
pulling from full.hg
requesting all changes
adding changesets
@@ -250,52 +250,52 @@
Log -R full.hg in partial
$ hg -R bundle://../full.hg log
- changeset: 8:088ff9d6e1e1
+ changeset: 8:aa35859c02ea
tag: tip
- parent: 3:ac69c658229d
+ parent: 3:eebf5a27f8ca
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.3m
- changeset: 7:27f57c869697
+ changeset: 7:a6a34bfa0076
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3m
- changeset: 6:1e3f6b843bd6
+ changeset: 6:7373c1169842
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3
- changeset: 5:024e4e7df376
+ changeset: 5:1bb50a9436a7
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.2
- changeset: 4:5f4f3ceb285e
- parent: 0:5649c9d34dd8
+ changeset: 4:095197eb4973
+ parent: 0:f9ee2f85a263
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.1
- changeset: 3:ac69c658229d
+ changeset: 3:eebf5a27f8ca
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.3
- changeset: 2:d62976ca1e50
+ changeset: 2:e38ba6f5b7e0
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.2
- changeset: 1:10b2180f755b
+ changeset: 1:34c2bf6b0626
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.1
- changeset: 0:5649c9d34dd8
+ changeset: 0:f9ee2f85a263
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.0
@@ -304,32 +304,32 @@
$ hg incoming bundle://../full.hg
comparing with bundle://../full.hg
searching for changes
- changeset: 4:5f4f3ceb285e
- parent: 0:5649c9d34dd8
+ changeset: 4:095197eb4973
+ parent: 0:f9ee2f85a263
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.1
- changeset: 5:024e4e7df376
+ changeset: 5:1bb50a9436a7
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.2
- changeset: 6:1e3f6b843bd6
+ changeset: 6:7373c1169842
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3
- changeset: 7:27f57c869697
+ changeset: 7:a6a34bfa0076
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3m
- changeset: 8:088ff9d6e1e1
+ changeset: 8:aa35859c02ea
tag: tip
- parent: 3:ac69c658229d
+ parent: 3:eebf5a27f8ca
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.3m
@@ -338,32 +338,32 @@
$ hg -R bundle://../full.hg outgoing ../partial2
comparing with ../partial2
searching for changes
- changeset: 4:5f4f3ceb285e
- parent: 0:5649c9d34dd8
+ changeset: 4:095197eb4973
+ parent: 0:f9ee2f85a263
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.1
- changeset: 5:024e4e7df376
+ changeset: 5:1bb50a9436a7
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.2
- changeset: 6:1e3f6b843bd6
+ changeset: 6:7373c1169842
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3
- changeset: 7:27f57c869697
+ changeset: 7:a6a34bfa0076
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3m
- changeset: 8:088ff9d6e1e1
+ changeset: 8:aa35859c02ea
tag: tip
- parent: 3:ac69c658229d
+ parent: 3:eebf5a27f8ca
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.3m
@@ -384,16 +384,16 @@
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R full-clone heads
- changeset: 8:088ff9d6e1e1
+ changeset: 8:aa35859c02ea
tag: tip
- parent: 3:ac69c658229d
+ parent: 3:eebf5a27f8ca
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 0.3m
- changeset: 7:27f57c869697
+ changeset: 7:a6a34bfa0076
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1.3m
$ rm -r full-clone
@@ -482,8 +482,8 @@
$ hg init b
$ cd b
$ hg -R ../all.hg diff -r tip
- diff -r 088ff9d6e1e1 anotherfile
- --- a/anotherfile Mon Jan 12 13:46:40 1970 +0000
+ diff -r aa35859c02ea anotherfile
+ --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-0
--- a/tests/test-cat.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-cat.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,9 +1,7 @@
- $ mkdir t
- $ cd t
$ hg init
$ echo 0 > a
$ echo 0 > b
- $ hg ci -A -m m -d "1000000 0"
+ $ hg ci -A -m m
adding a
adding b
$ hg rm a
@@ -12,13 +10,13 @@
$ hg cat --decode a # more tests in test-encode
0
$ echo 1 > b
- $ hg ci -m m -d "1000000 0"
+ $ hg ci -m m
$ echo 2 > b
$ hg cat -r 0 a
0
$ hg cat -r 0 b
0
$ hg cat -r 1 a
- a: No such file in rev 03f6b0774996
+ a: no such file in rev 7040230c159c
$ hg cat -r 1 b
1
--- a/tests/test-churn Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "churn=" >> $HGRCPATH
-
-echo % create test repository
-hg init repo
-cd repo
-echo a > a
-hg ci -Am adda -u user1 -d 6:00
-echo b >> a
-echo b > b
-hg ci -m changeba -u user2 -d 9:00 a
-hg ci -Am addb -u user2 -d 9:30
-echo c >> a
-echo c >> b
-echo c > c
-hg ci -m changeca -u user3 -d 12:00 a
-hg ci -m changecb -u user3 -d 12:15 b
-hg ci -Am addc -u user3 -d 12:30
-mkdir -p d/e
-echo abc > d/e/f1.txt
-hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt
-mkdir -p d/g
-echo def > d/g/f2.txt
-hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt
-
-echo % churn separate directories
-cd d
-hg churn e
-echo % churn all
-hg churn
-echo % churn excluding one dir
-hg churn -X e
-echo % churn up to rev 2
-hg churn -r :2
-cd ..
-echo % churn with aliases
-cat > ../aliases <<EOF
-user1 alias1
-user3 alias3
-EOF
-hg churn --aliases ../aliases
-echo % churn with .hgchurn
-mv ../aliases .hgchurn
-hg churn
-rm .hgchurn
-echo % churn with column specifier
-COLUMNS=40 hg churn
-echo % churn by hour
-hg churn -f '%H' -s
-
-echo % churn with separated added/removed lines
-hg rm d/g/f2.txt
-hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt
-hg churn --diffstat
-echo % churn --diffstat with color
-hg --config extensions.color= churn --config color.mode=ansi \
- --diffstat --color=always
-
-echo % changeset number churn
-hg churn -c
-
-echo 'with space = no-space' >> ../aliases
-echo a >> a
-hg commit -m a -u 'with space' -d 15:00
-echo % churn with space in alias
-hg churn --aliases ../aliases -r tip
-
-cd ..
-
-# issue 833: ZeroDivisionError
-hg init issue-833
-cd issue-833
-touch foo
-hg ci -Am foo
-# this was failing with a ZeroDivisionError
-hg churn
-cd ..
--- a/tests/test-churn.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-% create test repository
-adding a
-adding b
-adding c
-% churn separate directories
-user1 1 ***************************************************************
-% churn all
-user3 3 ***************************************************************
-user1 3 ***************************************************************
-user2 2 ******************************************
-% churn excluding one dir
-user3 3 ***************************************************************
-user2 2 ******************************************
-user1 2 ******************************************
-% churn up to rev 2
-user2 2 ***************************************************************
-user1 1 ********************************
-% churn with aliases
-alias3 3 **************************************************************
-alias1 3 **************************************************************
-user2 2 *****************************************
-% churn with .hgchurn
-alias3 3 **************************************************************
-alias1 3 **************************************************************
-user2 2 *****************************************
-% churn with column specifier
-user3 3 ***********************
-user1 3 ***********************
-user2 2 ***************
-% churn by hour
-06 1 *****************
-09 2 *********************************
-12 4 ******************************************************************
-13 1 *****************
-% churn with separated added/removed lines
-user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++--------------
-user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++
-user2 +2/-0 +++++++++++++++++++++++++++
-% churn --diffstat with color
-user1 +3/-1 [0;32m+++++++++++++++++++++++++++++++++++++++++[0m[0;31m--------------[0m
-user3 +3/-0 [0;32m+++++++++++++++++++++++++++++++++++++++++[0m
-user2 +2/-0 [0;32m+++++++++++++++++++++++++++[0m
-% changeset number churn
-user1 4 ***************************************************************
-user3 3 ***********************************************
-user2 2 ********************************
-% churn with space in alias
-no-space 1 ************************************************************
-adding foo
-test 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-churn.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,141 @@
+ $ echo "[extensions]" >> $HGRCPATH
+ $ echo "churn=" >> $HGRCPATH
+
+create test repository
+
+ $ hg init repo
+ $ cd repo
+ $ echo a > a
+ $ hg ci -Am adda -u user1 -d 6:00
+ adding a
+ $ echo b >> a
+ $ echo b > b
+ $ hg ci -m changeba -u user2 -d 9:00 a
+ $ hg ci -Am addb -u user2 -d 9:30
+ adding b
+ $ echo c >> a
+ $ echo c >> b
+ $ echo c > c
+ $ hg ci -m changeca -u user3 -d 12:00 a
+ $ hg ci -m changecb -u user3 -d 12:15 b
+ $ hg ci -Am addc -u user3 -d 12:30
+ adding c
+ $ mkdir -p d/e
+ $ echo abc > d/e/f1.txt
+ $ hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt
+ $ mkdir -p d/g
+ $ echo def > d/g/f2.txt
+ $ hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt
+
+
+churn separate directories
+
+ $ cd d
+ $ hg churn e
+ user1 1 ***************************************************************
+
+churn all
+
+ $ hg churn
+ user3 3 ***************************************************************
+ user1 3 ***************************************************************
+ user2 2 ******************************************
+
+churn excluding one dir
+
+ $ hg churn -X e
+ user3 3 ***************************************************************
+ user2 2 ******************************************
+ user1 2 ******************************************
+
+churn up to rev 2
+
+ $ hg churn -r :2
+ user2 2 ***************************************************************
+ user1 1 ********************************
+ $ cd ..
+
+churn with aliases
+
+ $ cat > ../aliases <<EOF
+ > user1 alias1
+ > user3 alias3
+ > not-an-alias
+ > EOF
+
+churn with .hgchurn
+
+ $ mv ../aliases .hgchurn
+ $ hg churn
+ skipping malformed alias: not-an-alias
+ alias3 3 **************************************************************
+ alias1 3 **************************************************************
+ user2 2 *****************************************
+ $ rm .hgchurn
+
+churn with column specifier
+
+ $ COLUMNS=40 hg churn
+ user3 3 ***********************
+ user1 3 ***********************
+ user2 2 ***************
+
+churn by hour
+
+ $ hg churn -f '%H' -s
+ 06 1 *****************
+ 09 2 *********************************
+ 12 4 ******************************************************************
+ 13 1 *****************
+
+
+churn with separated added/removed lines
+
+ $ hg rm d/g/f2.txt
+ $ hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt
+ $ hg churn --diffstat
+ user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++--------------
+ user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++
+ user2 +2/-0 +++++++++++++++++++++++++++
+
+churn --diffstat with color
+
+ $ hg --config extensions.color= churn --config color.mode=ansi \
+ > --diffstat --color=always
+ user1 +3/-1 [0;32m+++++++++++++++++++++++++++++++++++++++++[0m[0;31m--------------[0m
+ user3 +3/-0 [0;32m+++++++++++++++++++++++++++++++++++++++++[0m
+ user2 +2/-0 [0;32m+++++++++++++++++++++++++++[0m
+
+
+changeset number churn
+
+ $ hg churn -c
+ user1 4 ***************************************************************
+ user3 3 ***********************************************
+ user2 2 ********************************
+
+ $ echo 'with space = no-space' >> ../aliases
+ $ echo a >> a
+ $ hg commit -m a -u 'with space' -d 15:00
+
+churn with space in alias
+
+ $ hg churn --aliases ../aliases -r tip
+ no-space 1 ************************************************************
+
+ $ cd ..
+
+
+issue 833: ZeroDivisionError
+
+ $ hg init issue-833
+ $ cd issue-833
+ $ touch foo
+ $ hg ci -Am foo
+ adding foo
+
+this was failing with a ZeroDivisionError
+
+ $ hg churn
+ test 0
+ $ cd ..
--- a/tests/test-commit.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-commit.t Sat Sep 11 00:40:19 2010 +0200
@@ -11,9 +11,9 @@
$ hg commit -d '1 4444444' -m commit-3
abort: impossible time zone offset: 4444444
$ hg commit -d '1 15.1' -m commit-4
- abort: invalid date: '1\t15.1'
+ abort: invalid date: '1\t15.1'
$ hg commit -d 'foo bar' -m commit-5
- abort: invalid date: 'foo bar'
+ abort: invalid date: 'foo bar'
$ hg commit -d ' 1 4444' -m commit-6
$ hg commit -d '111111111111 0' -m commit-7
abort: date exceeds 32 bits: 111111111111
@@ -23,9 +23,9 @@
$ echo bar > bar
$ hg add bar
$ rm bar
- $ hg commit -d "1000000 0" -m commit-8
+ $ hg commit -m commit-8
nothing changed
- $ hg commit -d "1000000 0" -m commit-8-2 bar
+ $ hg commit -m commit-8-2 bar
abort: bar: file not found!
$ hg -q revert -a --no-backup
@@ -89,15 +89,15 @@
$ hg add
adding bar/bar
adding foo/foo
- $ hg ci -d '1000000 0' -m commit-subdir-1 foo
- $ hg ci -d '1000001 0' -m commit-subdir-2 bar
+ $ hg ci -m commit-subdir-1 foo
+ $ hg ci -m commit-subdir-2 bar
subdir log 1
$ hg log -v foo
- changeset: 0:6ef3cb06bb80
+ changeset: 0:f97e73a25882
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: foo/foo
description:
commit-subdir-1
@@ -107,10 +107,10 @@
subdir log 2
$ hg log -v bar
- changeset: 1:f2e51572cf5a
+ changeset: 1:aa809156d50d
tag: tip
user: test
- date: Mon Jan 12 13:46:41 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: bar/bar
description:
commit-subdir-2
@@ -120,18 +120,18 @@
full log
$ hg log -v
- changeset: 1:f2e51572cf5a
+ changeset: 1:aa809156d50d
tag: tip
user: test
- date: Mon Jan 12 13:46:41 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: bar/bar
description:
commit-subdir-2
- changeset: 0:6ef3cb06bb80
+ changeset: 0:f97e73a25882
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: foo/foo
description:
commit-subdir-1
@@ -147,25 +147,25 @@
$ mkdir foo
$ echo foo content > foo/plain-file
$ hg add foo/plain-file
- $ hg ci -d '1000000 0' -m commit-foo-subdir foo
+ $ hg ci -m commit-foo-subdir foo
$ echo modified foo content > foo/plain-file
- $ hg ci -d '2000000 0' -m commit-foo-dot .
+ $ hg ci -m commit-foo-dot .
full log
$ hg log -v
- changeset: 1:d9180e04fa8a
+ changeset: 1:95b38e3a5b2e
tag: tip
user: test
- date: Sat Jan 24 03:33:20 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: foo/plain-file
description:
commit-foo-dot
- changeset: 0:80b572aaf098
+ changeset: 0:65d4e9386227
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: foo/plain-file
description:
commit-foo-subdir
@@ -176,15 +176,15 @@
$ cd foo
$ hg log .
- changeset: 1:d9180e04fa8a
+ changeset: 1:95b38e3a5b2e
tag: tip
user: test
- date: Sat Jan 24 03:33:20 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: commit-foo-dot
- changeset: 0:80b572aaf098
+ changeset: 0:65d4e9386227
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: commit-foo-subdir
$ cd ..
--- a/tests/test-committer.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-committer.t Sat Sep 11 00:40:19 2010 +0200
@@ -6,56 +6,56 @@
$ cd test
$ touch asdf
$ hg add asdf
- $ hg commit -d '1000000 0' -m commit-1
+ $ hg commit -m commit-1
$ hg tip
- changeset: 0:9426b370c206
+ changeset: 0:53f268a58230
tag: tip
user: My Name <myname@example.com>
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: commit-1
$ unset EMAIL
$ echo 1234 > asdf
- $ hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1
+ $ hg commit -u "foo@bar.com" -m commit-1
$ hg tip
- changeset: 1:4997f15a1b24
+ changeset: 1:3871b2a9e9bf
tag: tip
user: foo@bar.com
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: commit-1
$ echo "[ui]" >> .hg/hgrc
$ echo "username = foobar <foo@bar.com>" >> .hg/hgrc
$ echo 12 > asdf
- $ hg commit -d '1000000 0' -m commit-1
+ $ hg commit -m commit-1
$ hg tip
- changeset: 2:72b8012b424e
+ changeset: 2:8eeac6695c1c
tag: tip
user: foobar <foo@bar.com>
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: commit-1
$ echo 1 > asdf
- $ hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1
+ $ hg commit -u "foo@bar.com" -m commit-1
$ hg tip
- changeset: 3:35ff3067bedd
+ changeset: 3:957606a725e4
tag: tip
user: foo@bar.com
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: commit-1
$ echo 123 > asdf
$ echo "[ui]" > .hg/hgrc
$ echo "username = " >> .hg/hgrc
- $ hg commit -d '1000000 0' -m commit-1
+ $ hg commit -m commit-1
abort: no username supplied (see "hg help config")
$ rm .hg/hgrc
- $ hg commit -d '1000000 0' -m commit-1 2>&1
+ $ hg commit -m commit-1 2>&1
No username found, using '[^']*' instead
$ echo space > asdf
- $ hg commit -d '1000000 0' -u ' ' -m commit-1
+ $ hg commit -u ' ' -m commit-1
transaction abort!
rollback completed
abort: empty username!
--- a/tests/test-config-case Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-echo '[Section]' >> $HGRCPATH
-echo 'KeY = Case Sensitive' >> $HGRCPATH
-echo 'key = lower case' >> $HGRCPATH
-
-hg showconfig Section
--- a/tests/test-config-case.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Section.KeY=Case Sensitive
-Section.key=lower case
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-config-case.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,8 @@
+ $ echo '[Section]' >> $HGRCPATH
+ $ echo 'KeY = Case Sensitive' >> $HGRCPATH
+ $ echo 'key = lower case' >> $HGRCPATH
+
+ $ hg showconfig Section
+ Section.KeY=Case Sensitive
+ Section.key=lower case
+
--- a/tests/test-conflict.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-conflict.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,13 +1,13 @@
$ hg init
$ echo "nothing" > a
$ hg add a
- $ hg commit -m ancestor -d "1000000 0"
+ $ hg commit -m ancestor
$ echo "something" > a
- $ hg commit -m branch1 -d "1000000 0"
+ $ hg commit -m branch1
$ hg co 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo "something else" > a
- $ hg commit -m branch2 -d "1000000 0"
+ $ hg commit -m branch2
created new head
$ hg merge 1
@@ -18,7 +18,7 @@
use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
$ hg id
- e7fe8eb3e180+0d24b7662d3e+ tip
+ 32e80765d7fe+75234512624c+ tip
$ cat a
<<<<<<< local
--- a/tests/test-confused-revert Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-confused-revert Sat Sep 11 00:40:19 2010 +0200
@@ -3,7 +3,7 @@
hg init
echo foo > a
hg add a
-hg commit -m "1" -d "1000000 0"
+hg commit -m "1"
echo bar > b
hg add b
@@ -22,11 +22,11 @@
hg co -C 0
echo foo-a > a
-hg commit -m "2a" -d "1000000 0"
+hg commit -m "2a"
hg co -C 0
echo foo-b > a
-hg commit -m "2b" -d "1000000 0"
+hg commit -m "2b"
HGMERGE=true hg merge 1
--- a/tests/test-convert-cvs Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-convert-cvs Sat Sep 11 00:40:19 2010 +0200
@@ -134,6 +134,7 @@
echo % commit new file revisions with some fuzz
cd src
+sleep 1
echo f >> a
cvscall -q commit -mfuzzy . | grep '<--' |\
sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
--- a/tests/test-convert-hg-startrev Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-echo '[extensions]' >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-echo 'convert =' >> $HGRCPATH
-
-glog()
-{
- hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
-}
-
-hg init source
-cd source
-
-echo a > a
-echo b > b
-hg ci -d '0 0' -qAm '0: add a b'
-echo c > c
-hg ci -d '1 0' -qAm '1: add c'
-hg copy a e
-echo b >> b
-hg ci -d '2 0' -qAm '2: copy e from a, change b'
-hg up -C 0
-echo a >> a
-hg ci -d '3 0' -qAm '3: change a'
-hg merge
-hg copy b d
-hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
-echo a >> a
-hg ci -d '5 0' -qAm '5: change a'
-cd ..
-
-echo % convert from null revision
-hg convert --config convert.hg.startrev=null source empty
-glog empty
-
-echo % convert from zero revision
-hg convert --config convert.hg.startrev=0 source full
-glog full
-
-echo % convert from merge parent
-hg convert --config convert.hg.startrev=1 source conv1
-glog conv1
-cd conv1
-echo % check copy preservation
-hg log --follow --copies e
-echo % check copy removal on missing parent
-hg log --follow --copies d
-hg cat -r tip a b
-hg -q verify
-cd ..
-
-echo % convert from merge
-hg convert --config convert.hg.startrev=4 source conv4
-glog conv4
-cd conv4
-hg up -C
-hg cat -r tip a b
-hg -q verify
-cd ..
-
--- a/tests/test-convert-hg-startrev.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-merging a and e to e
-2 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% convert from null revision
-initializing destination empty repository
-scanning source...
-sorting...
-converting...
-% convert from zero revision
-initializing destination full repository
-scanning source...
-sorting...
-converting...
-5 0: add a b
-4 1: add c
-3 2: copy e from a, change b
-2 3: change a
-1 4: merge 2 and 3, copy d from b
-0 5: change a
-o 5 "5: change a" files: a
-|
-o 4 "4: merge 2 and 3, copy d from b" files: d e
-|\
-| o 3 "3: change a" files: a
-| |
-o | 2 "2: copy e from a, change b" files: b e
-| |
-o | 1 "1: add c" files: c
-|/
-o 0 "0: add a b" files: a b
-
-% convert from merge parent
-initializing destination conv1 repository
-scanning source...
-sorting...
-converting...
-3 1: add c
-2 2: copy e from a, change b
-1 4: merge 2 and 3, copy d from b
-0 5: change a
-o 3 "5: change a" files: a
-|
-o 2 "4: merge 2 and 3, copy d from b" files: a d e
-|
-o 1 "2: copy e from a, change b" files: b e
-|
-o 0 "1: add c" files: a b c
-
-% check copy preservation
-changeset: 2:d67b1d48a835
-user: test
-date: Thu Jan 01 00:00:04 1970 +0000
-summary: 4: merge 2 and 3, copy d from b
-
-changeset: 1:462c431cf47d
-user: test
-date: Thu Jan 01 00:00:02 1970 +0000
-summary: 2: copy e from a, change b
-
-% check copy removal on missing parent
-changeset: 2:d67b1d48a835
-user: test
-date: Thu Jan 01 00:00:04 1970 +0000
-summary: 4: merge 2 and 3, copy d from b
-
-a
-a
-a
-b
-b
-% convert from merge
-initializing destination conv4 repository
-scanning source...
-sorting...
-converting...
-1 4: merge 2 and 3, copy d from b
-0 5: change a
-o 1 "5: change a" files: a
-|
-o 0 "4: merge 2 and 3, copy d from b" files: a b c d e
-
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-a
-a
-b
-b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-hg-startrev.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,152 @@
+
+ $ cat > $HGRCPATH <<EOF
+ > [extensions]
+ > graphlog =
+ > convert =
+ > EOF
+
+ $ glog()
+ > {
+ > hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
+ > }
+
+ $ hg init source
+ $ cd source
+
+ $ echo a > a
+ $ echo b > b
+ $ hg ci -d '0 0' -qAm '0: add a b'
+ $ echo c > c
+ $ hg ci -d '1 0' -qAm '1: add c'
+ $ hg copy a e
+ $ echo b >> b
+ $ hg ci -d '2 0' -qAm '2: copy e from a, change b'
+ $ hg up -C 0
+ 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ $ echo a >> a
+ $ hg ci -d '3 0' -qAm '3: change a'
+ $ hg merge
+ merging a and e to e
+ 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg copy b d
+ $ hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
+ $ echo a >> a
+ $ hg ci -d '5 0' -qAm '5: change a'
+ $ cd ..
+
+Convert from null revision
+
+ $ hg convert --config convert.hg.startrev=null source empty
+ initializing destination empty repository
+ scanning source...
+ sorting...
+ converting...
+
+ $ glog empty
+
+Convert from zero revision
+
+ $ hg convert --config convert.hg.startrev=0 source full
+ initializing destination full repository
+ scanning source...
+ sorting...
+ converting...
+ 5 0: add a b
+ 4 1: add c
+ 3 2: copy e from a, change b
+ 2 3: change a
+ 1 4: merge 2 and 3, copy d from b
+ 0 5: change a
+
+ $ glog full
+ o 5 "5: change a" files: a
+ |
+ o 4 "4: merge 2 and 3, copy d from b" files: d e
+ |\
+ | o 3 "3: change a" files: a
+ | |
+ o | 2 "2: copy e from a, change b" files: b e
+ | |
+ o | 1 "1: add c" files: c
+ |/
+ o 0 "0: add a b" files: a b
+
+Convert from merge parent
+
+ $ hg convert --config convert.hg.startrev=1 source conv1
+ initializing destination conv1 repository
+ scanning source...
+ sorting...
+ converting...
+ 3 1: add c
+ 2 2: copy e from a, change b
+ 1 4: merge 2 and 3, copy d from b
+ 0 5: change a
+
+ $ glog conv1
+ o 3 "5: change a" files: a
+ |
+ o 2 "4: merge 2 and 3, copy d from b" files: a d e
+ |
+ o 1 "2: copy e from a, change b" files: b e
+ |
+ o 0 "1: add c" files: a b c
+
+ $ cd conv1
+
+Check copy preservation
+
+ $ hg log --follow --copies e
+ changeset: 2:d67b1d48a835
+ user: test
+ date: Thu Jan 01 00:00:04 1970 +0000
+ summary: 4: merge 2 and 3, copy d from b
+
+ changeset: 1:462c431cf47d
+ user: test
+ date: Thu Jan 01 00:00:02 1970 +0000
+ summary: 2: copy e from a, change b
+
+Check copy removal on missing parent
+
+ $ hg log --follow --copies d
+ changeset: 2:d67b1d48a835
+ user: test
+ date: Thu Jan 01 00:00:04 1970 +0000
+ summary: 4: merge 2 and 3, copy d from b
+
+ $ hg cat -r tip a b
+ a
+ a
+ a
+ b
+ b
+ $ hg -q verify
+ $ cd ..
+
+Convert from merge
+
+ $ hg convert --config convert.hg.startrev=4 source conv4
+ initializing destination conv4 repository
+ scanning source...
+ sorting...
+ converting...
+ 1 4: merge 2 and 3, copy d from b
+ 0 5: change a
+ $ glog conv4
+ o 1 "5: change a" files: a
+ |
+ o 0 "4: merge 2 and 3, copy d from b" files: a b c d e
+
+ $ cd conv4
+ $ hg up -C
+ 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg cat -r tip a b
+ a
+ a
+ a
+ b
+ b
+ $ hg -q verify
+ $ cd ..
--- a/tests/test-convert.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-convert.out Sat Sep 11 00:40:19 2010 +0200
@@ -24,7 +24,7 @@
understood by the source).
If no destination directory name is specified, it defaults to the basename
- of the source with '-hg' appended. If the destination repository doesn't
+ of the source with "-hg" appended. If the destination repository doesn't
exist, it will be created.
By default, all sources except Mercurial will use --branchsort. Mercurial
@@ -48,13 +48,17 @@
<source ID> <destination ID>
If the file doesn't exist, it's automatically created. It's updated on
- each commit copied, so convert-repo can be interrupted and can be run
+ each commit copied, so "hg convert" can be interrupted and can be run
repeatedly to copy new commits.
- The [username mapping] file is a simple text file that maps each source
- commit author to a destination commit author. It is handy for source SCMs
- that use unix logins to identify authors (eg: CVS). One line per author
- mapping and the line format is: srcauthor=whatever string you want
+ The authormap is a simple text file that maps each source commit author to
+ a destination commit author. It is handy for source SCMs that use unix
+ logins to identify authors (eg: CVS). One line per author mapping and the
+ line format is:
+
+ source author = destination author
+
+ Empty lines and lines starting with a "#" are ignored.
The filemap is a file that allows filtering and remapping of files and
directories. Each line can contain one of the following directives:
@@ -65,40 +69,48 @@
rename path/to/source path/to/destination
- Comment lines start with '#'. A specified path matches if it equals the
+ Comment lines start with "#". A specified path matches if it equals the
full relative name of a file or one of its parent directories. The
- 'include' or 'exclude' directive with the longest matching path applies,
+ "include" or "exclude" directive with the longest matching path applies,
so line order does not matter.
- The 'include' directive causes a file, or all files under a directory, to
+ The "include" directive causes a file, or all files under a directory, to
be included in the destination repository, and the exclusion of all other
- files and directories not explicitly included. The 'exclude' directive
- causes files or directories to be omitted. The 'rename' directive renames
+ files and directories not explicitly included. The "exclude" directive
+ causes files or directories to be omitted. The "rename" directive renames
a file or directory if it is converted. To rename from a subdirectory into
- the root of the repository, use '.' as the path to rename to.
+ the root of the repository, use "." as the path to rename to.
The splicemap is a file that allows insertion of synthetic history,
letting you specify the parents of a revision. This is useful if you want
to e.g. give a Subversion merge two parents, or graft two disconnected
series of history together. Each entry contains a key, followed by a
- space, followed by one or two comma-separated values. The key is the
- revision ID in the source revision control system whose parents should be
- modified (same format as a key in .hg/shamap). The values are the revision
- IDs (in either the source or destination revision control system) that
- should be used as the new parents for that node. For example, if you have
- merged "release-1.0" into "trunk", then you should specify the revision on
- "trunk" as the first parent and the one on the "release-1.0" branch as the
- second.
+ space, followed by one or two comma-separated values:
+
+ key parent1, parent2
+
+ The key is the revision ID in the source revision control system whose
+ parents should be modified (same format as a key in .hg/shamap). The
+ values are the revision IDs (in either the source or destination revision
+ control system) that should be used as the new parents for that node. For
+ example, if you have merged "release-1.0" into "trunk", then you should
+ specify the revision on "trunk" as the first parent and the one on the
+ "release-1.0" branch as the second.
The branchmap is a file that allows you to rename a branch when it is
being brought in from whatever external repository. When used in
conjunction with a splicemap, it allows for a powerful combination to help
fix even the most badly mismanaged repositories and turn them into nicely
structured Mercurial repositories. The branchmap contains lines of the
- form "original_branch_name new_branch_name". "original_branch_name" is the
- name of the branch in the source repository, and "new_branch_name" is the
- name of the branch is the destination repository. This can be used to (for
- instance) move code in one repository from "default" to a named branch.
+ form:
+
+ original_branch_name new_branch_name
+
+ where "original_branch_name" is the name of the branch in the source
+ repository, and "new_branch_name" is the name of the branch is the
+ destination repository. No whitespace is allowed in the branch names. This
+ can be used to (for instance) move code in one repository from "default"
+ to a named branch.
Mercurial Source
----------------
@@ -224,11 +236,11 @@
options:
- -A --authors FILE username mapping filename
+ -s --source-type TYPE source repository type
-d --dest-type TYPE destination repository type
+ -r --rev REV import up to target revision REV
+ -A --authormap FILE remap usernames using this file
--filemap FILE remap file names using contents of file
- -r --rev REV import up to target revision REV
- -s --source-type TYPE source repository type
--splicemap FILE splice synthesized history into place
--branchmap FILE change branch names while converting
--branchsort try to sort changesets by branches
--- a/tests/test-copy-move-merge.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-copy-move-merge.t Sat Sep 11 00:40:19 2010 +0200
@@ -3,14 +3,14 @@
$ hg init
$ echo 1 > a
- $ hg ci -qAm "first" -d "1000000 0"
+ $ hg ci -qAm "first"
$ hg cp a b
$ hg mv a c
$ echo 2 >> b
$ echo 2 >> c
- $ hg ci -qAm "second" -d "1000000 0"
+ $ hg ci -qAm "second"
$ hg co -C 0
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
@@ -18,7 +18,7 @@
$ echo 0 > a
$ echo 1 >> a
- $ hg ci -qAm "other" -d "1000000 0"
+ $ hg ci -qAm "other"
$ hg merge --debug
searching for copies back to rev 1
@@ -31,7 +31,7 @@
checking for directory renames
resolving manifests
overwrite None partial False
- ancestor 583c7b748052 local fb3948d97f07+ remote 7f1309517659
+ ancestor b8bf91eeebbc local add3f11052fa+ remote 17c05bb7fcb6
a: remote moved to c -> m
a: remote moved to b -> m
preserving a for resolve of b
@@ -40,12 +40,12 @@
updating: a 1/2 files (50.00%)
picked tool 'internal:merge' for b (binary False symlink False)
merging a and b to b
- my b@fb3948d97f07+ other b@7f1309517659 ancestor a@583c7b748052
+ my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
premerge successful
updating: a 2/2 files (100.00%)
picked tool 'internal:merge' for c (binary False symlink False)
merging a and c to c
- my c@fb3948d97f07+ other c@7f1309517659 ancestor a@583c7b748052
+ my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
premerge successful
0 files updated, 2 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
--- a/tests/test-copy.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-copy.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,37 +1,37 @@
$ hg init
$ echo a > a
$ hg add a
- $ hg commit -m "1" -d "1000000 0"
+ $ hg commit -m "1"
$ hg status
$ hg copy a b
$ hg status
A b
$ hg sum
- parent: 0:33aaa84a386b tip
+ parent: 0:c19d34741b0a tip
1
branch: default
commit: 1 copied
update: (current)
- $ hg --debug commit -m "2" -d "1000000 0"
+ $ hg --debug commit -m "2"
b
b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
- committed changeset 1:76973b01f66a012648546c979ea4c41de9e7d8cd
+ committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
we should see two history entries
$ hg history -v
- changeset: 1:76973b01f66a
+ changeset: 1:93580a2c28a5
tag: tip
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: b
description:
2
- changeset: 0:33aaa84a386b
+ changeset: 0:c19d34741b0a
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
files: a
description:
1
@@ -41,9 +41,9 @@
we should see one log entry for a
$ hg log a
- changeset: 0:33aaa84a386b
+ changeset: 0:c19d34741b0a
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 1
@@ -56,10 +56,10 @@
we should see one log entry for b
$ hg log b
- changeset: 1:76973b01f66a
+ changeset: 1:93580a2c28a5
tag: tip
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
--- a/tests/test-custom-filters Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-hg init
-
-cat > .hg/hgrc <<EOF
-[extensions]
-prefixfilter = prefix.py
-[encode]
-*.txt = stripprefix: Copyright 2046, The Masters
-[decode]
-*.txt = insertprefix: Copyright 2046, The Masters
-EOF
-
-cat > prefix.py <<EOF
-from mercurial import util
-def stripprefix(s, cmd, filename, **kwargs):
- header = '%s\n' % cmd
- if s[:len(header)] != header:
- raise util.Abort('missing header "%s" in %s' % (cmd, filename))
- return s[len(header):]
-def insertprefix(s, cmd):
- return '%s\n%s' % (cmd, s)
-def reposetup(ui, repo):
- repo.adddatafilter('stripprefix:', stripprefix)
- repo.adddatafilter('insertprefix:', insertprefix)
-EOF
-
-cat > .hgignore <<EOF
-.hgignore
-prefix.py
-prefix.pyc
-EOF
-
-cat > stuff.txt <<EOF
-Copyright 2046, The Masters
-Some stuff to ponder very carefully.
-EOF
-hg add stuff.txt
-hg ci -m stuff
-
-echo '% Repository data:'
-hg cat stuff.txt
-
-echo '% Fresh checkout:'
-rm stuff.txt
-hg up -C
-cat stuff.txt
-echo >> stuff.txt <<EOF
-Very very carefully.
-EOF
-hg stat
-
-cat > morestuff.txt <<EOF
-Unauthorized material subject to destruction.
-EOF
-
-echo '% Problem encoding:'
-hg add morestuff.txt
-hg ci -m morestuff
-hg stat
--- a/tests/test-custom-filters.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-% Repository data:
-Some stuff to ponder very carefully.
-% Fresh checkout:
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-Copyright 2046, The Masters
-Some stuff to ponder very carefully.
-M stuff.txt
-% Problem encoding:
-abort: missing header "Copyright 2046, The Masters" in morestuff.txt
-M stuff.txt
-A morestuff.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-custom-filters.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,65 @@
+ $ hg init
+
+ $ cat > .hg/hgrc <<EOF
+ > [extensions]
+ > prefixfilter = prefix.py
+ > [encode]
+ > *.txt = stripprefix: Copyright 2046, The Masters
+ > [decode]
+ > *.txt = insertprefix: Copyright 2046, The Masters
+ > EOF
+
+ $ cat > prefix.py <<EOF
+ > from mercurial import util
+ > def stripprefix(s, cmd, filename, **kwargs):
+ > header = '%s\n' % cmd
+ > if s[:len(header)] != header:
+ > raise util.Abort('missing header "%s" in %s' % (cmd, filename))
+ > return s[len(header):]
+ > def insertprefix(s, cmd):
+ > return '%s\n%s' % (cmd, s)
+ > def reposetup(ui, repo):
+ > repo.adddatafilter('stripprefix:', stripprefix)
+ > repo.adddatafilter('insertprefix:', insertprefix)
+ > EOF
+
+ $ cat > .hgignore <<EOF
+ > .hgignore
+ > prefix.py
+ > prefix.pyc
+ > EOF
+
+ $ cat > stuff.txt <<EOF
+ > Copyright 2046, The Masters
+ > Some stuff to ponder very carefully.
+ > EOF
+ $ hg add stuff.txt
+ $ hg ci -m stuff
+
+Repository data:
+
+ $ hg cat stuff.txt
+ Some stuff to ponder very carefully.
+
+Fresh checkout:
+
+ $ rm stuff.txt
+ $ hg up -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cat stuff.txt
+ Copyright 2046, The Masters
+ Some stuff to ponder very carefully.
+ $ echo "Very very carefully." >> stuff.txt
+ $ hg stat
+ M stuff.txt
+
+ $ echo "Unauthorized material subject to destruction." > morestuff.txt
+
+Problem encoding:
+
+ $ hg add morestuff.txt
+ $ hg ci -m morestuff
+ abort: missing header "Copyright 2046, The Masters" in morestuff.txt
+ $ hg stat
+ M stuff.txt
+ A morestuff.txt
--- a/tests/test-debugcomplete.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-debugcomplete.t Sat Sep 11 00:40:19 2010 +0200
@@ -180,7 +180,7 @@
annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, include, exclude
clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd
commit: addremove, close-branch, include, exclude, message, logfile, date, user
- diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
+ diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude, subrepos
export: output, switch-parent, rev, text, git, nodates
forget: include, exclude
init: ssh, remotecmd
@@ -190,7 +190,7 @@
push: force, rev, branch, new-branch, ssh, remotecmd
remove: after, force, include, exclude
serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
- status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude
+ status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude, subrepos
summary: remote
update: clean, check, date, rev
addremove: similarity, include, exclude, dry-run
--- a/tests/test-diff-binary-file Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-cp $TESTDIR/binfile.bin .
-hg add binfile.bin
-hg ci -m 'add binfile.bin'
-
-echo >> binfile.bin
-hg ci -m 'change binfile.bin'
-
-hg revert -r 0 binfile.bin
-hg ci -m 'revert binfile.bin'
-
-echo % diff -r 0 -r 1
-hg diff --nodates -r 0 -r 1
-
-echo % diff -r 0 -r 2
-hg diff --nodates -r 0 -r 2
-
-echo % diff --git -r 0 -r 1
-hg diff --git -r 0 -r 1
-
-echo % diff --git -r 0 -r 2
-hg diff --git -r 0 -r 2
--- a/tests/test-diff-binary-file.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-% diff -r 0 -r 1
-diff -r 48b371597640 -r acea2ab458c8 binfile.bin
-Binary file binfile.bin has changed
-% diff -r 0 -r 2
-% diff --git -r 0 -r 1
-diff --git a/binfile.bin b/binfile.bin
-index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356
-GIT binary patch
-literal 594
-zc$@)J0<HatP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
-z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
-zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
-z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
-zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
-ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
-zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
-z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
-zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
-z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
-zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
-gQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf3JwksH2?qr
-
-% diff --git -r 0 -r 2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-binary-file.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,39 @@
+ $ hg init a
+ $ cd a
+ $ cp $TESTDIR/binfile.bin .
+ $ hg add binfile.bin
+ $ hg ci -m 'add binfile.bin'
+
+ $ echo >> binfile.bin
+ $ hg ci -m 'change binfile.bin'
+
+ $ hg revert -r 0 binfile.bin
+ $ hg ci -m 'revert binfile.bin'
+
+ $ hg diff --nodates -r 0 -r 1
+ diff -r 48b371597640 -r acea2ab458c8 binfile.bin
+ Binary file binfile.bin has changed
+
+ $ hg diff --nodates -r 0 -r 2
+
+ $ hg diff --git -r 0 -r 1
+ diff --git a/binfile.bin b/binfile.bin
+ index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356
+ GIT binary patch
+ literal 594
+ zc$@)J0<HatP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
+ z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
+ zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
+ z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
+ zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
+ ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
+ zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
+ z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
+ zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
+ z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
+ zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
+ gQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf3JwksH2?qr
+
+
+ $ hg diff --git -r 0 -r 2
+
--- a/tests/test-diff-change Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#!/bin/sh -e
-
-# test of hg diff --change
-
-set -e
-
-ec() {
- echo "invoking $@:"
- "$@"
-}
-
-hg init a
-cd a
-
-echo "first" > file.txt
-hg add file.txt
-hg commit -m 'first commit' # 0
-
-echo "second" > file.txt
-hg commit -m 'second commit' # 1
-
-echo "third" > file.txt
-hg commit -m 'third commit' # 2
-
-ec hg diff --nodates --change 1
-
-echo
-
-#rev=$(hg log -r 1 --template '{node|short}')
-rev=e9b286083166
-ec hg diff --nodates --change "$rev"
-
-##
-# Testing diff -c when merge
-
-for i in 1 2 3 4 5 6 7 8 9 10; do
- echo $i >> file.txt
-done
-hg commit -m "lots of text" # 3
-
-sed -e 's,^2$,x,' file.txt > file.txt.tmp
-mv file.txt.tmp file.txt
-hg commit -m "changed 2 to x" # 4
-
-hg up -r 3 > /dev/null 2>&1 # updated, merged, removed, unresolved
-sed -e 's,^8$,y,' file.txt > file.txt.tmp
-mv file.txt.tmp file.txt
-hg commit -m "change 8 to y" > /dev/null 2>&1 # 5 # created new head
-
-hg up -C -r 4 > /dev/null 2>&1 # updated, merged, removed, unresolved
-hg merge -r 5 > /dev/null 2>&1 # updated, merged, removed, unresolved
-hg commit -m "merging 8 to y" # 6
-
-echo
-ec hg diff --nodates --change 6 # must be similar to hg diff --nodates --change 5
-
-#echo
-#hg log
-
-echo
-echo "EOF"
-
-# vim: set ts=4 sw=4 et:
--- a/tests/test-diff-change.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-invoking hg diff --nodates --change 1:
-diff -r 4bb65dda5db4 -r e9b286083166 file.txt
---- a/file.txt
-+++ b/file.txt
-@@ -1,1 +1,1 @@
--first
-+second
-
-invoking hg diff --nodates --change e9b286083166:
-diff -r 4bb65dda5db4 -r e9b286083166 file.txt
---- a/file.txt
-+++ b/file.txt
-@@ -1,1 +1,1 @@
--first
-+second
-
-invoking hg diff --nodates --change 6:
-diff -r e8a0797e73a6 -r aa9873050139 file.txt
---- a/file.txt
-+++ b/file.txt
-@@ -6,6 +6,6 @@
- 5
- 6
- 7
--8
-+y
- 9
- 10
-
-EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-change.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,86 @@
+Testing diff --change
+
+ $ hg init a
+ $ cd a
+
+ $ echo "first" > file.txt
+ $ hg add file.txt
+ $ hg commit -m 'first commit' # 0
+
+ $ echo "second" > file.txt
+ $ hg commit -m 'second commit' # 1
+
+ $ echo "third" > file.txt
+ $ hg commit -m 'third commit' # 2
+
+ $ hg diff --nodates --change 1
+ diff -r 4bb65dda5db4 -r e9b286083166 file.txt
+ --- a/file.txt
+ +++ b/file.txt
+ @@ -1,1 +1,1 @@
+ -first
+ +second
+
+ $ hg diff --change e9b286083166
+ diff -r 4bb65dda5db4 -r e9b286083166 file.txt
+ --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +1,1 @@
+ -first
+ +second
+
+
+Testing diff --change when merge:
+
+ $ for i in 1 2 3 4 5 6 7 8 9 10; do
+ $ echo $i >> file.txt
+ $ done
+ $ hg commit -m "lots of text" # 3
+
+ $ sed -e 's,^2$,x,' file.txt > file.txt.tmp
+ $ mv file.txt.tmp file.txt
+ $ hg commit -m "change 2 to x" # 4
+
+ $ hg up -r 3
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ sed -e 's,^8$,y,' file.txt > file.txt.tmp
+ $ mv file.txt.tmp file.txt
+ $ hg commit -m "change 8 to y"
+ created new head
+
+ $ hg up -C -r 4
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg merge -r 5
+ merging file.txt
+ 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg commit -m "merge 8 to y" # 6
+
+ $ hg diff --change 5
+ diff -r ae119d680c82 -r 9085c5c02e52 file.txt
+ --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
+ @@ -6,6 +6,6 @@
+ 5
+ 6
+ 7
+ -8
+ +y
+ 9
+ 10
+
+must be similar to 'hg diff --change 5':
+
+ $ hg diff -c 6
+ diff -r 273b50f17c6d -r 979ca961fd2e file.txt
+ --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
+ @@ -6,6 +6,6 @@
+ 5
+ 6
+ 7
+ -8
+ +y
+ 9
+ 10
+
--- a/tests/test-diff-copy-depth Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-for i in aaa zzz; do
- hg init t
- cd t
-
- echo "-- With $i"
-
- touch file
- hg add file
- hg ci -m "Add"
-
- hg cp file $i
- hg ci -m "a -> $i"
-
- hg cp $i other-file
- echo "different" >> $i
- hg ci -m "$i -> other-file"
-
- hg cp other-file somename
-
- echo "Status":
- hg st -C
- echo
- echo "Diff:"
- hg diff -g
- echo
-
- cd ..
- rm -rf t
-done
--- a/tests/test-diff-copy-depth.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
--- With aaa
-Status:
-A somename
- other-file
-
-Diff:
-diff --git a/other-file b/somename
-copy from other-file
-copy to somename
-
--- With zzz
-Status:
-A somename
- other-file
-
-Diff:
-diff --git a/other-file b/somename
-copy from other-file
-copy to somename
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-copy-depth.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,51 @@
+ $ for i in aaa zzz; do
+ > hg init t
+ > cd t
+ >
+ > echo
+ > echo "-- With $i"
+ >
+ > touch file
+ > hg add file
+ > hg ci -m "Add"
+ >
+ > hg cp file $i
+ > hg ci -m "a -> $i"
+ >
+ > hg cp $i other-file
+ > echo "different" >> $i
+ > hg ci -m "$i -> other-file"
+ >
+ > hg cp other-file somename
+ >
+ > echo "Status":
+ > hg st -C
+ > echo
+ > echo "Diff:"
+ > hg diff -g
+ >
+ > cd ..
+ > rm -rf t
+ > done
+
+ -- With aaa
+ Status:
+ A somename
+ other-file
+
+ Diff:
+ diff --git a/other-file b/somename
+ copy from other-file
+ copy to somename
+
+ -- With zzz
+ Status:
+ A somename
+ other-file
+
+ Diff:
+ diff --git a/other-file b/somename
+ copy from other-file
+ copy to somename
+
+
--- a/tests/test-diff-hashes Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-hg diff not found
-echo bar > foo
-hg add foo
-hg ci -m 'add foo' -d '1000000 0'
-
-echo foobar > foo
-hg ci -m 'change foo' -d '1000001 0'
-
-echo 'quiet:'
-hg --quiet diff -r 0 -r 1
-echo
-
-echo 'normal:'
-hg diff -r 0 -r 1
-echo
-
-echo 'verbose:'
-hg --verbose diff -r 0 -r 1
-echo
-
-echo 'debug:'
-hg --debug diff -r 0 -r 1
-echo
--- a/tests/test-diff-hashes.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-found: No such file or directory
-not: No such file or directory
-quiet:
---- a/foo Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
-normal:
-diff -r 74de3f1392e2 -r b8b5f023a6ad foo
---- a/foo Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
-verbose:
-diff -r 74de3f1392e2 -r b8b5f023a6ad foo
---- a/foo Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
-debug:
-diff -r 74de3f1392e2d67856fb155963441f2610494e1a -r b8b5f023a6ad77fc378bd95cf3fa00cd1414d107 foo
---- a/foo Mon Jan 12 13:46:40 1970 +0000
-+++ b/foo Mon Jan 12 13:46:41 1970 +0000
-@@ -1,1 +1,1 @@
--bar
-+foobar
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-hashes.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,45 @@
+ $ hg init a
+ $ cd a
+
+ $ hg diff inexistent1 inexistent2
+ inexistent1: No such file or directory
+ inexistent2: No such file or directory
+
+ $ echo bar > foo
+ $ hg add foo
+ $ hg ci -m 'add foo'
+
+ $ echo foobar > foo
+ $ hg ci -m 'change foo'
+
+ $ hg --quiet diff -r 0 -r 1
+ --- a/foo Thu Jan 01 00:00:00 1970 +0000
+ +++ b/foo Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +1,1 @@
+ -bar
+ +foobar
+
+ $ hg diff -r 0 -r 1
+ diff -r a99fb63adac3 -r 9b8568d3af2f foo
+ --- a/foo Thu Jan 01 00:00:00 1970 +0000
+ +++ b/foo Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +1,1 @@
+ -bar
+ +foobar
+
+ $ hg --verbose diff -r 0 -r 1
+ diff -r a99fb63adac3 -r 9b8568d3af2f foo
+ --- a/foo Thu Jan 01 00:00:00 1970 +0000
+ +++ b/foo Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +1,1 @@
+ -bar
+ +foobar
+
+ $ hg --debug diff -r 0 -r 1
+ diff -r a99fb63adac3f31816a22f665bc3b7a7655b30f4 -r 9b8568d3af2f1749445eef03aede868a6f39f210 foo
+ --- a/foo Thu Jan 01 00:00:00 1970 +0000
+ +++ b/foo Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +1,1 @@
+ -bar
+ +foobar
+
--- a/tests/test-diff-ignore-whitespace Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-#!/bin/sh
-
-# GNU diff is the reference for all of these results.
-
-hgdiff() {
- echo hg diff $@
- hg diff --nodates "$@"
-}
-
-test_added_blank_lines() {
- printf '\nhello world\n\ngoodbye world\n\n' >foo
-
- echo '>>> two diffs showing three added lines <<<'
- hgdiff
- hgdiff -b
-
- echo '>>> no diffs <<<'
- hgdiff -B
- hgdiff -Bb
-}
-
-test_added_horizontal_space_first_on_a_line() {
- printf '\t hello world\ngoodbye world\n' >foo
-
- echo '>>> four diffs showing added space first on the first line <<<'
- hgdiff
- hgdiff -b
- hgdiff -B
- hgdiff -Bb
-}
-
-test_added_horizontal_space_last_on_a_line() {
- printf 'hello world\t \ngoodbye world\n' >foo
-
- echo '>>> two diffs showing space appended to the first line <<<'
- hgdiff
- hgdiff -B
-
- echo '>>> no diffs <<<'
- hgdiff -b
- hgdiff -Bb
-}
-
-test_added_horizontal_space_in_the_middle_of_a_word() {
- printf 'hello world\ngood bye world\n' >foo
-
- echo '>>> four diffs showing space inserted into "goodbye" <<<'
- hgdiff
- hgdiff -B
- hgdiff -b
- hgdiff -Bb
-}
-
-test_increased_horizontal_whitespace_amount() {
- printf 'hello world\ngoodbye\t\t \tworld\n' >foo
-
- echo '>>> two diffs showing changed whitespace amount in the last line <<<'
- hgdiff
- hgdiff -B
-
- echo '>>> no diffs <<<'
- hgdiff -b
- hgdiff -Bb
-}
-
-test_added_blank_line_with_horizontal_whitespace() {
- printf 'hello world\n \t\ngoodbye world\n' >foo
-
- echo '>>> four diffs showing added blank line w/horizontal space <<<'
- hgdiff
- hgdiff -B
- hgdiff -b
- hgdiff -Bb
-}
-
-test_added_blank_line_with_other_whitespace() {
- printf 'hello world\n \t\ngoodbye world \n' >foo
-
- echo '>>> three diffs showing added blank line w/other space <<<'
- hgdiff
- hgdiff -B
- hgdiff -b
- hgdiff -Bb
-}
-
-test_whitespace_changes() {
- printf 'helloworld\ngoodbye\tworld \n' >foo
-
- echo '>>> four diffs showing changed whitespace <<<'
- hgdiff
- hgdiff -B
- hgdiff -b
- hgdiff -Bb
- hgdiff -w
-}
-
-test_whitespace_changes_and_blank_lines() {
- printf 'helloworld\n\n\n\ngoodbye\tworld \n' >foo
-
- echo '>>> five diffs showing changed whitespace <<<'
- hgdiff
- hgdiff -B
- hgdiff -b
- hgdiff -Bb
- hgdiff -w
- hgdiff -wB
-}
-
-hg init
-printf 'hello world\ngoodbye world\n' >foo
-hg ci -Amfoo -ufoo
-
-test_added_blank_lines
-test_added_horizontal_space_first_on_a_line
-test_added_horizontal_space_last_on_a_line
-test_added_horizontal_space_in_the_middle_of_a_word
-test_increased_horizontal_whitespace_amount
-test_added_blank_line_with_horizontal_whitespace
-test_added_blank_line_with_other_whitespace
-test_whitespace_changes
-test_whitespace_changes_and_blank_lines
--- a/tests/test-diff-ignore-whitespace.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +0,0 @@
-adding foo
->>> two diffs showing three added lines <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
-+
- hello world
-+
- goodbye world
-+
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
-+
- hello world
-+
- goodbye world
-+
->>> no diffs <<<
-hg diff -B
-hg diff -Bb
->>> four diffs showing added space first on the first line <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+ hello world
- goodbye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+ hello world
- goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+ hello world
- goodbye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+ hello world
- goodbye world
->>> two diffs showing space appended to the first line <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+hello world
- goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+hello world
- goodbye world
->>> no diffs <<<
-hg diff -b
-hg diff -Bb
->>> four diffs showing space inserted into "goodbye" <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+good bye world
->>> two diffs showing changed whitespace amount in the last line <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
- hello world
--goodbye world
-+goodbye world
->>> no diffs <<<
-hg diff -b
-hg diff -Bb
->>> four diffs showing added blank line w/horizontal space <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+
- goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+
- goodbye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+
- goodbye world
-hg diff -Bb
->>> three diffs showing added blank line w/other space <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
--hello world
--goodbye world
-+hello world
-+
-+goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
--hello world
--goodbye world
-+hello world
-+
-+goodbye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,3 @@
- hello world
-+
- goodbye world
-hg diff -Bb
->>> four diffs showing changed whitespace <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
--goodbye world
-+helloworld
-+goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
--goodbye world
-+helloworld
-+goodbye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+helloworld
- goodbye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,2 @@
--hello world
-+helloworld
- goodbye world
-hg diff -w
->>> five diffs showing changed whitespace <<<
-hg diff
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
--goodbye world
-+helloworld
-+
-+
-+
-+goodbye world
-hg diff -B
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
--goodbye world
-+helloworld
-+
-+
-+
-+goodbye world
-hg diff -b
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
-+helloworld
-+
-+
-+
- goodbye world
-hg diff -Bb
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
--hello world
-+helloworld
-+
-+
-+
- goodbye world
-hg diff -w
-diff -r 540c40a65b78 foo
---- a/foo
-+++ b/foo
-@@ -1,2 +1,5 @@
- hello world
-+
-+
-+
- goodbye world
-hg diff -wB
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-ignore-whitespace.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,392 @@
+GNU diff is the reference for all of these results.
+
+Prepare tests:
+
+ $ echo '[alias]' >> $HGRCPATH
+ $ echo 'ndiff = diff --nodates' >> $HGRCPATH
+
+ $ hg init
+ $ printf 'hello world\ngoodbye world\n' >foo
+ $ hg ci -Amfoo -ufoo
+ adding foo
+
+
+Test added blank lines:
+
+ $ printf '\nhello world\n\ngoodbye world\n\n' >foo
+
+>>> two diffs showing three added lines <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,5 @@
+ +
+ hello world
+ +
+ goodbye world
+ +
+ $ hg ndiff -b
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,5 @@
+ +
+ hello world
+ +
+ goodbye world
+ +
+
+>>> no diffs <<<
+
+ $ hg ndiff -B
+ $ hg ndiff -Bb
+
+
+Test added horizontal space first on a line():
+
+ $ printf '\t hello world\ngoodbye world\n' >foo
+
+>>> four diffs showing added space first on the first line <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ + hello world
+ goodbye world
+
+ $ hg ndiff -b
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ + hello world
+ goodbye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ + hello world
+ goodbye world
+
+ $ hg ndiff -Bb
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ + hello world
+ goodbye world
+
+
+Test added horizontal space last on a line:
+
+ $ printf 'hello world\t \ngoodbye world\n' >foo
+
+>>> two diffs showing space appended to the first line <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ +hello world
+ goodbye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ +hello world
+ goodbye world
+
+>>> no diffs <<<
+
+ $ hg ndiff -b
+ $ hg ndiff -Bb
+
+
+Test added horizontal space in the middle of a word:
+
+ $ printf 'hello world\ngood bye world\n' >foo
+
+>>> four diffs showing space inserted into "goodbye" <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ hello world
+ -goodbye world
+ +good bye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ hello world
+ -goodbye world
+ +good bye world
+
+ $ hg ndiff -b
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ hello world
+ -goodbye world
+ +good bye world
+
+ $ hg ndiff -Bb
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ hello world
+ -goodbye world
+ +good bye world
+
+
+Test increased horizontal whitespace amount:
+
+ $ printf 'hello world\ngoodbye\t\t \tworld\n' >foo
+
+>>> two diffs showing changed whitespace amount in the last line <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ hello world
+ -goodbye world
+ +goodbye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ hello world
+ -goodbye world
+ +goodbye world
+
+>>> no diffs <<<
+
+ $ hg ndiff -b
+ $ hg ndiff -Bb
+
+
+Test added blank line with horizontal whitespace:
+
+ $ printf 'hello world\n \t\ngoodbye world\n' >foo
+
+>>> three diffs showing added blank line with horizontal space <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,3 @@
+ hello world
+ +
+ goodbye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,3 @@
+ hello world
+ +
+ goodbye world
+
+ $ hg ndiff -b
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,3 @@
+ hello world
+ +
+ goodbye world
+
+>>> no diffs <<<
+
+ $ hg ndiff -Bb
+
+
+Test added blank line with other whitespace:
+
+ $ printf 'hello world\n \t\ngoodbye world \n' >foo
+
+>>> three diffs showing added blank line with other space <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,3 @@
+ -hello world
+ -goodbye world
+ +hello world
+ +
+ +goodbye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,3 @@
+ -hello world
+ -goodbye world
+ +hello world
+ +
+ +goodbye world
+
+ $ hg ndiff -b
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,3 @@
+ hello world
+ +
+ goodbye world
+
+>>> no diffs <<<
+
+ $ hg ndiff -Bb
+
+
+Test whitespace changes:
+
+ $ printf 'helloworld\ngoodbye\tworld \n' >foo
+
+>>> four diffs showing changed whitespace <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ -goodbye world
+ +helloworld
+ +goodbye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ -goodbye world
+ +helloworld
+ +goodbye world
+
+ $ hg ndiff -b
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ +helloworld
+ goodbye world
+
+ $ hg ndiff -Bb
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,2 @@
+ -hello world
+ +helloworld
+ goodbye world
+
+>>> no diffs <<<
+
+ $ hg ndiff -w
+
+
+Test whitespace changes and blank lines:
+
+ $ printf 'helloworld\n\n\n\ngoodbye\tworld \n' >foo
+
+>>> five diffs showing changed whitespace <<<
+
+ $ hg ndiff
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,5 @@
+ -hello world
+ -goodbye world
+ +helloworld
+ +
+ +
+ +
+ +goodbye world
+
+ $ hg ndiff -B
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,5 @@
+ -hello world
+ -goodbye world
+ +helloworld
+ +
+ +
+ +
+ +goodbye world
+
+ $ hg ndiff -b
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,5 @@
+ -hello world
+ +helloworld
+ +
+ +
+ +
+ goodbye world
+
+ $ hg ndiff -Bb
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,5 @@
+ -hello world
+ +helloworld
+ +
+ +
+ +
+ goodbye world
+
+ $ hg ndiff -w
+ diff -r 540c40a65b78 foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,2 +1,5 @@
+ hello world
+ +
+ +
+ +
+ goodbye world
+
+>>> no diffs <<<
+
+ $ hg ndiff -wB
+
--- a/tests/test-diff-newlines Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-hg init
-python -c 'print "confuse str.splitlines\nembedded\rnewline"' > a
-hg ci -Ama -d '1 0'
-echo clean diff >> a
-hg ci -mb -d '2 0'
-hg diff -r0 -r1
--- a/tests/test-diff-newlines.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-adding a
-diff -r 107ba6f817b5 -r 310ce7989cdc a
---- a/a Thu Jan 01 00:00:01 1970 +0000
-+++ b/a Thu Jan 01 00:00:02 1970 +0000
-@@ -1,2 +1,3 @@
- confuse str.splitlines
- embedded
newline
-+clean diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-newlines.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,18 @@
+ $ hg init
+
+ $ python -c 'print "confuse str.splitlines\nembedded\rnewline"' > a
+ $ hg ci -Ama -d '1 0'
+ adding a
+
+ $ echo clean diff >> a
+ $ hg ci -mb -d '2 0'
+
+ $ hg diff -r0 -r1
+ diff -r 107ba6f817b5 -r 310ce7989cdc a
+ --- a/a Thu Jan 01 00:00:01 1970 +0000
+ +++ b/a Thu Jan 01 00:00:02 1970 +0000
+ @@ -1,2 +1,3 @@
+ confuse str.splitlines
+ embedded
newline
+ +clean diff
+
--- a/tests/test-diff-reverse Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-hg init
-cat > a <<EOF
-a
-b
-c
-EOF
-hg ci -Am adda
-
-cat > a <<EOF
-d
-e
-f
-EOF
-hg ci -m moda
-
-hg diff --reverse -r0 -r1
-
-cat >> a <<EOF
-g
-h
-EOF
-hg diff --reverse --nodates
--- a/tests/test-diff-reverse.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-adding a
-diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
---- a/a Thu Jan 01 00:00:00 1970 +0000
-+++ b/a Thu Jan 01 00:00:00 1970 +0000
-@@ -1,3 +1,3 @@
--d
--e
--f
-+a
-+b
-+c
-diff -r 2855cdcfcbb7 a
---- a/a
-+++ b/a
-@@ -1,5 +1,3 @@
- d
- e
- f
--g
--h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-reverse.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,44 @@
+ $ hg init
+
+ $ cat > a <<EOF
+ > a
+ > b
+ > c
+ > EOF
+ $ hg ci -Am adda
+ adding a
+
+ $ cat > a <<EOF
+ > d
+ > e
+ > f
+ > EOF
+ $ hg ci -m moda
+
+ $ hg diff --reverse -r0 -r1
+ diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
+ --- a/a Thu Jan 01 00:00:00 1970 +0000
+ +++ b/a Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,3 +1,3 @@
+ -d
+ -e
+ -f
+ +a
+ +b
+ +c
+
+ $ cat >> a <<EOF
+ > g
+ > h
+ > EOF
+ $ hg diff --reverse --nodates
+ diff -r 2855cdcfcbb7 a
+ --- a/a
+ +++ b/a
+ @@ -1,5 +1,3 @@
+ d
+ e
+ f
+ -g
+ -h
+
--- a/tests/test-diff-subdir Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-hg init
-
-mkdir alpha
-touch alpha/one
-mkdir beta
-touch beta/two
-
-hg add alpha/one beta/two
-hg ci -m "start" -d "1000000 0"
-
-echo 1 > alpha/one
-echo 2 > beta/two
-
-echo EVERYTHING
-hg diff --nodates
-
-echo BETA ONLY
-hg diff --nodates beta
-
-echo INSIDE BETA
-cd beta
-hg diff --nodates .
--- a/tests/test-diff-subdir.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-EVERYTHING
-diff -r ec612a6291f1 alpha/one
---- a/alpha/one
-+++ b/alpha/one
-@@ -0,0 +1,1 @@
-+1
-diff -r ec612a6291f1 beta/two
---- a/beta/two
-+++ b/beta/two
-@@ -0,0 +1,1 @@
-+2
-BETA ONLY
-diff -r ec612a6291f1 beta/two
---- a/beta/two
-+++ b/beta/two
-@@ -0,0 +1,1 @@
-+2
-INSIDE BETA
-diff -r ec612a6291f1 beta/two
---- a/beta/two
-+++ b/beta/two
-@@ -0,0 +1,1 @@
-+2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-subdir.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,46 @@
+ $ hg init
+
+ $ mkdir alpha
+ $ touch alpha/one
+ $ mkdir beta
+ $ touch beta/two
+
+ $ hg add alpha/one beta/two
+ $ hg ci -m "start"
+
+ $ echo 1 > alpha/one
+ $ echo 2 > beta/two
+
+everything
+
+ $ hg diff --nodates
+ diff -r 7d5ef1aea329 alpha/one
+ --- a/alpha/one
+ +++ b/alpha/one
+ @@ -0,0 +1,1 @@
+ +1
+ diff -r 7d5ef1aea329 beta/two
+ --- a/beta/two
+ +++ b/beta/two
+ @@ -0,0 +1,1 @@
+ +2
+
+beta only
+
+ $ hg diff --nodates beta
+ diff -r 7d5ef1aea329 beta/two
+ --- a/beta/two
+ +++ b/beta/two
+ @@ -0,0 +1,1 @@
+ +2
+
+inside beta
+
+ $ cd beta
+ $ hg diff --nodates .
+ diff -r 7d5ef1aea329 beta/two
+ --- a/beta/two
+ +++ b/beta/two
+ @@ -0,0 +1,1 @@
+ +2
+
--- a/tests/test-diff-unified Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-cat > a <<EOF
-c
-c
-a
-a
-b
-a
-a
-c
-c
-EOF
-hg ci -Am adda
-cat > a <<EOF
-c
-c
-a
-a
-dd
-a
-a
-c
-c
-EOF
-
-echo '% default context'
-hg diff --nodates
-
-echo '% invalid --unified'
-hg diff --nodates -U foo
-
-echo '% --unified=2'
-hg diff --nodates -U 2
-
-echo '% diff.unified=2'
-hg --config diff.unified=2 diff --nodates
-
-echo '% diff.unified=2 --unified=1'
-hg diff --nodates -U 1
-
-echo '% invalid diff.unified'
-hg --config diff.unified=foo diff --nodates
-
-echo % test off-by-one error with diff -p
-hg init diffp
-cd diffp
-echo a > a
-hg ci -Ama
-rm a
-echo b > a
-echo a >> a
-echo c >> a
-hg diff -U0 -p --nodates
-
-exit 0
--- a/tests/test-diff-unified.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-adding a
-% default context
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -2,7 +2,7 @@
- c
- a
- a
--b
-+dd
- a
- a
- c
-% invalid --unified
-abort: diff context lines count must be an integer, not 'foo'
-% --unified=2
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -3,5 +3,5 @@
- a
- a
--b
-+dd
- a
- a
-% diff.unified=2
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -3,5 +3,5 @@
- a
- a
--b
-+dd
- a
- a
-% diff.unified=2 --unified=1
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -4,3 +4,3 @@
- a
--b
-+dd
- a
-% invalid diff.unified
-abort: diff context lines count must be an integer, not 'foo'
-% test off-by-one error with diff -p
-adding a
-diff -r cb9a9f314b8b a
---- a/a
-+++ b/a
-@@ -1,0 +1,1 @@
-+b
-@@ -2,0 +3,1 @@ a
-+c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-unified.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,109 @@
+ $ hg init repo
+ $ cd repo
+ $ cat > a <<EOF
+ > c
+ > c
+ > a
+ > a
+ > b
+ > a
+ > a
+ > c
+ > c
+ > EOF
+ $ hg ci -Am adda
+ adding a
+
+ $ cat > a <<EOF
+ > c
+ > c
+ > a
+ > a
+ > dd
+ > a
+ > a
+ > c
+ > c
+ > EOF
+
+default context
+
+ $ hg diff --nodates
+ diff -r cf9f4ba66af2 a
+ --- a/a
+ +++ b/a
+ @@ -2,7 +2,7 @@
+ c
+ a
+ a
+ -b
+ +dd
+ a
+ a
+ c
+
+invalid --unified
+
+ $ hg diff --nodates -U foo
+ abort: diff context lines count must be an integer, not 'foo'
+
+
+ $ hg diff --nodates -U 2
+ diff -r cf9f4ba66af2 a
+ --- a/a
+ +++ b/a
+ @@ -3,5 +3,5 @@
+ a
+ a
+ -b
+ +dd
+ a
+ a
+
+ $ hg --config diff.unified=2 diff --nodates
+ diff -r cf9f4ba66af2 a
+ --- a/a
+ +++ b/a
+ @@ -3,5 +3,5 @@
+ a
+ a
+ -b
+ +dd
+ a
+ a
+
+ $ hg diff --nodates -U 1
+ diff -r cf9f4ba66af2 a
+ --- a/a
+ +++ b/a
+ @@ -4,3 +4,3 @@
+ a
+ -b
+ +dd
+ a
+
+invalid diff.unified
+
+ $ hg --config diff.unified=foo diff --nodates
+ abort: diff context lines count must be an integer, not 'foo'
+
+test off-by-one error with diff -p
+
+ $ hg init diffp
+ $ cd diffp
+ $ echo a > a
+ $ hg ci -Ama
+ adding a
+ $ rm a
+ $ echo b > a
+ $ echo a >> a
+ $ echo c >> a
+ $ hg diff -U0 -p --nodates
+ diff -r cb9a9f314b8b a
+ --- a/a
+ +++ b/a
+ @@ -1,0 +1,1 @@
+ +b
+ @@ -2,0 +3,1 @@ a
+ +c
+
--- a/tests/test-diff-upgrade Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "nodates=1" >> $HGRCPATH
-
-hg init repo
-cd repo
-echo '% make a combination of new, changed and deleted file'
-echo regular > regular
-echo rmregular > rmregular
-touch rmempty
-echo exec > exec
-chmod +x exec
-echo rmexec > rmexec
-chmod +x rmexec
-echo setexec > setexec
-echo unsetexec > unsetexec
-chmod +x unsetexec
-echo binary > binary
-python -c "file('rmbinary', 'wb').write('\0')"
-hg ci -Am addfiles
-echo regular >> regular
-echo newregular >> newregular
-rm rmempty
-touch newempty
-rm rmregular
-echo exec >> exec
-echo newexec > newexec
-chmod +x newexec
-rm rmexec
-chmod +x setexec
-chmod -x unsetexec
-python -c "file('binary', 'wb').write('\0\0')"
-python -c "file('newbinary', 'wb').write('\0')"
-rm rmbinary
-hg addremove -s 0
-
-echo '% git=no: regular diff for all files'
-hg autodiff --git=no
-
-echo '% git=no: git diff for single regular file'
-hg autodiff --git=yes regular
-
-echo '% git=auto: regular diff for regular files and removals'
-hg autodiff --git=auto regular newregular rmregular rmbinary rmexec
-
-for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do
- echo '% git=auto: git diff for' $f
- hg autodiff --git=auto $f
-done
-
-echo '% git=warn: regular diff with data loss warnings'
-hg autodiff --git=warn
-
-echo '% git=abort: fail on execute bit change'
-hg autodiff --git=abort regular setexec
-
-echo '% git=abort: succeed on regular file'
-hg autodiff --git=abort regular
-
-cd ..
--- a/tests/test-diff-upgrade.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-% make a combination of new, changed and deleted file
-adding binary
-adding exec
-adding regular
-adding rmbinary
-adding rmempty
-adding rmexec
-adding rmregular
-adding setexec
-adding unsetexec
-adding newbinary
-adding newempty
-adding newexec
-adding newregular
-removing rmbinary
-removing rmempty
-removing rmexec
-removing rmregular
-% git=no: regular diff for all files
-diff -r b3f053cd7c7f binary
-Binary file binary has changed
-diff -r b3f053cd7c7f exec
---- a/exec
-+++ b/exec
-@@ -1,1 +1,2 @@
- exec
-+exec
-diff -r b3f053cd7c7f newbinary
-Binary file newbinary has changed
-diff -r b3f053cd7c7f newexec
---- /dev/null
-+++ b/newexec
-@@ -0,0 +1,1 @@
-+newexec
-diff -r b3f053cd7c7f newregular
---- /dev/null
-+++ b/newregular
-@@ -0,0 +1,1 @@
-+newregular
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-diff -r b3f053cd7c7f rmbinary
-Binary file rmbinary has changed
-diff -r b3f053cd7c7f rmexec
---- a/rmexec
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmexec
-diff -r b3f053cd7c7f rmregular
---- a/rmregular
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmregular
-% git=no: git diff for single regular file
-diff --git a/regular b/regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-% git=auto: regular diff for regular files and removals
-diff -r b3f053cd7c7f newregular
---- /dev/null
-+++ b/newregular
-@@ -0,0 +1,1 @@
-+newregular
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-diff -r b3f053cd7c7f rmbinary
-Binary file rmbinary has changed
-diff -r b3f053cd7c7f rmexec
---- a/rmexec
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmexec
-diff -r b3f053cd7c7f rmregular
---- a/rmregular
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmregular
-% git=auto: git diff for exec
-diff -r b3f053cd7c7f exec
---- a/exec
-+++ b/exec
-@@ -1,1 +1,2 @@
- exec
-+exec
-% git=auto: git diff for newexec
-diff --git a/newexec b/newexec
-new file mode 100755
---- /dev/null
-+++ b/newexec
-@@ -0,0 +1,1 @@
-+newexec
-% git=auto: git diff for setexec
-diff --git a/setexec b/setexec
-old mode 100644
-new mode 100755
-% git=auto: git diff for unsetexec
-diff --git a/unsetexec b/unsetexec
-old mode 100755
-new mode 100644
-% git=auto: git diff for binary
-diff --git a/binary b/binary
-index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
-GIT binary patch
-literal 2
-Jc${Nk0000200961
-
-% git=auto: git diff for newbinary
-diff --git a/newbinary b/newbinary
-new file mode 100644
-index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
-GIT binary patch
-literal 1
-Ic${MZ000310RR91
-
-% git=auto: git diff for newempty
-diff --git a/newempty b/newempty
-new file mode 100644
-% git=auto: git diff for rmempty
-diff --git a/rmempty b/rmempty
-deleted file mode 100644
-% git=warn: regular diff with data loss warnings
-diff -r b3f053cd7c7f binary
-Binary file binary has changed
-diff -r b3f053cd7c7f exec
---- a/exec
-+++ b/exec
-@@ -1,1 +1,2 @@
- exec
-+exec
-diff -r b3f053cd7c7f newbinary
-Binary file newbinary has changed
-diff -r b3f053cd7c7f newexec
---- /dev/null
-+++ b/newexec
-@@ -0,0 +1,1 @@
-+newexec
-diff -r b3f053cd7c7f newregular
---- /dev/null
-+++ b/newregular
-@@ -0,0 +1,1 @@
-+newregular
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
-diff -r b3f053cd7c7f rmbinary
-Binary file rmbinary has changed
-diff -r b3f053cd7c7f rmexec
---- a/rmexec
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmexec
-diff -r b3f053cd7c7f rmregular
---- a/rmregular
-+++ /dev/null
-@@ -1,1 +0,0 @@
--rmregular
-data lost for: binary
-data lost for: newbinary
-data lost for: newempty
-data lost for: newexec
-data lost for: rmempty
-data lost for: setexec
-data lost for: unsetexec
-% git=abort: fail on execute bit change
-abort: losing data for setexec
-% git=abort: succeed on regular file
-diff -r b3f053cd7c7f regular
---- a/regular
-+++ b/regular
-@@ -1,1 +1,2 @@
- regular
-+regular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-upgrade.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,259 @@
+
+ $ echo "[extensions]" >> $HGRCPATH
+ $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
+ $ echo "[diff]" >> $HGRCPATH
+ $ echo "nodates=1" >> $HGRCPATH
+
+ $ hg init repo
+ $ cd repo
+
+make a combination of new, changed and deleted file
+
+ $ echo regular > regular
+ $ echo rmregular > rmregular
+ $ touch rmempty
+ $ echo exec > exec
+ $ chmod +x exec
+ $ echo rmexec > rmexec
+ $ chmod +x rmexec
+ $ echo setexec > setexec
+ $ echo unsetexec > unsetexec
+ $ chmod +x unsetexec
+ $ echo binary > binary
+ $ python -c "file('rmbinary', 'wb').write('\0')"
+ $ hg ci -Am addfiles
+ adding binary
+ adding exec
+ adding regular
+ adding rmbinary
+ adding rmempty
+ adding rmexec
+ adding rmregular
+ adding setexec
+ adding unsetexec
+ $ echo regular >> regular
+ $ echo newregular >> newregular
+ $ rm rmempty
+ $ touch newempty
+ $ rm rmregular
+ $ echo exec >> exec
+ $ echo newexec > newexec
+ $ chmod +x newexec
+ $ rm rmexec
+ $ chmod +x setexec
+ $ chmod -x unsetexec
+ $ python -c "file('binary', 'wb').write('\0\0')"
+ $ python -c "file('newbinary', 'wb').write('\0')"
+ $ rm rmbinary
+ $ hg addremove -s 0
+ adding newbinary
+ adding newempty
+ adding newexec
+ adding newregular
+ removing rmbinary
+ removing rmempty
+ removing rmexec
+ removing rmregular
+
+git=no: regular diff for all files
+
+ $ hg autodiff --git=no
+ diff -r b3f053cd7c7f binary
+ Binary file binary has changed
+ diff -r b3f053cd7c7f exec
+ --- a/exec
+ +++ b/exec
+ @@ -1,1 +1,2 @@
+ exec
+ +exec
+ diff -r b3f053cd7c7f newbinary
+ Binary file newbinary has changed
+ diff -r b3f053cd7c7f newexec
+ --- /dev/null
+ +++ b/newexec
+ @@ -0,0 +1,1 @@
+ +newexec
+ diff -r b3f053cd7c7f newregular
+ --- /dev/null
+ +++ b/newregular
+ @@ -0,0 +1,1 @@
+ +newregular
+ diff -r b3f053cd7c7f regular
+ --- a/regular
+ +++ b/regular
+ @@ -1,1 +1,2 @@
+ regular
+ +regular
+ diff -r b3f053cd7c7f rmbinary
+ Binary file rmbinary has changed
+ diff -r b3f053cd7c7f rmexec
+ --- a/rmexec
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -rmexec
+ diff -r b3f053cd7c7f rmregular
+ --- a/rmregular
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -rmregular
+
+git=yes: git diff for single regular file
+
+ $ hg autodiff --git=yes regular
+ diff --git a/regular b/regular
+ --- a/regular
+ +++ b/regular
+ @@ -1,1 +1,2 @@
+ regular
+ +regular
+
+git=auto: regular diff for regular files and removals
+
+ $ hg autodiff --git=auto regular newregular rmregular rmbinary rmexec
+ diff -r b3f053cd7c7f newregular
+ --- /dev/null
+ +++ b/newregular
+ @@ -0,0 +1,1 @@
+ +newregular
+ diff -r b3f053cd7c7f regular
+ --- a/regular
+ +++ b/regular
+ @@ -1,1 +1,2 @@
+ regular
+ +regular
+ diff -r b3f053cd7c7f rmbinary
+ Binary file rmbinary has changed
+ diff -r b3f053cd7c7f rmexec
+ --- a/rmexec
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -rmexec
+ diff -r b3f053cd7c7f rmregular
+ --- a/rmregular
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -rmregular
+
+ $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do
+ > echo
+ > echo '% git=auto: git diff for' $f
+ > hg autodiff --git=auto $f
+ > done
+
+ % git=auto: git diff for exec
+ diff -r b3f053cd7c7f exec
+ --- a/exec
+ +++ b/exec
+ @@ -1,1 +1,2 @@
+ exec
+ +exec
+
+ % git=auto: git diff for newexec
+ diff --git a/newexec b/newexec
+ new file mode 100755
+ --- /dev/null
+ +++ b/newexec
+ @@ -0,0 +1,1 @@
+ +newexec
+
+ % git=auto: git diff for setexec
+ diff --git a/setexec b/setexec
+ old mode 100644
+ new mode 100755
+
+ % git=auto: git diff for unsetexec
+ diff --git a/unsetexec b/unsetexec
+ old mode 100755
+ new mode 100644
+
+ % git=auto: git diff for binary
+ diff --git a/binary b/binary
+ index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
+ GIT binary patch
+ literal 2
+ Jc${Nk0000200961
+
+
+ % git=auto: git diff for newbinary
+ diff --git a/newbinary b/newbinary
+ new file mode 100644
+ index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
+ GIT binary patch
+ literal 1
+ Ic${MZ000310RR91
+
+
+ % git=auto: git diff for newempty
+ diff --git a/newempty b/newempty
+ new file mode 100644
+
+ % git=auto: git diff for rmempty
+ diff --git a/rmempty b/rmempty
+ deleted file mode 100644
+
+git=warn: regular diff with data loss warnings
+
+ $ hg autodiff --git=warn
+ diff -r b3f053cd7c7f binary
+ Binary file binary has changed
+ diff -r b3f053cd7c7f exec
+ --- a/exec
+ +++ b/exec
+ @@ -1,1 +1,2 @@
+ exec
+ +exec
+ diff -r b3f053cd7c7f newbinary
+ Binary file newbinary has changed
+ diff -r b3f053cd7c7f newexec
+ --- /dev/null
+ +++ b/newexec
+ @@ -0,0 +1,1 @@
+ +newexec
+ diff -r b3f053cd7c7f newregular
+ --- /dev/null
+ +++ b/newregular
+ @@ -0,0 +1,1 @@
+ +newregular
+ diff -r b3f053cd7c7f regular
+ --- a/regular
+ +++ b/regular
+ @@ -1,1 +1,2 @@
+ regular
+ +regular
+ diff -r b3f053cd7c7f rmbinary
+ Binary file rmbinary has changed
+ diff -r b3f053cd7c7f rmexec
+ --- a/rmexec
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -rmexec
+ diff -r b3f053cd7c7f rmregular
+ --- a/rmregular
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -rmregular
+ data lost for: binary
+ data lost for: newbinary
+ data lost for: newempty
+ data lost for: newexec
+ data lost for: rmempty
+ data lost for: setexec
+ data lost for: unsetexec
+
+git=abort: fail on execute bit change
+
+ $ hg autodiff --git=abort regular setexec
+ abort: losing data for setexec
+
+git=abort: succeed on regular file
+
+ $ hg autodiff --git=abort regular
+ diff -r b3f053cd7c7f regular
+ --- a/regular
+ +++ b/regular
+ @@ -1,1 +1,2 @@
+ regular
+ +regular
+
+ $ cd ..
+
--- a/tests/test-diffdir.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-diffdir.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,19 +1,19 @@
$ hg init
$ touch a
$ hg add a
- $ hg ci -m "a" -d "1000000 0"
+ $ hg ci -m "a"
$ echo 123 > b
$ hg add b
$ hg diff --nodates
- diff -r acd8075edac9 b
+ diff -r 3903775176ed b
--- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
+123
$ hg diff --nodates -r tip
- diff -r acd8075edac9 b
+ diff -r 3903775176ed b
--- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
@@ -21,12 +21,12 @@
$ echo foo > a
$ hg diff --nodates
- diff -r acd8075edac9 a
+ diff -r 3903775176ed a
--- a/a
+++ b/a
@@ -0,0 +1,1 @@
+foo
- diff -r acd8075edac9 b
+ diff -r 3903775176ed b
--- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
--- a/tests/test-diffstat Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
-hg add a
-
-echo '% wide diffstat'
-hg diff --stat
-
-echo '% diffstat width'
-COLUMNS=24 hg diff --config ui.interactive=true --stat
-
-hg ci -m adda
-
-cat >> a <<EOF
-a
-a
-a
-EOF
-
-echo '% narrow diffstat'
-hg diff --stat
-
-hg ci -m appenda
-
-printf '\0' > b
-hg add b
-
-echo '% binary diffstat'
-hg diff --stat
-
-echo '% binary git diffstat'
-hg diff --stat --git
--- a/tests/test-diffstat.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-% wide diffstat
- a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 213 insertions(+), 0 deletions(-)
-% diffstat width
- a | 213 ++++++++++++++
- 1 files changed, 213 insertions(+), 0 deletions(-)
-% narrow diffstat
- a | 3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-% binary diffstat
- b | 0
- 1 files changed, 0 insertions(+), 0 deletions(-)
-% binary git diffstat
- b | Bin
- 1 files changed, 0 insertions(+), 0 deletions(-)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diffstat.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,48 @@
+ $ hg init repo
+ $ cd repo
+ $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
+ $ hg add a
+
+Wide diffstat:
+
+ $ hg diff --stat
+ a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 213 insertions(+), 0 deletions(-)
+
+diffstat width:
+
+ $ COLUMNS=24 hg diff --config ui.interactive=true --stat
+ a | 213 ++++++++++++++
+ 1 files changed, 213 insertions(+), 0 deletions(-)
+
+ $ hg ci -m adda
+
+ $ cat >> a <<EOF
+ > a
+ > a
+ > a
+ > EOF
+
+Narrow diffstat:
+
+ $ hg diff --stat
+ a | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+ $ hg ci -m appenda
+
+ $ printf '\0' > b
+ $ hg add b
+
+Binary diffstat:
+
+ $ hg diff --stat
+ b | 0
+ 1 files changed, 0 insertions(+), 0 deletions(-)
+
+Binary git diffstat:
+
+ $ hg diff --stat --git
+ b | Bin
+ 1 files changed, 0 insertions(+), 0 deletions(-)
+
--- a/tests/test-dispatch Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#!/bin/sh
-# test command parsing and dispatch
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-dir=`pwd`
-
-hg init a
-cd a
-echo a > a
-hg ci -Ama
-
-echo "# missing arg"
-hg cat
-
-echo '% [defaults]'
-hg cat a
-cat >> $HGRCPATH <<EOF
-[defaults]
-cat = -r null
-EOF
-hg cat a
-
-echo '% no repo'
-cd $dir
-hg cat
-
-exit 0
-
--- a/tests/test-dispatch.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-adding a
-# missing arg
-hg cat: invalid arguments
-hg cat [OPTION]... FILE...
-
-output the current or given revision of files
-
- Print the specified files as they were at the given revision. If no
- revision is given, the parent of the working directory is used, or tip if
- no revision is checked out.
-
- Output may be to a file, in which case the name of the file is given using
- a format string. The formatting rules are the same as for the export
- command, with the following additions:
-
- "%s" basename of file being printed
- "%d" dirname of file being printed, or '.' if in repository root
- "%p" root-relative path name of file being printed
-
- Returns 0 on success.
-
-options:
-
- -o --output FORMAT print output to file with formatted name
- -r --rev REV print the given revision
- --decode apply any matching decode filter
- -I --include PATTERN [+] include names matching the given patterns
- -X --exclude PATTERN [+] exclude names matching the given patterns
-
-[+] marked option can be specified multiple times
-
-use "hg -v help cat" to show global options
-% [defaults]
-a
-a: No such file in rev 000000000000
-% no repo
-abort: There is no Mercurial repository here (.hg not found)!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dispatch.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,65 @@
+test command parsing and dispatch
+
+ $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+ $ dir=`pwd`
+
+ $ hg init a
+ $ cd a
+ $ echo a > a
+ $ hg ci -Ama
+ adding a
+
+Missing arg:
+
+ $ hg cat
+ hg cat: invalid arguments
+ hg cat [OPTION]... FILE...
+
+ output the current or given revision of files
+
+ Print the specified files as they were at the given revision. If no
+ revision is given, the parent of the working directory is used, or tip if
+ no revision is checked out.
+
+ Output may be to a file, in which case the name of the file is given using
+ a format string. The formatting rules are the same as for the export
+ command, with the following additions:
+
+ "%s" basename of file being printed
+ "%d" dirname of file being printed, or '.' if in repository root
+ "%p" root-relative path name of file being printed
+
+ Returns 0 on success.
+
+ options:
+
+ -o --output FORMAT print output to file with formatted name
+ -r --rev REV print the given revision
+ --decode apply any matching decode filter
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help cat" to show global options
+
+[defaults]
+
+ $ hg cat a
+ a
+ $ cat >> $HGRCPATH <<EOF
+ > [defaults]
+ > cat = -r null
+ > EOF
+ $ hg cat a
+ a: no such file in rev 000000000000
+
+No repo:
+
+ $ cd $dir
+ $ hg cat
+ abort: There is no Mercurial repository here (.hg not found)!
+
+ $ exit 0
+
--- a/tests/test-doctest.py Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-doctest.py Sat Sep 11 00:40:19 2010 +0200
@@ -15,6 +15,9 @@
import mercurial.util
doctest.testmod(mercurial.util)
+import mercurial.match
+doctest.testmod(mercurial.match)
+
import mercurial.dagparser
doctest.testmod(mercurial.dagparser, optionflags=doctest.NORMALIZE_WHITESPACE)
--- a/tests/test-double-merge.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-double-merge.t Sat Sep 11 00:40:19 2010 +0200
@@ -2,27 +2,27 @@
$ cd repo
$ echo line 1 > foo
- $ hg ci -qAm 'add foo' -d "1000000 0"
+ $ hg ci -qAm 'add foo'
copy foo to bar and change both files
$ hg cp foo bar
$ echo line 2-1 >> foo
$ echo line 2-2 >> bar
- $ hg ci -m 'cp foo bar; change both' -d "1000000 0"
+ $ hg ci -m 'cp foo bar; change both'
in another branch, change foo in a way that doesn't conflict with
the other changes
$ hg up -qC 0
$ echo line 0 > foo
$ hg cat foo >> foo
- $ hg ci -m 'change foo' -d "1000000 0"
+ $ hg ci -m 'change foo'
created new head
we get conflicts that shouldn't be there
$ hg merge -P
- changeset: 1:d9da848d0adf
+ changeset: 1:484bf6903104
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: cp foo bar; change both
$ hg merge --debug
@@ -34,7 +34,7 @@
checking for directory renames
resolving manifests
overwrite None partial False
- ancestor 310fd17130da local 2092631ce82b+ remote d9da848d0adf
+ ancestor e6dc8efe11cc local 6a0df1dad128+ remote 484bf6903104
foo: versions differ -> m
foo: remote copied to bar -> m
preserving foo for resolve of bar
@@ -42,12 +42,12 @@
updating: foo 1/2 files (50.00%)
picked tool 'internal:merge' for bar (binary False symlink False)
merging foo and bar to bar
- my bar@2092631ce82b+ other bar@d9da848d0adf ancestor foo@310fd17130da
+ my bar@6a0df1dad128+ other bar@484bf6903104 ancestor foo@e6dc8efe11cc
premerge successful
updating: foo 2/2 files (100.00%)
picked tool 'internal:merge' for foo (binary False symlink False)
merging foo
- my foo@2092631ce82b+ other foo@d9da848d0adf ancestor foo@310fd17130da
+ my foo@6a0df1dad128+ other foo@484bf6903104 ancestor foo@e6dc8efe11cc
premerge successful
0 files updated, 2 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
--- a/tests/test-empty-dir Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-hg init
-echo 123 > a
-hg add a
-hg commit -m "first" -d "1000000 0" a
-mkdir sub
-echo 321 > sub/b
-hg add sub/b
-hg commit -m "second" -d "1000000 0" sub/b
-cat sub/b
-hg co 0
-cat sub/b 2>/dev/null || echo "sub/b not present"
-test -d sub || echo "sub not present"
-
-true
--- a/tests/test-empty-dir.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-321
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-sub/b not present
-sub not present
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-dir.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,25 @@
+ $ hg init
+
+ $ echo 123 > a
+ $ hg add a
+ $ hg commit -m "first" a
+
+ $ mkdir sub
+ $ echo 321 > sub/b
+ $ hg add sub/b
+ $ hg commit -m "second" sub/b
+
+ $ cat sub/b
+ 321
+
+ $ hg co 0
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ cat sub/b 2>/dev/null || echo "sub/b not present"
+ sub/b not present
+
+ $ test -d sub || echo "sub not present"
+ sub not present
+
+ $ true
+
--- a/tests/test-empty-file Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-touch empty1
-hg add empty1
-hg commit -m 'add empty1' -d '1000000 0'
-
-touch empty2
-hg add empty2
-hg commit -m 'add empty2' -d '1000000 0'
-
-hg up -C 0
-touch empty3
-hg add empty3
-hg commit -m 'add empty3' -d '1000000 0'
-
-hg heads
-
-hg merge 1
-# before changeset 05257fd28591, we didn't notice the
-# empty file that came from rev 1.
-hg status
-hg commit -m merge -d '1000000 0'
-hg manifest --debug tip
--- a/tests/test-empty-file.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-changeset: 2:62ec0e86d1e5
-tag: tip
-parent: 0:567dde5e6e98
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: add empty3
-
-changeset: 1:41ab7b321727
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: add empty2
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M empty2
-b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty1
-b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty2
-b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-file.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,46 @@
+ $ hg init a
+ $ cd a
+ $ touch empty1
+ $ hg add empty1
+ $ hg commit -m 'add empty1'
+
+ $ touch empty2
+ $ hg add empty2
+ $ hg commit -m 'add empty2'
+
+ $ hg up -C 0
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ touch empty3
+ $ hg add empty3
+ $ hg commit -m 'add empty3'
+ created new head
+
+ $ hg heads
+ changeset: 2:a1cb177e0d44
+ tag: tip
+ parent: 0:1e1d9c4e5b64
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: add empty3
+
+ changeset: 1:097d2b0e17f6
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: add empty2
+
+
+ $ hg merge 1
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+Before changeset 05257fd28591, we didn't notice the
+empty file that came from rev 1:
+
+ $ hg status
+ M empty2
+ $ hg commit -m merge
+ $ hg manifest --debug tip
+ b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty1
+ b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty2
+ b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty3
+
--- a/tests/test-empty-group Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-#
-# A B
-#
-# 3 4 3
-# |\/| |\
-# |/\| | \
-# 1 2 1 2
-# \ / \ /
-# 0 0
-#
-# if the result of the merge of 1 and 2
-# is the same in 3 and 4, no new manifest
-# will be created and the manifest group
-# will be empty during the pull
-#
-# (plus we test a failure where outgoing
-# wrongly reported the number of csets)
-#
-
-hg init a
-cd a
-touch init
-hg ci -A -m 0 -d "1000000 0"
-touch x y
-hg ci -A -m 1 -d "1000000 0"
-hg update 0
-touch x y
-hg ci -A -m 2 -d "1000000 0"
-hg merge 1
-hg ci -A -m m1 -d "1000000 0"
-#hg log
-#hg debugindex .hg/store/00manifest.i
-hg update -C 1
-hg merge 2
-hg ci -A -m m2 -d "1000000 0"
-#hg log
-#hg debugindex .hg/store/00manifest.i
-
-cd ..
-hg clone -r 3 a b
-hg clone -r 4 a c
-hg -R a outgoing b
-hg -R a outgoing c
-hg -R b outgoing c
-hg -R c outgoing b
-
-hg -R b pull a
-hg -R c pull a
--- a/tests/test-empty-group.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-adding init
-adding x
-adding y
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-adding x
-adding y
-created new head
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-created new head
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-comparing with b
-searching for changes
-changeset: 4:fdb3c546e859
-tag: tip
-parent: 1:1f703b3fcbc6
-parent: 2:de997049e034
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: m2
-
-comparing with c
-searching for changes
-changeset: 3:f40f830c0024
-parent: 2:de997049e034
-parent: 1:1f703b3fcbc6
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: m1
-
-comparing with c
-searching for changes
-changeset: 3:f40f830c0024
-tag: tip
-parent: 2:de997049e034
-parent: 1:1f703b3fcbc6
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: m1
-
-comparing with b
-searching for changes
-changeset: 3:fdb3c546e859
-tag: tip
-parent: 1:1f703b3fcbc6
-parent: 2:de997049e034
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: m2
-
-pulling from a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-pulling from a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 0 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-group.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,138 @@
+#
+# A B
+#
+# 3 4 3
+# |\/| |\
+# |/\| | \
+# 1 2 1 2
+# \ / \ /
+# 0 0
+#
+# if the result of the merge of 1 and 2
+# is the same in 3 and 4, no new manifest
+# will be created and the manifest group
+# will be empty during the pull
+#
+# (plus we test a failure where outgoing
+# wrongly reported the number of csets)
+#
+
+ $ hg init a
+ $ cd a
+ $ touch init
+ $ hg ci -A -m 0
+ adding init
+ $ touch x y
+ $ hg ci -A -m 1
+ adding x
+ adding y
+
+ $ hg update 0
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ $ touch x y
+ $ hg ci -A -m 2
+ adding x
+ adding y
+ created new head
+
+ $ hg merge 1
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg ci -A -m m1
+
+#hg log
+#hg debugindex .hg/store/00manifest.i
+
+ $ hg update -C 1
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg merge 2
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg ci -A -m m2
+ created new head
+
+#hg log
+#hg debugindex .hg/store/00manifest.i
+
+ $ cd ..
+
+ $ hg clone -r 3 a b
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 4 changesets with 3 changes to 3 files
+ updating to branch default
+ 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg clone -r 4 a c
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 4 changesets with 3 changes to 3 files
+ updating to branch default
+ 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg -R a outgoing b
+ comparing with b
+ searching for changes
+ changeset: 4:119caaef4ed1
+ tag: tip
+ parent: 1:79f9e10cd04e
+ parent: 2:8e1bb01c1a24
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: m2
+
+ $ hg -R a outgoing c
+ comparing with c
+ searching for changes
+ changeset: 3:cbb48b367d1b
+ parent: 2:8e1bb01c1a24
+ parent: 1:79f9e10cd04e
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: m1
+
+ $ hg -R b outgoing c
+ comparing with c
+ searching for changes
+ changeset: 3:cbb48b367d1b
+ tag: tip
+ parent: 2:8e1bb01c1a24
+ parent: 1:79f9e10cd04e
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: m1
+
+ $ hg -R c outgoing b
+ comparing with b
+ searching for changes
+ changeset: 3:119caaef4ed1
+ tag: tip
+ parent: 1:79f9e10cd04e
+ parent: 2:8e1bb01c1a24
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: m2
+
+
+ $ hg -R b pull a
+ pulling from a
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 0 changes to 0 files (+1 heads)
+ (run 'hg heads' to see heads, 'hg merge' to merge)
+
+ $ hg -R c pull a
+ pulling from a
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 0 changes to 0 files (+1 heads)
+ (run 'hg heads' to see heads, 'hg merge' to merge)
+
--- a/tests/test-encode Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-encode Sat Sep 11 00:40:19 2010 +0200
@@ -16,7 +16,7 @@
echo "this is a test" | gzip > a.gz
echo "this is a test" > not.gz
hg add *
-hg ci -m "test" -d "1000000 0"
+hg ci -m "test"
echo %% no changes
hg status
touch *
--- a/tests/test-encoding Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-encoding Sat Sep 11 00:40:19 2010 +0200
@@ -16,17 +16,17 @@
echo % should fail with encoding error
echo "plain old ascii" > a
hg st
-HGENCODING=ascii hg ci -l latin-1 -d "1000000 0"
+HGENCODING=ascii hg ci -l latin-1
echo % these should work
echo "latin-1" > a
-HGENCODING=latin-1 hg ci -l latin-1 -d "1000000 0"
+HGENCODING=latin-1 hg ci -l latin-1
echo "utf-8" > a
-HGENCODING=utf-8 hg ci -l utf-8 -d "1000000 0"
+HGENCODING=utf-8 hg ci -l utf-8
-HGENCODING=latin-1 hg tag -d "1000000 0" `cat latin-1-tag`
+HGENCODING=latin-1 hg tag `cat latin-1-tag`
HGENCODING=latin-1 hg branch `cat latin-1-tag`
-HGENCODING=latin-1 hg ci -d "1000000 0" -m 'latin1 branch'
+HGENCODING=latin-1 hg ci -m 'latin1 branch'
rm .hg/branch
echo "% hg log (ascii)"
@@ -58,5 +58,5 @@
HGENCODING=ascii hg branch `cat latin-1-tag`
cp latin-1-tag .hg/branch
-HGENCODING=latin-1 hg ci -d "1000000 0" -m 'should fail'
+HGENCODING=latin-1 hg ci -m 'should fail'
exit 0
--- a/tests/test-encoding-align Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-encoding-align Sat Sep 11 00:40:19 2010 +0200
@@ -78,21 +78,21 @@
echo 'first line(1)' >> s; cp s $S
echo 'first line(2)' >> m; cp m $M
echo 'first line(3)' >> l; cp l $L
-hg commit -m 'first commit' -u $S -d "1000000 0"
+hg commit -m 'first commit' -u $S
#### commit(2)
echo 'second line(1)' >> s; cp s $S
echo 'second line(2)' >> m; cp m $M
echo 'second line(3)' >> l; cp l $L
-hg commit -m 'second commit' -u $M -d "1000000 0"
+hg commit -m 'second commit' -u $M
#### commit(3)
echo 'third line(1)' >> s; cp s $S
echo 'third line(2)' >> m; cp m $M
echo 'third line(3)' >> l; cp l $L
-hg commit -m 'third commit' -u $L -d "1000000 0"
+hg commit -m 'third commit' -u $L
#### check
@@ -109,11 +109,11 @@
#### add branches/tags
hg branch $S
-hg tag -d "1000000 0" $S
+hg tag $S
hg branch $M
-hg tag -d "1000000 0" $M
+hg tag $M
hg branch $L
-hg tag -d "1000000 0" $L
+hg tag $L
#### check
--- a/tests/test-encoding-align.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-encoding-align.out Sat Sep 11 00:40:19 2010 +0200
@@ -23,12 +23,12 @@
marked working directory as branch MIDDLE_
marked working directory as branch é•·ã„é•·ã„åå‰
% check alignment of branches
-tip 5:afc60d8eed19
-é•·ã„é•·ã„åå‰ 4:19fe74d09ba0
-MIDDLE_ 3:8a20997d2281
-çŸå 2:0cc06ffa3461
+tip 5:d745ff46155b
+é•·ã„é•·ã„åå‰ 4:9259be597f19
+MIDDLE_ 3:b06c5b6def9e
+çŸå 2:64a70663cee8
% check alignment of tags
-tip 5:afc60d8eed19
-é•·ã„é•·ã„åå‰ 4:19fe74d09ba0
-MIDDLE_ 3:8a20997d2281
-çŸå 2:0cc06ffa3461
+tip 5:d745ff46155b
+é•·ã„é•·ã„åå‰ 4:9259be597f19
+MIDDLE_ 3:b06c5b6def9e
+çŸå 2:64a70663cee8
--- a/tests/test-encoding.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-encoding.out Sat Sep 11 00:40:19 2010 +0200
@@ -15,27 +15,27 @@
% these should work
marked working directory as branch é
% hg log (ascii)
-changeset: 5:db5520b4645f
+changeset: 5:093c6077d1c8
branch: ?
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin1 branch
-changeset: 4:9cff3c980b58
+changeset: 4:94db611b4196
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: Added tag ? for changeset 770b9b11621d
+date: Thu Jan 01 00:00:00 1970 +0000
+summary: Added tag ? for changeset ca661e7520de
-changeset: 3:770b9b11621d
+changeset: 3:ca661e7520de
tag: ?
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: utf-8 e' encoded: ?
-changeset: 2:0572af48b948
+changeset: 2:650c6f3d55dd
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin-1 e' encoded: ?
changeset: 1:0e5b7e3f9c4a
@@ -49,27 +49,27 @@
summary: latin-1 e': ? = u'\xe9'
% hg log (latin-1)
-changeset: 5:db5520b4645f
+changeset: 5:093c6077d1c8
branch: é
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin1 branch
-changeset: 4:9cff3c980b58
+changeset: 4:94db611b4196
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: Added tag é for changeset 770b9b11621d
+date: Thu Jan 01 00:00:00 1970 +0000
+summary: Added tag é for changeset ca661e7520de
-changeset: 3:770b9b11621d
+changeset: 3:ca661e7520de
tag: é
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: utf-8 e' encoded: é
-changeset: 2:0572af48b948
+changeset: 2:650c6f3d55dd
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin-1 e' encoded: é
changeset: 1:0e5b7e3f9c4a
@@ -83,27 +83,27 @@
summary: latin-1 e': é = u'\xe9'
% hg log (utf-8)
-changeset: 5:db5520b4645f
+changeset: 5:093c6077d1c8
branch: é
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin1 branch
-changeset: 4:9cff3c980b58
+changeset: 4:94db611b4196
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: Added tag é for changeset 770b9b11621d
+date: Thu Jan 01 00:00:00 1970 +0000
+summary: Added tag é for changeset ca661e7520de
-changeset: 3:770b9b11621d
+changeset: 3:ca661e7520de
tag: é
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: utf-8 e' encoded: é
-changeset: 2:0572af48b948
+changeset: 2:650c6f3d55dd
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin-1 e' encoded: é
changeset: 1:0e5b7e3f9c4a
@@ -117,45 +117,45 @@
summary: latin-1 e': é = u'\xe9'
% hg tags (ascii)
-tip 5:db5520b4645f
-? 3:770b9b11621d
+tip 5:093c6077d1c8
+? 3:ca661e7520de
% hg tags (latin-1)
-tip 5:db5520b4645f
-é 3:770b9b11621d
+tip 5:093c6077d1c8
+é 3:ca661e7520de
% hg tags (utf-8)
-tip 5:db5520b4645f
-é 3:770b9b11621d
+tip 5:093c6077d1c8
+é 3:ca661e7520de
% hg branches (ascii)
-? 5:db5520b4645f
-default 4:9cff3c980b58 (inactive)
+? 5:093c6077d1c8
+default 4:94db611b4196 (inactive)
% hg branches (latin-1)
-é 5:db5520b4645f
-default 4:9cff3c980b58 (inactive)
+é 5:093c6077d1c8
+default 4:94db611b4196 (inactive)
% hg branches (utf-8)
-é 5:db5520b4645f
-default 4:9cff3c980b58 (inactive)
+é 5:093c6077d1c8
+default 4:94db611b4196 (inactive)
% hg log (utf-8)
-changeset: 5:db5520b4645f
+changeset: 5:093c6077d1c8
branch: é
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin1 branch
-changeset: 4:9cff3c980b58
+changeset: 4:94db611b4196
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: Added tag é for changeset 770b9b11621d
+date: Thu Jan 01 00:00:00 1970 +0000
+summary: Added tag é for changeset ca661e7520de
-changeset: 3:770b9b11621d
+changeset: 3:ca661e7520de
tag: é
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: utf-8 e' encoded: é
-changeset: 2:0572af48b948
+changeset: 2:650c6f3d55dd
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: latin-1 e' encoded: é
changeset: 1:0e5b7e3f9c4a
--- a/tests/test-excessive-merge.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-excessive-merge.t Sat Sep 11 00:40:19 2010 +0200
@@ -4,72 +4,72 @@
$ echo foo > b
$ hg add a b
- $ hg ci -m "test" -d "1000000 0"
+ $ hg ci -m "test"
$ echo blah > a
- $ hg ci -m "branch a" -d "1000000 0"
+ $ hg ci -m "branch a"
$ hg co 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo blah > b
- $ hg ci -m "branch b" -d "1000000 0"
+ $ hg ci -m "branch b"
created new head
$ HGMERGE=true hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
- $ hg ci -m "merge b/a -> blah" -d "1000000 0"
+ $ hg ci -m "merge b/a -> blah"
$ hg co 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ HGMERGE=true hg merge 2
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
- $ hg ci -m "merge a/b -> blah" -d "1000000 0"
+ $ hg ci -m "merge a/b -> blah"
created new head
$ hg log
- changeset: 4:f6c172c6198c
+ changeset: 4:2ee31f665a86
tag: tip
- parent: 1:448a8c5e42f1
- parent: 2:7c5dc2e857f2
+ parent: 1:96155394af80
+ parent: 2:92cc4c306b19
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: merge a/b -> blah
- changeset: 3:13d875a22764
- parent: 2:7c5dc2e857f2
- parent: 1:448a8c5e42f1
+ changeset: 3:e16a66a37edd
+ parent: 2:92cc4c306b19
+ parent: 1:96155394af80
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: merge b/a -> blah
- changeset: 2:7c5dc2e857f2
- parent: 0:dc1751ec2e9d
+ changeset: 2:92cc4c306b19
+ parent: 0:5e0375449e74
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: branch b
- changeset: 1:448a8c5e42f1
+ changeset: 1:96155394af80
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: branch a
- changeset: 0:dc1751ec2e9d
+ changeset: 0:5e0375449e74
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: test
$ hg debugindex .hg/store/00changelog.i
rev offset length base linkrev nodeid p1 p2
- 0 0 64 0 0 dc1751ec2e9d 000000000000 000000000000
- 1 64 68 1 1 448a8c5e42f1 dc1751ec2e9d 000000000000
- 2 132 68 2 2 7c5dc2e857f2 dc1751ec2e9d 000000000000
- 3 200 75 3 3 13d875a22764 7c5dc2e857f2 448a8c5e42f1
- 4 275 29 3 4 f6c172c6198c 448a8c5e42f1 7c5dc2e857f2
+ 0 0 60 0 0 5e0375449e74 000000000000 000000000000
+ 1 60 62 1 1 96155394af80 5e0375449e74 000000000000
+ 2 122 62 2 2 92cc4c306b19 5e0375449e74 000000000000
+ 3 184 69 3 3 e16a66a37edd 92cc4c306b19 96155394af80
+ 4 253 29 3 4 2ee31f665a86 96155394af80 92cc4c306b19
revision 1
$ hg manifest --debug 1
--- a/tests/test-execute-bit Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" execbit || exit 80
-
-hg init
-echo a > a
-hg ci -Am'not executable'
-
-chmod +x a
-hg ci -m'executable'
-hg id
-
-echo '% make sure we notice the change of mode if the cached size == -1'
-hg rm a
-hg revert -r 0 a
-hg debugstate
-hg st
-
-hg up 0
-hg id
-test -x a && echo executable -- eek || echo not executable -- whew
--- a/tests/test-execute-bit.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-adding a
-79abf14474dc tip
-% make sure we notice the change of mode if the cached size == -1
-n 0 -1 unset a
-M a
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-d69afc33ff8a
-not executable -- whew
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-execute-bit.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,28 @@
+ $ "$TESTDIR/hghave" execbit || exit 80
+
+ $ hg init
+ $ echo a > a
+ $ hg ci -Am'not executable'
+ adding a
+
+ $ chmod +x a
+ $ hg ci -m'executable'
+ $ hg id
+ 79abf14474dc tip
+
+Make sure we notice the change of mode if the cached size == -1:
+
+ $ hg rm a
+ $ hg revert -r 0 a
+ $ hg debugstate
+ n 0 -1 unset a
+ $ hg status
+ M a
+
+ $ hg up 0
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg id
+ d69afc33ff8a
+ $ test -x a && echo executable -- bad || echo not executable -- good
+ not executable -- good
+
--- a/tests/test-extension Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-#!/bin/sh
-# Test basic extension support
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-cat > foobar.py <<EOF
-import os
-from mercurial import commands
-
-def uisetup(ui):
- ui.write("uisetup called\\n")
-
-def reposetup(ui, repo):
- ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
- ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
-
-def foo(ui, *args, **kwargs):
- ui.write("Foo\\n")
-
-def bar(ui, *args, **kwargs):
- ui.write("Bar\\n")
-
-cmdtable = {
- "foo": (foo, [], "hg foo"),
- "bar": (bar, [], "hg bar"),
-}
-
-commands.norepo += ' bar'
-EOF
-abspath=`pwd`/foobar.py
-
-mkdir barfoo
-cp foobar.py barfoo/__init__.py
-barfoopath=`pwd`/barfoo
-
-hg init a
-cd a
-echo foo > file
-hg add file
-hg commit -m 'add file'
-
-echo '[extensions]' >> $HGRCPATH
-echo "foobar = $abspath" >> $HGRCPATH
-hg foo
-
-cd ..
-hg clone a b
-
-hg bar
-echo 'foobar = !' >> $HGRCPATH
-
-echo '% module/__init__.py-style'
-echo "barfoo = $barfoopath" >> $HGRCPATH
-cd a
-hg foo
-echo 'barfoo = !' >> $HGRCPATH
-
-# check that extensions are loaded in phases
-cat > foo.py <<EOF
-import os
-name = os.path.basename(__file__).rsplit('.', 1)[0]
-print "1) %s imported" % name
-def uisetup(ui):
- print "2) %s uisetup" % name
-def extsetup():
- print "3) %s extsetup" % name
-def reposetup(ui, repo):
- print "4) %s reposetup" % name
-EOF
-
-cp foo.py bar.py
-echo 'foo = foo.py' >> $HGRCPATH
-echo 'bar = bar.py' >> $HGRCPATH
-
-# command with no output, we just want to see the extensions loaded
-hg paths
-
-# check hgweb's load order
-echo '% hgweb.cgi'
-cat > hgweb.cgi <<EOF
-#!/usr/bin/env python
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgweb
-from mercurial.hgweb import wsgicgi
-
-application = hgweb('.', 'test repo')
-wsgicgi.launch(application)
-EOF
-SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
- | grep '^[0-9]) ' # ignores HTML output
-
-echo 'foo = !' >> $HGRCPATH
-echo 'bar = !' >> $HGRCPATH
-
-cd ..
-cat > empty.py <<EOF
-'''empty cmdtable
-'''
-cmdtable = {}
-EOF
-emptypath=`pwd`/empty.py
-echo "empty = $emptypath" >> $HGRCPATH
-hg help empty
-echo 'empty = !' >> $HGRCPATH
-
-cat > debugextension.py <<EOF
-'''only debugcommands
-'''
-def debugfoobar(ui, repo, *args, **opts):
- "yet another debug command"
- pass
-
-def foo(ui, repo, *args, **opts):
- """yet another foo command
-
- This command has been DEPRECATED since forever.
- """
- pass
-
-cmdtable = {
- "debugfoobar": (debugfoobar, (), "hg debugfoobar"),
- "foo": (foo, (), "hg foo")
-}
-EOF
-debugpath=`pwd`/debugextension.py
-echo "debugextension = $debugpath" >> $HGRCPATH
-echo "% hg help"
-hg help debugextension
-echo "% hg help --verbose"
-hg --verbose help debugextension
-echo "% hg help --debug"
-hg --debug help debugextension
-echo 'debugextension = !' >> $HGRCPATH
-
-echo % issue811
-debugpath=`pwd`/debugissue811.py
-cat > debugissue811.py <<EOF
-'''show all loaded extensions
-'''
-from mercurial import extensions, commands
-
-def debugextensions(ui):
- "yet another debug command"
- ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
-
-cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")}
-commands.norepo += " debugextensions"
-EOF
-echo "debugissue811 = $debugpath" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "hgext.mq=" >> $HGRCPATH
-echo "hgext/mq=" >> $HGRCPATH
-
-echo % show extensions
-hg debugextensions
-
-echo '% disabled extension commands'
-HGRCPATH=
-export HGRCPATH
-hg help email
-hg qdel
-hg churn
-echo '% disabled extensions'
-hg help churn
-hg help patchbomb
-echo '% broken disabled extension and command'
-mkdir hgext
-echo > hgext/__init__.py
-cat > hgext/broken.py <<EOF
-"broken extension'
-EOF
-cat > path.py <<EOF
-import os, sys
-sys.path.insert(0, os.environ['HGEXTPATH'])
-EOF
-HGEXTPATH=`pwd`
-export HGEXTPATH
-hg --config extensions.path=./path.py help broken
-hg --config extensions.path=./path.py help foo > /dev/null
-
-exit 0
--- a/tests/test-extension.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-uisetup called
-reposetup called for a
-ui == repo.ui
-Foo
-uisetup called
-reposetup called for a
-ui == repo.ui
-reposetup called for b
-ui == repo.ui
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-uisetup called
-Bar
-% module/__init__.py-style
-uisetup called
-reposetup called for a
-ui == repo.ui
-Foo
-1) foo imported
-1) bar imported
-2) foo uisetup
-2) bar uisetup
-3) foo extsetup
-3) bar extsetup
-4) foo reposetup
-4) bar reposetup
-% hgweb.cgi
-1) foo imported
-1) bar imported
-2) foo uisetup
-2) bar uisetup
-3) foo extsetup
-3) bar extsetup
-4) foo reposetup
-4) bar reposetup
-4) foo reposetup
-4) bar reposetup
-empty extension - empty cmdtable
-
-no commands defined
-% hg help
-debugextension extension - only debugcommands
-
-no commands defined
-% hg help --verbose
-debugextension extension - only debugcommands
-
-list of commands:
-
- foo:
- yet another foo command
-
-global options:
- -R --repository REPO repository root directory or name of overlay bundle
- file
- --cwd DIR change working directory
- -y --noninteractive do not prompt, assume 'yes' for any required answers
- -q --quiet suppress output
- -v --verbose enable additional output
- --config CONFIG [+] set/override config option (use 'section.name=value')
- --debug enable debugging output
- --debugger start debugger
- --encoding ENCODE set the charset encoding (default: ascii)
- --encodingmode MODE set the charset encoding mode (default: strict)
- --traceback always print a traceback on exception
- --time time how long the command takes
- --profile print command execution profile
- --version output version information and exit
- -h --help display help and exit
-
-[+] marked option can be specified multiple times
-% hg help --debug
-debugextension extension - only debugcommands
-
-list of commands:
-
- debugfoobar:
- yet another debug command
- foo:
- yet another foo command
-
-global options:
- -R --repository REPO repository root directory or name of overlay bundle
- file
- --cwd DIR change working directory
- -y --noninteractive do not prompt, assume 'yes' for any required answers
- -q --quiet suppress output
- -v --verbose enable additional output
- --config CONFIG [+] set/override config option (use 'section.name=value')
- --debug enable debugging output
- --debugger start debugger
- --encoding ENCODE set the charset encoding (default: ascii)
- --encodingmode MODE set the charset encoding mode (default: strict)
- --traceback always print a traceback on exception
- --time time how long the command takes
- --profile print command execution profile
- --version output version information and exit
- -h --help display help and exit
-
-[+] marked option can be specified multiple times
-% issue811
-% show extensions
-debugissue811
-mq
-% disabled extension commands
-'email' is provided by the following extension:
-
- patchbomb command to send changesets as (a series of) patch emails
-
-use "hg help extensions" for information on enabling extensions
-hg: unknown command 'qdel'
-'qdelete' is provided by the following extension:
-
- mq manage a stack of patches
-
-use "hg help extensions" for information on enabling extensions
-hg: unknown command 'churn'
-'churn' is provided by the following extension:
-
- churn command to display statistics about repository history
-
-use "hg help extensions" for information on enabling extensions
-% disabled extensions
-churn extension - command to display statistics about repository history
-
-use "hg help extensions" for information on enabling extensions
-patchbomb extension - command to send changesets as (a series of) patch emails
-
-use "hg help extensions" for information on enabling extensions
-% broken disabled extension and command
-broken extension - (no help text available)
-
-use "hg help extensions" for information on enabling extensions
-hg: unknown command 'foo'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-extension.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,320 @@
+Test basic extension support
+
+ $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+ $ cat > foobar.py <<EOF
+ > import os
+ > from mercurial import commands
+ >
+ > def uisetup(ui):
+ > ui.write("uisetup called\\n")
+ >
+ > def reposetup(ui, repo):
+ > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
+ > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
+ >
+ > def foo(ui, *args, **kwargs):
+ > ui.write("Foo\\n")
+ >
+ > def bar(ui, *args, **kwargs):
+ > ui.write("Bar\\n")
+ >
+ > cmdtable = {
+ > "foo": (foo, [], "hg foo"),
+ > "bar": (bar, [], "hg bar"),
+ > }
+ >
+ > commands.norepo += ' bar'
+ > EOF
+ $ abspath=`pwd`/foobar.py
+
+ $ mkdir barfoo
+ $ cp foobar.py barfoo/__init__.py
+ $ barfoopath=`pwd`/barfoo
+
+ $ hg init a
+ $ cd a
+ $ echo foo > file
+ $ hg add file
+ $ hg commit -m 'add file'
+
+ $ echo '[extensions]' >> $HGRCPATH
+ $ echo "foobar = $abspath" >> $HGRCPATH
+ $ hg foo
+ uisetup called
+ reposetup called for a
+ ui == repo.ui
+ Foo
+
+ $ cd ..
+ $ hg clone a b
+ uisetup called
+ reposetup called for a
+ ui == repo.ui
+ reposetup called for b
+ ui == repo.ui
+ updating to branch default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg bar
+ uisetup called
+ Bar
+ $ echo 'foobar = !' >> $HGRCPATH
+
+module/__init__.py-style
+
+ $ echo "barfoo = $barfoopath" >> $HGRCPATH
+ $ cd a
+ $ hg foo
+ uisetup called
+ reposetup called for a
+ ui == repo.ui
+ Foo
+ $ echo 'barfoo = !' >> $HGRCPATH
+
+Check that extensions are loaded in phases:
+
+ $ cat > foo.py <<EOF
+ > import os
+ > name = os.path.basename(__file__).rsplit('.', 1)[0]
+ > print "1) %s imported" % name
+ > def uisetup(ui):
+ > print "2) %s uisetup" % name
+ > def extsetup():
+ > print "3) %s extsetup" % name
+ > def reposetup(ui, repo):
+ > print "4) %s reposetup" % name
+ > EOF
+
+ $ cp foo.py bar.py
+ $ echo 'foo = foo.py' >> $HGRCPATH
+ $ echo 'bar = bar.py' >> $HGRCPATH
+
+Command with no output, we just want to see the extensions loaded:
+
+ $ hg paths
+ 1) foo imported
+ 1) bar imported
+ 2) foo uisetup
+ 2) bar uisetup
+ 3) foo extsetup
+ 3) bar extsetup
+ 4) foo reposetup
+ 4) bar reposetup
+
+Check hgweb's load order:
+
+ $ cat > hgweb.cgi <<EOF
+ > #!/usr/bin/env python
+ > from mercurial import demandimport; demandimport.enable()
+ > from mercurial.hgweb import hgweb
+ > from mercurial.hgweb import wsgicgi
+ >
+ > application = hgweb('.', 'test repo')
+ > wsgicgi.launch(application)
+ > EOF
+
+ $ SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
+ > | grep '^[0-9]) ' # ignores HTML output
+ 1) foo imported
+ 1) bar imported
+ 2) foo uisetup
+ 2) bar uisetup
+ 3) foo extsetup
+ 3) bar extsetup
+ 4) foo reposetup
+ 4) bar reposetup
+ 4) foo reposetup
+ 4) bar reposetup
+
+ $ echo 'foo = !' >> $HGRCPATH
+ $ echo 'bar = !' >> $HGRCPATH
+
+ $ cd ..
+
+ $ cat > empty.py <<EOF
+ > '''empty cmdtable
+ > '''
+ > cmdtable = {}
+ > EOF
+ $ emptypath=`pwd`/empty.py
+ $ echo "empty = $emptypath" >> $HGRCPATH
+ $ hg help empty
+ empty extension - empty cmdtable
+
+ no commands defined
+
+ $ echo 'empty = !' >> $HGRCPATH
+
+ $ cat > debugextension.py <<EOF
+ > '''only debugcommands
+ > '''
+ > def debugfoobar(ui, repo, *args, **opts):
+ > "yet another debug command"
+ > pass
+ >
+ > def foo(ui, repo, *args, **opts):
+ > """yet another foo command
+ >
+ > This command has been DEPRECATED since forever.
+ > """
+ > pass
+ >
+ > cmdtable = {
+ > "debugfoobar": (debugfoobar, (), "hg debugfoobar"),
+ > "foo": (foo, (), "hg foo")
+ > }
+ > EOF
+ $ debugpath=`pwd`/debugextension.py
+ $ echo "debugextension = $debugpath" >> $HGRCPATH
+
+ $ hg help debugextension
+ debugextension extension - only debugcommands
+
+ no commands defined
+
+ $ hg --verbose help debugextension
+ debugextension extension - only debugcommands
+
+ list of commands:
+
+ foo:
+ yet another foo command
+
+ global options:
+ -R --repository REPO repository root directory or name of overlay bundle
+ file
+ --cwd DIR change working directory
+ -y --noninteractive do not prompt, assume 'yes' for any required answers
+ -q --quiet suppress output
+ -v --verbose enable additional output
+ --config CONFIG [+] set/override config option (use 'section.name=value')
+ --debug enable debugging output
+ --debugger start debugger
+ --encoding ENCODE set the charset encoding (default: ascii)
+ --encodingmode MODE set the charset encoding mode (default: strict)
+ --traceback always print a traceback on exception
+ --time time how long the command takes
+ --profile print command execution profile
+ --version output version information and exit
+ -h --help display help and exit
+
+ [+] marked option can be specified multiple times
+
+ $ hg --debug help debugextension
+ debugextension extension - only debugcommands
+
+ list of commands:
+
+ debugfoobar:
+ yet another debug command
+ foo:
+ yet another foo command
+
+ global options:
+ -R --repository REPO repository root directory or name of overlay bundle
+ file
+ --cwd DIR change working directory
+ -y --noninteractive do not prompt, assume 'yes' for any required answers
+ -q --quiet suppress output
+ -v --verbose enable additional output
+ --config CONFIG [+] set/override config option (use 'section.name=value')
+ --debug enable debugging output
+ --debugger start debugger
+ --encoding ENCODE set the charset encoding (default: ascii)
+ --encodingmode MODE set the charset encoding mode (default: strict)
+ --traceback always print a traceback on exception
+ --time time how long the command takes
+ --profile print command execution profile
+ --version output version information and exit
+ -h --help display help and exit
+
+ [+] marked option can be specified multiple times
+ $ echo 'debugextension = !' >> $HGRCPATH
+
+Issue811:
+
+ $ debugpath=`pwd`/debugissue811.py
+ $ cat > debugissue811.py <<EOF
+ > '''show all loaded extensions
+ > '''
+ > from mercurial import extensions, commands
+ >
+ > def debugextensions(ui):
+ > "yet another debug command"
+ > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
+ >
+ > cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")}
+ > commands.norepo += " debugextensions"
+ > EOF
+ $ echo "debugissue811 = $debugpath" >> $HGRCPATH
+ $ echo "mq=" >> $HGRCPATH
+ $ echo "hgext.mq=" >> $HGRCPATH
+ $ echo "hgext/mq=" >> $HGRCPATH
+
+Show extensions:
+
+ $ hg debugextensions
+ debugissue811
+ mq
+
+Disabled extension commands:
+
+ $ HGRCPATH=
+ $ export HGRCPATH
+ $ hg help email
+ 'email' is provided by the following extension:
+
+ patchbomb command to send changesets as (a series of) patch emails
+
+ use "hg help extensions" for information on enabling extensions
+ $ hg qdel
+ hg: unknown command 'qdel'
+ 'qdelete' is provided by the following extension:
+
+ mq manage a stack of patches
+
+ use "hg help extensions" for information on enabling extensions
+ $ hg churn
+ hg: unknown command 'churn'
+ 'churn' is provided by the following extension:
+
+ churn command to display statistics about repository history
+
+ use "hg help extensions" for information on enabling extensions
+
+Disabled extensions:
+
+ $ hg help churn
+ churn extension - command to display statistics about repository history
+
+ use "hg help extensions" for information on enabling extensions
+ $ hg help patchbomb
+ patchbomb extension - command to send changesets as (a series of) patch emails
+
+ use "hg help extensions" for information on enabling extensions
+
+Broken disabled extension and command:
+
+ $ mkdir hgext
+ $ echo > hgext/__init__.py
+ $ cat > hgext/broken.py <<EOF
+ > "broken extension'
+ > EOF
+ $ cat > path.py <<EOF
+ > import os, sys
+ > sys.path.insert(0, os.environ['HGEXTPATH'])
+ > EOF
+ $ HGEXTPATH=`pwd`
+ $ export HGEXTPATH
+
+ $ hg --config extensions.path=./path.py help broken
+ broken extension - (no help text available)
+
+ use "hg help extensions" for information on enabling extensions
+
+ $ hg --config extensions.path=./path.py help foo > /dev/null
+ hg: unknown command 'foo'
+
+ $ exit 0
+
--- a/tests/test-filebranch Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-# This test makes sure that we don't mark a file as merged with its ancestor
-# when we do a merge.
-
-cat <<EOF > merge
-import sys, os
-print "merging for", os.path.basename(sys.argv[1])
-EOF
-HGMERGE="python ../merge"; export HGMERGE
-
-echo creating base
-hg init a
-cd a
-echo 1 > foo
-echo 1 > bar
-echo 1 > baz
-echo 1 > quux
-hg add foo bar baz quux
-hg commit -m "base" -d "1000000 0"
-
-cd ..
-hg clone a b
-
-echo creating branch a
-cd a
-echo 2a > foo
-echo 2a > bar
-hg commit -m "branch a" -d "1000000 0"
-
-echo creating branch b
-
-cd ..
-cd b
-echo 2b > foo
-echo 2b > baz
-hg commit -m "branch b" -d "1000000 0"
-
-echo "we shouldn't have anything but n state here"
-hg debugstate --nodates | grep -v "^n"
-
-echo merging
-hg pull ../a
-hg merge -v
-
-echo 2m > foo
-echo 2b > baz
-echo new > quux
-
-echo "we shouldn't have anything but foo in merge state here"
-hg debugstate --nodates | grep "^m"
-
-hg ci -m "merge" -d "1000000 0"
-
-echo "main: we should have a merge here"
-hg debugindex .hg/store/00changelog.i
-
-echo "log should show foo and quux changed"
-hg log -v -r tip
-
-echo "foo: we should have a merge here"
-hg debugindex .hg/store/data/foo.i
-
-echo "bar: we shouldn't have a merge here"
-hg debugindex .hg/store/data/bar.i
-
-echo "baz: we shouldn't have a merge here"
-hg debugindex .hg/store/data/baz.i
-
-echo "quux: we shouldn't have a merge here"
-hg debugindex .hg/store/data/quux.i
-
-echo "manifest entries should match tips of all files"
-hg manifest --debug
-
-echo "everything should be clean now"
-hg status
-
-hg verify
--- a/tests/test-filebranch.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-creating base
-updating to branch default
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-creating branch a
-creating branch b
-we shouldn't have anything but n state here
-merging
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-merging for foo
-resolving manifests
-getting bar
-merging foo
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-we shouldn't have anything but foo in merge state here
-m 644 3 foo
-main: we should have a merge here
- rev offset length base linkrev nodeid p1 p2
- 0 0 77 0 0 c36078bec30d 000000000000 000000000000
- 1 77 73 1 1 182b283965f1 c36078bec30d 000000000000
- 2 150 71 2 2 a6aef98656b7 c36078bec30d 000000000000
- 3 221 72 3 3 0c2cc6fc80e2 182b283965f1 a6aef98656b7
-log should show foo and quux changed
-changeset: 3:0c2cc6fc80e2
-tag: tip
-parent: 1:182b283965f1
-parent: 2:a6aef98656b7
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-files: foo quux
-description:
-merge
-
-
-foo: we should have a merge here
- rev offset length base linkrev nodeid p1 p2
- 0 0 3 0 0 b8e02f643373 000000000000 000000000000
- 1 3 4 1 1 2ffeddde1b65 b8e02f643373 000000000000
- 2 7 4 2 2 33d1fb69067a b8e02f643373 000000000000
- 3 11 4 3 3 aa27919ee430 2ffeddde1b65 33d1fb69067a
-bar: we shouldn't have a merge here
- rev offset length base linkrev nodeid p1 p2
- 0 0 3 0 0 b8e02f643373 000000000000 000000000000
- 1 3 4 1 2 33d1fb69067a b8e02f643373 000000000000
-baz: we shouldn't have a merge here
- rev offset length base linkrev nodeid p1 p2
- 0 0 3 0 0 b8e02f643373 000000000000 000000000000
- 1 3 4 1 1 2ffeddde1b65 b8e02f643373 000000000000
-quux: we shouldn't have a merge here
- rev offset length base linkrev nodeid p1 p2
- 0 0 3 0 0 b8e02f643373 000000000000 000000000000
- 1 3 5 1 3 6128c0f33108 b8e02f643373 000000000000
-manifest entries should match tips of all files
-33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar
-2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz
-aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
-6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
-everything should be clean now
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 4 changesets, 10 total revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-filebranch.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,147 @@
+This test makes sure that we don't mark a file as merged with its ancestor
+when we do a merge.
+
+ $ cat <<EOF > merge
+ > import sys, os
+ > print "merging for", os.path.basename(sys.argv[1])
+ > EOF
+ $ HGMERGE="python ../merge"; export HGMERGE
+
+Creating base:
+
+ $ hg init a
+ $ cd a
+ $ echo 1 > foo
+ $ echo 1 > bar
+ $ echo 1 > baz
+ $ echo 1 > quux
+ $ hg add foo bar baz quux
+ $ hg commit -m "base"
+
+ $ cd ..
+ $ hg clone a b
+ updating to branch default
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Creating branch a:
+
+ $ cd a
+ $ echo 2a > foo
+ $ echo 2a > bar
+ $ hg commit -m "branch a"
+
+Creating branch b:
+
+ $ cd ..
+ $ cd b
+ $ echo 2b > foo
+ $ echo 2b > baz
+ $ hg commit -m "branch b"
+
+We shouldn't have anything but n state here:
+
+ $ hg debugstate --nodates | grep -v "^n"
+
+Merging:
+
+ $ hg pull ../a
+ pulling from ../a
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 2 changes to 2 files (+1 heads)
+ (run 'hg heads' to see heads, 'hg merge' to merge)
+
+ $ hg merge -v
+ merging for foo
+ resolving manifests
+ getting bar
+ merging foo
+ 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ echo 2m > foo
+ $ echo 2b > baz
+ $ echo new > quux
+
+We shouldn't have anything but foo in merge state here:
+
+ $ hg debugstate --nodates | grep "^m"
+ m 644 3 foo
+
+ $ hg ci -m "merge"
+
+main: we should have a merge here:
+
+ $ hg debugindex .hg/store/00changelog.i
+ rev offset length base linkrev nodeid p1 p2
+ 0 0 73 0 0 cdca01651b96 000000000000 000000000000
+ 1 73 68 1 1 f6718a9cb7f3 cdca01651b96 000000000000
+ 2 141 68 2 2 bdd988058d16 cdca01651b96 000000000000
+ 3 209 66 3 3 d8a521142a3c f6718a9cb7f3 bdd988058d16
+
+log should show foo and quux changed:
+
+ $ hg log -v -r tip
+ changeset: 3:d8a521142a3c
+ tag: tip
+ parent: 1:f6718a9cb7f3
+ parent: 2:bdd988058d16
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ files: foo quux
+ description:
+ merge
+
+
+
+foo: we should have a merge here:
+
+ $ hg debugindex .hg/store/data/foo.i
+ rev offset length base linkrev nodeid p1 p2
+ 0 0 3 0 0 b8e02f643373 000000000000 000000000000
+ 1 3 4 1 1 2ffeddde1b65 b8e02f643373 000000000000
+ 2 7 4 2 2 33d1fb69067a b8e02f643373 000000000000
+ 3 11 4 3 3 aa27919ee430 2ffeddde1b65 33d1fb69067a
+
+bar: we should not have a merge here:
+
+ $ hg debugindex .hg/store/data/bar.i
+ rev offset length base linkrev nodeid p1 p2
+ 0 0 3 0 0 b8e02f643373 000000000000 000000000000
+ 1 3 4 1 2 33d1fb69067a b8e02f643373 000000000000
+
+baz: we should not have a merge here:
+
+ $ hg debugindex .hg/store/data/baz.i
+ rev offset length base linkrev nodeid p1 p2
+ 0 0 3 0 0 b8e02f643373 000000000000 000000000000
+ 1 3 4 1 1 2ffeddde1b65 b8e02f643373 000000000000
+
+quux: we should not have a merge here:
+
+ $ hg debugindex .hg/store/data/quux.i
+ rev offset length base linkrev nodeid p1 p2
+ 0 0 3 0 0 b8e02f643373 000000000000 000000000000
+ 1 3 5 1 3 6128c0f33108 b8e02f643373 000000000000
+
+Manifest entries should match tips of all files:
+
+ $ hg manifest --debug
+ 33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar
+ 2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz
+ aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
+ 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
+
+Everything should be clean now:
+
+ $ hg status
+
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 4 files, 4 changesets, 10 total revisions
+
--- a/tests/test-flags.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-flags.t Sat Sep 11 00:40:19 2010 +0200
@@ -5,7 +5,7 @@
$ hg init
$ touch a b
$ hg add a b
- $ hg ci -m "added a b" -d "1000000 0"
+ $ hg ci -m "added a b"
$ cd ..
$ hg clone test1 test3
@@ -26,7 +26,7 @@
$ hg co
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ chmod +x a
- $ hg ci -m "chmod +x a" -d "1000000 0"
+ $ hg ci -m "chmod +x a"
the changelog should mention file a:
@@ -35,7 +35,7 @@
$ cd ../test1
$ echo 123 >>a
- $ hg ci -m "a updated" -d "1000000 0"
+ $ hg ci -m "a updated"
$ hg pull ../test2
pulling from ../test2
@@ -46,34 +46,34 @@
added 1 changesets with 0 changes to 0 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg heads
- changeset: 2:37dccb76c058
+ changeset: 2:7f4313b42a34
tag: tip
- parent: 0:4536b1c2ca69
+ parent: 0:22a449e20da5
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: chmod +x a
- changeset: 1:a187cb361a5a
+ changeset: 1:c6ecefc45368
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: a updated
$ hg history
- changeset: 2:37dccb76c058
+ changeset: 2:7f4313b42a34
tag: tip
- parent: 0:4536b1c2ca69
+ parent: 0:22a449e20da5
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: chmod +x a
- changeset: 1:a187cb361a5a
+ changeset: 1:c6ecefc45368
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: a updated
- changeset: 0:4536b1c2ca69
+ changeset: 0:22a449e20da5
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: added a b
@@ -84,7 +84,7 @@
$ cd ../test3
$ echo 123 >>b
- $ hg ci -m "b updated" -d "1000000 0"
+ $ hg ci -m "b updated"
$ hg pull ../test2
pulling from ../test2
@@ -95,34 +95,34 @@
added 1 changesets with 0 changes to 0 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg heads
- changeset: 2:37dccb76c058
+ changeset: 2:7f4313b42a34
tag: tip
- parent: 0:4536b1c2ca69
+ parent: 0:22a449e20da5
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: chmod +x a
- changeset: 1:d54568174d8e
+ changeset: 1:dc57ead75f79
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: b updated
$ hg history
- changeset: 2:37dccb76c058
+ changeset: 2:7f4313b42a34
tag: tip
- parent: 0:4536b1c2ca69
+ parent: 0:22a449e20da5
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: chmod +x a
- changeset: 1:d54568174d8e
+ changeset: 1:dc57ead75f79
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: b updated
- changeset: 0:4536b1c2ca69
+ changeset: 0:22a449e20da5
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: added a b
--- a/tests/test-git-export Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-
-echo start > start
-hg ci -Amstart
-echo new > new
-hg ci -Amnew
-echo '% new file'
-hg diff --git -r 0
-
-hg cp new copy
-hg ci -mcopy
-echo '% copy'
-hg diff --git -r 1:tip
-
-hg mv copy rename
-hg ci -mrename
-echo '% rename'
-hg diff --git -r 2:tip
-
-hg rm rename
-hg ci -mdelete
-echo '% delete'
-hg diff --git -r 3:tip
-
-cat > src <<EOF
-1
-2
-3
-4
-5
-EOF
-hg ci -Amsrc
-chmod +x src
-hg ci -munexec
-echo '% chmod 644'
-hg diff --git -r 5:tip
-
-hg mv src dst
-chmod -x dst
-echo a >> dst
-hg ci -mrenamemod
-echo '% rename+mod+chmod'
-hg diff --git -r 6:tip
-
-echo '% nonexistent in tip+chmod'
-hg diff --git -r 5:6
-
-echo '% binary diff'
-cp $TESTDIR/binfile.bin .
-hg add binfile.bin
-hg diff --git > b.diff
-cat b.diff
-
-echo '% import binary diff'
-hg revert binfile.bin
-rm binfile.bin
-hg import -mfoo b.diff
-cmp binfile.bin $TESTDIR/binfile.bin
-
-echo
-echo '% rename binary file'
-hg mv binfile.bin renamed.bin
-hg diff --git
-
-echo
-echo '% diff across many revisions'
-hg mv dst dst2
-hg ci -m 'mv dst dst2'
-
-echo >> start
-hg ci -m 'change start'
-
-hg revert -r -2 start
-hg mv dst2 dst3
-hg ci -m 'mv dst2 dst3; revert start'
-
-hg diff --git -r 9:11
-echo '% reversed'
-hg diff --git -r 11:9
-
-echo a >> foo
-hg add foo
-hg ci -m 'add foo'
-echo b >> foo
-hg ci -m 'change foo'
-hg mv foo bar
-hg ci -m 'mv foo bar'
-echo c >> bar
-hg ci -m 'change bar'
-
-echo
-echo '% file created before r1 and renamed before r2'
-hg diff --git -r -3:-1
-echo '% reversed'
-hg diff --git -r -1:-3
-echo
-echo '% file created in r1 and renamed before r2'
-hg diff --git -r -4:-1
-echo '% reversed'
-hg diff --git -r -1:-4
-echo
-echo '% file created after r1 and renamed before r2'
-hg diff --git -r -5:-1
-echo '% reversed'
-hg diff --git -r -1:-5
-
-echo
-echo '% comparing with the working dir'
-echo >> start
-hg ci -m 'change start again'
-
-echo > created
-hg add created
-hg ci -m 'add created'
-
-hg mv created created2
-hg ci -m 'mv created created2'
-
-hg mv created2 created3
-echo "% there's a copy in the working dir..."
-hg diff --git
-echo
-echo "% ...but there's another copy between the original rev and the wd"
-hg diff --git -r -2
-echo
-echo "% ...but the source of the copy was created after the original rev"
-hg diff --git -r -3
-hg ci -m 'mv created2 created3'
-
-echo > brand-new
-hg add brand-new
-hg ci -m 'add brand-new'
-hg mv brand-new brand-new2
-echo '% created in parent of wd; renamed in the wd'
-hg diff --git
-
-echo
-echo '% created between r1 and parent of wd; renamed in the wd'
-hg diff --git -r -2
-hg ci -m 'mv brand-new brand-new2'
-
-echo '% one file is copied to many destinations and removed'
-hg cp brand-new2 brand-new3
-hg mv brand-new2 brand-new3-2
-hg ci -m 'multiple renames/copies'
-hg diff --git -r -2 -r -1
-echo '% reversed'
-hg diff --git -r -1 -r -2
-
-echo '% there should be a trailing TAB if there are spaces in the file name'
-echo foo > 'with spaces'
-hg add 'with spaces'
-hg diff --git
-hg ci -m 'add filename with spaces'
-
--- a/tests/test-git-export.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-adding start
-adding new
-% new file
-diff --git a/new b/new
-new file mode 100644
---- /dev/null
-+++ b/new
-@@ -0,0 +1,1 @@
-+new
-% copy
-diff --git a/new b/copy
-copy from new
-copy to copy
-% rename
-diff --git a/copy b/rename
-rename from copy
-rename to rename
-% delete
-diff --git a/rename b/rename
-deleted file mode 100644
---- a/rename
-+++ /dev/null
-@@ -1,1 +0,0 @@
--new
-adding src
-% chmod 644
-diff --git a/src b/src
-old mode 100644
-new mode 100755
-% rename+mod+chmod
-diff --git a/src b/dst
-old mode 100755
-new mode 100644
-rename from src
-rename to dst
---- a/src
-+++ b/dst
-@@ -3,3 +3,4 @@
- 3
- 4
- 5
-+a
-% nonexistent in tip+chmod
-diff --git a/src b/src
-old mode 100644
-new mode 100755
-% binary diff
-diff --git a/binfile.bin b/binfile.bin
-new file mode 100644
-index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
-GIT binary patch
-literal 593
-zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
-z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
-zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
-z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
-zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
-ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
-zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
-z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
-zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
-z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
-zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
-fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
-
-% import binary diff
-applying b.diff
-
-% rename binary file
-diff --git a/binfile.bin b/renamed.bin
-rename from binfile.bin
-rename to renamed.bin
-
-% diff across many revisions
-diff --git a/dst2 b/dst3
-rename from dst2
-rename to dst3
-% reversed
-diff --git a/dst3 b/dst2
-rename from dst3
-rename to dst2
-
-% file created before r1 and renamed before r2
-diff --git a/foo b/bar
-rename from foo
-rename to bar
---- a/foo
-+++ b/bar
-@@ -1,2 +1,3 @@
- a
- b
-+c
-% reversed
-diff --git a/bar b/foo
-rename from bar
-rename to foo
---- a/bar
-+++ b/foo
-@@ -1,3 +1,2 @@
- a
- b
--c
-
-% file created in r1 and renamed before r2
-diff --git a/foo b/bar
-rename from foo
-rename to bar
---- a/foo
-+++ b/bar
-@@ -1,1 +1,3 @@
- a
-+b
-+c
-% reversed
-diff --git a/bar b/foo
-rename from bar
-rename to foo
---- a/bar
-+++ b/foo
-@@ -1,3 +1,1 @@
- a
--b
--c
-
-% file created after r1 and renamed before r2
-diff --git a/bar b/bar
-new file mode 100644
---- /dev/null
-+++ b/bar
-@@ -0,0 +1,3 @@
-+a
-+b
-+c
-% reversed
-diff --git a/bar b/bar
-deleted file mode 100644
---- a/bar
-+++ /dev/null
-@@ -1,3 +0,0 @@
--a
--b
--c
-
-% comparing with the working dir
-% there's a copy in the working dir...
-diff --git a/created2 b/created3
-rename from created2
-rename to created3
-
-% ...but there's another copy between the original rev and the wd
-diff --git a/created b/created3
-rename from created
-rename to created3
-
-% ...but the source of the copy was created after the original rev
-diff --git a/created3 b/created3
-new file mode 100644
---- /dev/null
-+++ b/created3
-@@ -0,0 +1,1 @@
-+
-% created in parent of wd; renamed in the wd
-diff --git a/brand-new b/brand-new2
-rename from brand-new
-rename to brand-new2
-
-% created between r1 and parent of wd; renamed in the wd
-diff --git a/brand-new2 b/brand-new2
-new file mode 100644
---- /dev/null
-+++ b/brand-new2
-@@ -0,0 +1,1 @@
-+
-% one file is copied to many destinations and removed
-diff --git a/brand-new2 b/brand-new3
-rename from brand-new2
-rename to brand-new3
-diff --git a/brand-new2 b/brand-new3-2
-copy from brand-new2
-copy to brand-new3-2
-% reversed
-diff --git a/brand-new3 b/brand-new2
-rename from brand-new3
-rename to brand-new2
-diff --git a/brand-new3-2 b/brand-new3-2
-deleted file mode 100644
---- a/brand-new3-2
-+++ /dev/null
-@@ -1,1 +0,0 @@
--
-% there should be a trailing TAB if there are spaces in the file name
-diff --git a/with spaces b/with spaces
-new file mode 100644
---- /dev/null
-+++ b/with spaces
-@@ -0,0 +1,1 @@
-+foo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-git-export.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,349 @@
+ $ hg init
+ $ echo start > start
+ $ hg ci -Amstart
+ adding start
+
+New file:
+
+ $ echo new > new
+ $ hg ci -Amnew
+ adding new
+ $ hg diff --git -r 0
+ diff --git a/new b/new
+ new file mode 100644
+ --- /dev/null
+ +++ b/new
+ @@ -0,0 +1,1 @@
+ +new
+
+Copy:
+
+ $ hg cp new copy
+ $ hg ci -mcopy
+ $ hg diff --git -r 1:tip
+ diff --git a/new b/copy
+ copy from new
+ copy to copy
+
+Rename:
+
+ $ hg mv copy rename
+ $ hg ci -mrename
+ $ hg diff --git -r 2:tip
+ diff --git a/copy b/rename
+ rename from copy
+ rename to rename
+
+Delete:
+
+ $ hg rm rename
+ $ hg ci -mdelete
+ $ hg diff --git -r 3:tip
+ diff --git a/rename b/rename
+ deleted file mode 100644
+ --- a/rename
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -new
+
+ $ cat > src <<EOF
+ > 1
+ > 2
+ > 3
+ > 4
+ > 5
+ > EOF
+ $ hg ci -Amsrc
+ adding src
+
+chmod 644:
+
+ $ chmod +x src
+ $ hg ci -munexec
+ $ hg diff --git -r 5:tip
+ diff --git a/src b/src
+ old mode 100644
+ new mode 100755
+
+Rename+mod+chmod:
+
+ $ hg mv src dst
+ $ chmod -x dst
+ $ echo a >> dst
+ $ hg ci -mrenamemod
+ $ hg diff --git -r 6:tip
+ diff --git a/src b/dst
+ old mode 100755
+ new mode 100644
+ rename from src
+ rename to dst
+ --- a/src
+ +++ b/dst
+ @@ -3,3 +3,4 @@
+ 3
+ 4
+ 5
+ +a
+
+Nonexistent in tip+chmod:
+
+ $ hg diff --git -r 5:6
+ diff --git a/src b/src
+ old mode 100644
+ new mode 100755
+
+Binary diff:
+
+ $ cp $TESTDIR/binfile.bin .
+ $ hg add binfile.bin
+ $ hg diff --git > b.diff
+ $ cat b.diff
+ diff --git a/binfile.bin b/binfile.bin
+ new file mode 100644
+ index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
+ GIT binary patch
+ literal 593
+ zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
+ z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
+ zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
+ z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
+ zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
+ ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
+ zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
+ z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
+ zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
+ z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
+ zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
+ fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
+
+
+Import binary diff:
+
+ $ hg revert binfile.bin
+ $ rm binfile.bin
+ $ hg import -mfoo b.diff
+ applying b.diff
+ $ cmp binfile.bin $TESTDIR/binfile.bin
+
+Rename binary file:
+
+ $ hg mv binfile.bin renamed.bin
+ $ hg diff --git
+ diff --git a/binfile.bin b/renamed.bin
+ rename from binfile.bin
+ rename to renamed.bin
+
+Diff across many revisions:
+
+ $ hg mv dst dst2
+ $ hg ci -m 'mv dst dst2'
+
+ $ echo >> start
+ $ hg ci -m 'change start'
+
+ $ hg revert -r -2 start
+ $ hg mv dst2 dst3
+ $ hg ci -m 'mv dst2 dst3; revert start'
+
+ $ hg diff --git -r 9:11
+ diff --git a/dst2 b/dst3
+ rename from dst2
+ rename to dst3
+
+Reversed:
+
+ $ hg diff --git -r 11:9
+ diff --git a/dst3 b/dst2
+ rename from dst3
+ rename to dst2
+
+
+ $ echo a >> foo
+ $ hg add foo
+ $ hg ci -m 'add foo'
+ $ echo b >> foo
+ $ hg ci -m 'change foo'
+ $ hg mv foo bar
+ $ hg ci -m 'mv foo bar'
+ $ echo c >> bar
+ $ hg ci -m 'change bar'
+
+File created before r1 and renamed before r2:
+
+ $ hg diff --git -r -3:-1
+ diff --git a/foo b/bar
+ rename from foo
+ rename to bar
+ --- a/foo
+ +++ b/bar
+ @@ -1,2 +1,3 @@
+ a
+ b
+ +c
+
+Reversed:
+
+ $ hg diff --git -r -1:-3
+ diff --git a/bar b/foo
+ rename from bar
+ rename to foo
+ --- a/bar
+ +++ b/foo
+ @@ -1,3 +1,2 @@
+ a
+ b
+ -c
+
+File created in r1 and renamed before r2:
+
+ $ hg diff --git -r -4:-1
+ diff --git a/foo b/bar
+ rename from foo
+ rename to bar
+ --- a/foo
+ +++ b/bar
+ @@ -1,1 +1,3 @@
+ a
+ +b
+ +c
+
+Reversed:
+
+ $ hg diff --git -r -1:-4
+ diff --git a/bar b/foo
+ rename from bar
+ rename to foo
+ --- a/bar
+ +++ b/foo
+ @@ -1,3 +1,1 @@
+ a
+ -b
+ -c
+
+File created after r1 and renamed before r2:
+
+ $ hg diff --git -r -5:-1
+ diff --git a/bar b/bar
+ new file mode 100644
+ --- /dev/null
+ +++ b/bar
+ @@ -0,0 +1,3 @@
+ +a
+ +b
+ +c
+
+Reversed:
+
+ $ hg diff --git -r -1:-5
+ diff --git a/bar b/bar
+ deleted file mode 100644
+ --- a/bar
+ +++ /dev/null
+ @@ -1,3 +0,0 @@
+ -a
+ -b
+ -c
+
+
+Comparing with the working dir:
+
+ $ echo >> start
+ $ hg ci -m 'change start again'
+
+ $ echo > created
+ $ hg add created
+ $ hg ci -m 'add created'
+
+ $ hg mv created created2
+ $ hg ci -m 'mv created created2'
+
+ $ hg mv created2 created3
+
+There's a copy in the working dir:
+
+ $ hg diff --git
+ diff --git a/created2 b/created3
+ rename from created2
+ rename to created3
+
+There's another copy between the original rev and the wd:
+
+ $ hg diff --git -r -2
+ diff --git a/created b/created3
+ rename from created
+ rename to created3
+
+The source of the copy was created after the original rev:
+
+ $ hg diff --git -r -3
+ diff --git a/created3 b/created3
+ new file mode 100644
+ --- /dev/null
+ +++ b/created3
+ @@ -0,0 +1,1 @@
+ +
+ $ hg ci -m 'mv created2 created3'
+
+
+ $ echo > brand-new
+ $ hg add brand-new
+ $ hg ci -m 'add brand-new'
+ $ hg mv brand-new brand-new2
+
+Created in parent of wd; renamed in the wd:
+
+ $ hg diff --git
+ diff --git a/brand-new b/brand-new2
+ rename from brand-new
+ rename to brand-new2
+
+Created between r1 and parent of wd; renamed in the wd:
+
+ $ hg diff --git -r -2
+ diff --git a/brand-new2 b/brand-new2
+ new file mode 100644
+ --- /dev/null
+ +++ b/brand-new2
+ @@ -0,0 +1,1 @@
+ +
+ $ hg ci -m 'mv brand-new brand-new2'
+
+One file is copied to many destinations and removed:
+
+ $ hg cp brand-new2 brand-new3
+ $ hg mv brand-new2 brand-new3-2
+ $ hg ci -m 'multiple renames/copies'
+ $ hg diff --git -r -2 -r -1
+ diff --git a/brand-new2 b/brand-new3
+ rename from brand-new2
+ rename to brand-new3
+ diff --git a/brand-new2 b/brand-new3-2
+ copy from brand-new2
+ copy to brand-new3-2
+
+Reversed:
+
+ $ hg diff --git -r -1 -r -2
+ diff --git a/brand-new3 b/brand-new2
+ rename from brand-new3
+ rename to brand-new2
+ diff --git a/brand-new3-2 b/brand-new3-2
+ deleted file mode 100644
+ --- a/brand-new3-2
+ +++ /dev/null
+ @@ -1,1 +0,0 @@
+ -
+
+There should be a trailing TAB if there are spaces in the file name:
+
+ $ echo foo > 'with spaces'
+ $ hg add 'with spaces'
+ $ hg diff --git
+ diff --git a/with spaces b/with spaces
+ new file mode 100644
+ --- /dev/null
+ +++ b/with spaces
+ @@ -0,0 +1,1 @@
+ +foo
+ $ hg ci -m 'add filename with spaces'
+
--- a/tests/test-git-import Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,230 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-
-echo % new file
-hg import -d "1000000 0" -mnew - <<EOF
-diff --git a/new b/new
-new file mode 100644
-index 0000000..7898192
---- /dev/null
-+++ b/new
-@@ -0,0 +1 @@
-+a
-EOF
-hg tip -q
-
-echo % new empty file
-hg import -d "1000000 0" -mempty - <<EOF
-diff --git a/empty b/empty
-new file mode 100644
-EOF
-hg tip -q
-hg locate empty
-
-echo % chmod +x
-hg import -d "1000000 0" -msetx - <<EOF
-diff --git a/new b/new
-old mode 100644
-new mode 100755
-EOF
-hg tip -q
-
-test -x new || echo failed
-
-echo % copy
-hg import -d "1000000 0" -mcopy - <<EOF
-diff --git a/new b/copy
-old mode 100755
-new mode 100644
-similarity index 100%
-copy from new
-copy to copy
-diff --git a/new b/copyx
-similarity index 100%
-copy from new
-copy to copyx
-EOF
-hg tip -q
-
-if "$TESTDIR/hghave" -q execbit; then
- test -f copy -a ! -x copy || echo failed
- test -x copyx || echo failed
-else
- test -f copy || echo failed
-fi
-cat copy
-hg cat copy
-
-echo % rename
-hg import -d "1000000 0" -mrename - <<EOF
-diff --git a/copy b/rename
-similarity index 100%
-rename from copy
-rename to rename
-EOF
-hg tip -q
-
-hg locate
-
-echo % delete
-hg import -d "1000000 0" -mdelete - <<EOF
-diff --git a/copyx b/copyx
-deleted file mode 100755
-index 7898192..0000000
---- a/copyx
-+++ /dev/null
-@@ -1 +0,0 @@
--a
-EOF
-hg tip -q
-
-hg locate
-test -f copyx && echo failed || true
-
-echo % regular diff
-hg import -d "1000000 0" -mregular - <<EOF
-diff --git a/rename b/rename
-index 7898192..72e1fe3 100644
---- a/rename
-+++ b/rename
-@@ -1 +1,5 @@
- a
-+a
-+a
-+a
-+a
-EOF
-hg tip -q
-
-echo % copy and modify
-hg import -d "1000000 0" -mcopymod - <<EOF
-diff --git a/rename b/copy2
-similarity index 80%
-copy from rename
-copy to copy2
-index 72e1fe3..b53c148 100644
---- a/rename
-+++ b/copy2
-@@ -1,5 +1,5 @@
- a
- a
--a
-+b
- a
- a
-EOF
-hg tip -q
-
-hg cat copy2
-
-echo % rename and modify
-hg import -d "1000000 0" -mrenamemod - <<EOF
-diff --git a/copy2 b/rename2
-similarity index 80%
-rename from copy2
-rename to rename2
-index b53c148..8f81e29 100644
---- a/copy2
-+++ b/rename2
-@@ -1,5 +1,5 @@
- a
- a
- b
--a
-+c
- a
-EOF
-hg tip -q
-
-hg locate copy2
-hg cat rename2
-
-echo % one file renamed multiple times
-hg import -d "1000000 0" -mmultirenames - <<EOF
-diff --git a/rename2 b/rename3
-rename from rename2
-rename to rename3
-diff --git a/rename2 b/rename3-2
-rename from rename2
-rename to rename3-2
-EOF
-hg tip -q
-hg log -vr. --template '{rev} {files} / {file_copies}\n'
-
-hg locate rename2 rename3 rename3-2
-hg cat rename3
-echo
-hg cat rename3-2
-
-echo foo > foo
-hg add foo
-hg ci -m 'add foo'
-echo % binary files and regular patch hunks
-hg import -d "1000000 0" -m binaryregular - <<EOF
-diff --git a/binary b/binary
-new file mode 100644
-index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
-GIT binary patch
-literal 4
-Lc\${NkU|;|M00aO5
-
-diff --git a/foo b/foo2
-rename from foo
-rename to foo2
-EOF
-hg tip -q
-cat foo2
-hg manifest --debug | grep binary
-
-echo % many binary files
-hg import -d "1000000 0" -m multibinary - <<EOF
-diff --git a/mbinary1 b/mbinary1
-new file mode 100644
-index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
-GIT binary patch
-literal 4
-Lc\${NkU|;|M00aO5
-
-diff --git a/mbinary2 b/mbinary2
-new file mode 100644
-index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490
-GIT binary patch
-literal 5
-Mc\${NkU|\`?^000jF3jhEB
-
-EOF
-hg tip -q
-hg manifest --debug | grep mbinary
-
-echo % filenames with spaces
-hg import -d "1000000 0" -m spaces - <<EOF
-diff --git a/foo bar b/foo bar
-new file mode 100644
-index 0000000..257cc56
---- /dev/null
-+++ b/foo bar
-@@ -0,0 +1 @@
-+foo
-EOF
-hg tip -q
-cat "foo bar"
-
-echo % copy then modify the original file
-hg import -d "1000000 0" -m copy-mod-orig - <<EOF
-diff --git a/foo2 b/foo2
-index 257cc56..fe08ec6 100644
---- a/foo2
-+++ b/foo2
-@@ -1 +1,2 @@
- foo
-+new line
-diff --git a/foo2 b/foo3
-similarity index 100%
-copy from foo2
-copy to foo3
-EOF
-hg tip -q
-
-cat foo3
--- a/tests/test-git-import.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-% new file
-applying patch from stdin
-0:ae3ee40d2079
-% new empty file
-applying patch from stdin
-1:ab199dc869b5
-empty
-% chmod +x
-applying patch from stdin
-2:3a34410f282e
-% copy
-applying patch from stdin
-3:37bacb7ca14d
-a
-a
-% rename
-applying patch from stdin
-4:47b81a94361d
-copyx
-empty
-new
-rename
-% delete
-applying patch from stdin
-5:d9b001d98336
-empty
-new
-rename
-% regular diff
-applying patch from stdin
-6:ebe901e7576b
-% copy and modify
-applying patch from stdin
-7:18f368958ecd
-a
-a
-b
-a
-a
-% rename and modify
-applying patch from stdin
-8:c32b0d7e6f44
-a
-a
-b
-c
-a
-% one file renamed multiple times
-applying patch from stdin
-9:034a6bf95330
-9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
-rename3
-rename3-2
-a
-a
-b
-c
-a
-
-a
-a
-b
-c
-a
-% binary files and regular patch hunks
-applying patch from stdin
-11:c39bce63e786
-foo
-045c85ba38952325e126c70962cc0f9d9077bc67 644 binary
-% many binary files
-applying patch from stdin
-12:30b530085242
-045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
-a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2
-% filenames with spaces
-applying patch from stdin
-13:04750ef42fb3
-foo
-% copy then modify the original file
-applying patch from stdin
-14:c4cd9cdeaa74
-foo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-git-import.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,335 @@
+
+ $ hg init
+
+New file:
+
+ $ hg import -d "1000000 0" -mnew - <<EOF
+ > diff --git a/new b/new
+ > new file mode 100644
+ > index 0000000..7898192
+ > --- /dev/null
+ > +++ b/new
+ > @@ -0,0 +1 @@
+ > +a
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 0:ae3ee40d2079
+
+New empty file:
+
+ $ hg import -d "1000000 0" -mempty - <<EOF
+ > diff --git a/empty b/empty
+ > new file mode 100644
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 1:ab199dc869b5
+
+ $ hg locate empty
+ empty
+
+chmod +x:
+
+ $ hg import -d "1000000 0" -msetx - <<EOF
+ > diff --git a/new b/new
+ > old mode 100644
+ > new mode 100755
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 2:3a34410f282e
+
+ $ test -x new || echo failed
+
+Copy:
+
+ $ hg import -d "1000000 0" -mcopy - <<EOF
+ > diff --git a/new b/copy
+ > old mode 100755
+ > new mode 100644
+ > similarity index 100%
+ > copy from new
+ > copy to copy
+ > diff --git a/new b/copyx
+ > similarity index 100%
+ > copy from new
+ > copy to copyx
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 3:37bacb7ca14d
+
+ $ if "$TESTDIR/hghave" -q execbit; then
+ > test -f copy -a ! -x copy || echo failed
+ > test -x copyx || echo failed
+ > else
+ > test -f copy || echo failed
+ > fi
+
+ $ cat copy
+ a
+
+ $ hg cat copy
+ a
+
+Rename:
+
+ $ hg import -d "1000000 0" -mrename - <<EOF
+ > diff --git a/copy b/rename
+ > similarity index 100%
+ > rename from copy
+ > rename to rename
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 4:47b81a94361d
+
+ $ hg locate
+ copyx
+ empty
+ new
+ rename
+
+Delete:
+
+ $ hg import -d "1000000 0" -mdelete - <<EOF
+ > diff --git a/copyx b/copyx
+ > deleted file mode 100755
+ > index 7898192..0000000
+ > --- a/copyx
+ > +++ /dev/null
+ > @@ -1 +0,0 @@
+ > -a
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 5:d9b001d98336
+
+ $ hg locate
+ empty
+ new
+ rename
+
+ $ test -f copyx && echo failed || true
+
+Regular diff:
+
+ $ hg import -d "1000000 0" -mregular - <<EOF
+ > diff --git a/rename b/rename
+ > index 7898192..72e1fe3 100644
+ > --- a/rename
+ > +++ b/rename
+ > @@ -1 +1,5 @@
+ > a
+ > +a
+ > +a
+ > +a
+ > +a
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 6:ebe901e7576b
+
+Copy and modify:
+
+ $ hg import -d "1000000 0" -mcopymod - <<EOF
+ > diff --git a/rename b/copy2
+ > similarity index 80%
+ > copy from rename
+ > copy to copy2
+ > index 72e1fe3..b53c148 100644
+ > --- a/rename
+ > +++ b/copy2
+ > @@ -1,5 +1,5 @@
+ > a
+ > a
+ > -a
+ > +b
+ > a
+ > a
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 7:18f368958ecd
+
+ $ hg cat copy2
+ a
+ a
+ b
+ a
+ a
+
+Rename and modify:
+
+ $ hg import -d "1000000 0" -mrenamemod - <<EOF
+ > diff --git a/copy2 b/rename2
+ > similarity index 80%
+ > rename from copy2
+ > rename to rename2
+ > index b53c148..8f81e29 100644
+ > --- a/copy2
+ > +++ b/rename2
+ > @@ -1,5 +1,5 @@
+ > a
+ > a
+ > b
+ > -a
+ > +c
+ > a
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 8:c32b0d7e6f44
+
+ $ hg locate copy2
+ $ hg cat rename2
+ a
+ a
+ b
+ c
+ a
+
+One file renamed multiple times:
+
+ $ hg import -d "1000000 0" -mmultirenames - <<EOF
+ > diff --git a/rename2 b/rename3
+ > rename from rename2
+ > rename to rename3
+ > diff --git a/rename2 b/rename3-2
+ > rename from rename2
+ > rename to rename3-2
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 9:034a6bf95330
+
+ $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
+ 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
+
+ $ hg locate rename2 rename3 rename3-2
+ rename3
+ rename3-2
+
+ $ hg cat rename3
+ a
+ a
+ b
+ c
+ a
+
+ $ hg cat rename3-2
+ a
+ a
+ b
+ c
+ a
+
+ $ echo foo > foo
+ $ hg add foo
+ $ hg ci -m 'add foo'
+
+Binary files and regular patch hunks:
+
+ $ hg import -d "1000000 0" -m binaryregular - <<EOF
+ > diff --git a/binary b/binary
+ > new file mode 100644
+ > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
+ > GIT binary patch
+ > literal 4
+ > Lc\${NkU|;|M00aO5
+ >
+ > diff --git a/foo b/foo2
+ > rename from foo
+ > rename to foo2
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 11:c39bce63e786
+
+ $ cat foo2
+ foo
+
+ $ hg manifest --debug | grep binary
+ 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary
+
+Multiple binary files:
+
+ $ hg import -d "1000000 0" -m multibinary - <<EOF
+ > diff --git a/mbinary1 b/mbinary1
+ > new file mode 100644
+ > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
+ > GIT binary patch
+ > literal 4
+ > Lc\${NkU|;|M00aO5
+ >
+ > diff --git a/mbinary2 b/mbinary2
+ > new file mode 100644
+ > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490
+ > GIT binary patch
+ > literal 5
+ > Mc\${NkU|\`?^000jF3jhEB
+ >
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 12:30b530085242
+
+ $ hg manifest --debug | grep mbinary
+ 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
+ a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2
+
+Filenames with spaces:
+
+ $ hg import -d "1000000 0" -m spaces - <<EOF
+ > diff --git a/foo bar b/foo bar
+ > new file mode 100644
+ > index 0000000..257cc56
+ > --- /dev/null
+ > +++ b/foo bar
+ > @@ -0,0 +1 @@
+ > +foo
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 13:04750ef42fb3
+
+ $ cat "foo bar"
+ foo
+
+Copy then modify the original file:
+
+ $ hg import -d "1000000 0" -m copy-mod-orig - <<EOF
+ > diff --git a/foo2 b/foo2
+ > index 257cc56..fe08ec6 100644
+ > --- a/foo2
+ > +++ b/foo2
+ > @@ -1 +1,2 @@
+ > foo
+ > +new line
+ > diff --git a/foo2 b/foo3
+ > similarity index 100%
+ > copy from foo2
+ > copy to foo3
+ > EOF
+ applying patch from stdin
+
+ $ hg tip -q
+ 14:c4cd9cdeaa74
+
+ $ cat foo3
+ foo
+
--- a/tests/test-globalopts Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" no-outer-repo || exit 80
-
-hg init a
-cd a
-echo a > a
-hg ci -A -d'1 0' -m a
-
-cd ..
-
-hg init b
-cd b
-echo b > b
-hg ci -A -d'1 0' -m b
-
-cd ..
-
-hg clone a c
-cd c
-hg pull -f ../b
-hg merge
-
-cd ..
-
-echo %% -R/--repository
-hg -R a tip
-hg --repository b tip
-
-echo %% implicit -R
-hg ann a/a
-hg ann a/a a/a
-hg ann a/a b/b
-hg -R b ann a/a
-hg log
-
-echo %% abbrev of long option
-hg --repo c tip
-
-echo "%% earlygetopt with duplicate options (36d23de02da1)"
-hg --cwd a --cwd b --cwd c tip
-hg --repo c --repository b -R a tip
-
-echo "%% earlygetopt short option without following space"
-hg -q -Rb tip
-
-echo "%% earlygetopt with illegal abbreviations"
-hg --confi "foo.bar=baz"
-hg --cw a tip
-hg --rep a tip
-hg --repositor a tip
-hg -qR a tip
-hg -qRa tip
-
-echo %% --cwd
-hg --cwd a parents
-
-echo %% -y/--noninteractive - just be sure it is parsed
-hg --cwd a tip -q --noninteractive
-hg --cwd a tip -q -y
-
-echo %% -q/--quiet
-hg -R a -q tip
-hg -R b -q tip
-hg -R c --quiet parents
-
-echo %% -v/--verbose
-hg --cwd c head -v
-hg --cwd b tip --verbose
-
-echo %% --config
-hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
-hg --cwd c --config '' tip -q
-hg --cwd c --config a.b tip -q
-hg --cwd c --config a tip -q
-hg --cwd c --config a.= tip -q
-hg --cwd c --config .b= tip -q
-
-echo %% --debug
-hg --cwd c log --debug
-
-echo %% --traceback
-hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback'
-
-echo %% --time
-hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g'
-
-echo %% --version
-hg --version -q | sed 's/version [^)]*/version xxx/'
-
-echo %% -h/--help
-hg -h
-hg --help
-
-echo %% not tested: --debugger
-
--- a/tests/test-globalopts.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,292 +0,0 @@
-adding a
-adding b
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../b
-searching for changes
-warning: repository is unrelated
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-%% -R/--repository
-changeset: 0:8580ff50825a
-tag: tip
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: a
-
-changeset: 0:b6c483daf290
-tag: tip
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: b
-
-%% implicit -R
-0: a
-0: a
-abort: There is no Mercurial repository here (.hg not found)!
-abort: a/a not under root
-abort: There is no Mercurial repository here (.hg not found)!
-%% abbrev of long option
-changeset: 1:b6c483daf290
-tag: tip
-parent: -1:000000000000
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: b
-
-%% earlygetopt with duplicate options (36d23de02da1)
-changeset: 1:b6c483daf290
-tag: tip
-parent: -1:000000000000
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: b
-
-changeset: 0:8580ff50825a
-tag: tip
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: a
-
-%% earlygetopt short option without following space
-0:b6c483daf290
-%% earlygetopt with illegal abbreviations
-abort: Option --config may not be abbreviated!
-abort: Option --cwd may not be abbreviated!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
-%% --cwd
-changeset: 0:8580ff50825a
-tag: tip
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: a
-
-%% -y/--noninteractive - just be sure it is parsed
-0:8580ff50825a
-0:8580ff50825a
-%% -q/--quiet
-0:8580ff50825a
-0:b6c483daf290
-0:8580ff50825a
-1:b6c483daf290
-%% -v/--verbose
-changeset: 1:b6c483daf290
-tag: tip
-parent: -1:000000000000
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-files: b
-description:
-b
-
-
-changeset: 0:8580ff50825a
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-files: a
-description:
-a
-
-
-changeset: 0:b6c483daf290
-tag: tip
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-files: b
-description:
-b
-
-
-%% --config
-quuxfoo
-abort: malformed --config option: '' (use --config section.name=value)
-abort: malformed --config option: 'a.b' (use --config section.name=value)
-abort: malformed --config option: 'a' (use --config section.name=value)
-abort: malformed --config option: 'a.=' (use --config section.name=value)
-abort: malformed --config option: '.b=' (use --config section.name=value)
-%% --debug
-changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
-tag: tip
-parent: -1:0000000000000000000000000000000000000000
-parent: -1:0000000000000000000000000000000000000000
-manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-files+: b
-extra: branch=default
-description:
-b
-
-
-changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
-parent: -1:0000000000000000000000000000000000000000
-parent: -1:0000000000000000000000000000000000000000
-manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-files+: a
-extra: branch=default
-description:
-a
-
-
-%% --traceback
-Traceback (most recent call last):
-%% --time
-Time: real x.x secs (user x.x+x.x sys x.x+x.x)
-%% --version
-Mercurial Distributed SCM (version xxx)
-%% -h/--help
-Mercurial Distributed SCM
-
-list of commands:
-
- add add the specified files on the next commit
- addremove add all new files, delete all missing files
- annotate show changeset information by line for each file
- archive create an unversioned archive of a repository revision
- backout reverse effect of earlier changeset
- bisect subdivision search of changesets
- branch set or show the current branch name
- branches list repository named branches
- bundle create a changegroup file
- cat output the current or given revision of files
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- copy mark files as copied for the next commit
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- grep search for a pattern in specified files and revisions
- heads show current repository heads or show branch heads
- help show help for a given topic or a help overview
- identify identify the working copy 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
- locate locate files matching specific patterns
- log show revision history of entire repository or files
- manifest output the current or given revision of the project manifest
- merge merge working directory with another revision
- outgoing show changesets not found in the destination
- parents show the parents of the working directory or revision
- paths show aliases for remote repositories
- pull pull changes from the specified source
- push push changes to the specified destination
- recover roll back an interrupted transaction
- remove remove the specified files on the next commit
- rename rename files; equivalent of copy + remove
- resolve redo merges or set/view the merge status of files
- revert restore individual files or directories to an earlier state
- rollback roll back the last transaction (dangerous)
- root print the root (top) of the current working directory
- serve start stand-alone webserver
- showconfig show combined config settings from all hgrc files
- status show changed files in the working directory
- summary summarize working directory state
- tag add one or more tags for the current or given revision
- tags list repository tags
- tip show the tip revision
- unbundle apply one or more changegroup files
- update update working directory (or switch revisions)
- verify verify the integrity of the repository
- version output version and copyright information
-
-additional help topics:
-
- config Configuration Files
- dates Date Formats
- patterns File Name Patterns
- environment Environment Variables
- revisions Specifying Single Revisions
- multirevs Specifying Multiple Revisions
- revsets Specifying Revision Sets
- diffs Diff Formats
- templating Template Usage
- urls URL Paths
- extensions Using additional features
- hgweb Configuring hgweb
- glossary Glossary
-
-use "hg -v help" to show aliases and global options
-Mercurial Distributed SCM
-
-list of commands:
-
- add add the specified files on the next commit
- addremove add all new files, delete all missing files
- annotate show changeset information by line for each file
- archive create an unversioned archive of a repository revision
- backout reverse effect of earlier changeset
- bisect subdivision search of changesets
- branch set or show the current branch name
- branches list repository named branches
- bundle create a changegroup file
- cat output the current or given revision of files
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- copy mark files as copied for the next commit
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- grep search for a pattern in specified files and revisions
- heads show current repository heads or show branch heads
- help show help for a given topic or a help overview
- identify identify the working copy 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
- locate locate files matching specific patterns
- log show revision history of entire repository or files
- manifest output the current or given revision of the project manifest
- merge merge working directory with another revision
- outgoing show changesets not found in the destination
- parents show the parents of the working directory or revision
- paths show aliases for remote repositories
- pull pull changes from the specified source
- push push changes to the specified destination
- recover roll back an interrupted transaction
- remove remove the specified files on the next commit
- rename rename files; equivalent of copy + remove
- resolve redo merges or set/view the merge status of files
- revert restore individual files or directories to an earlier state
- rollback roll back the last transaction (dangerous)
- root print the root (top) of the current working directory
- serve start stand-alone webserver
- showconfig show combined config settings from all hgrc files
- status show changed files in the working directory
- summary summarize working directory state
- tag add one or more tags for the current or given revision
- tags list repository tags
- tip show the tip revision
- unbundle apply one or more changegroup files
- update update working directory (or switch revisions)
- verify verify the integrity of the repository
- version output version and copyright information
-
-additional help topics:
-
- config Configuration Files
- dates Date Formats
- patterns File Name Patterns
- environment Environment Variables
- revisions Specifying Single Revisions
- multirevs Specifying Multiple Revisions
- revsets Specifying Revision Sets
- diffs Diff Formats
- templating Template Usage
- urls URL Paths
- extensions Using additional features
- hgweb Configuring hgweb
- glossary Glossary
-
-use "hg -v help" to show aliases and global options
-%% not tested: --debugger
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-globalopts.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,387 @@
+ $ "$TESTDIR/hghave" no-outer-repo || exit 80
+
+ $ hg init a
+ $ cd a
+ $ echo a > a
+ $ hg ci -A -d'1 0' -m a
+ adding a
+
+ $ cd ..
+
+ $ hg init b
+ $ cd b
+ $ echo b > b
+ $ hg ci -A -d'1 0' -m b
+ adding b
+
+ $ cd ..
+
+ $ hg clone a c
+ updating to branch default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cd c
+ $ hg pull -f ../b
+ pulling from ../b
+ searching for changes
+ warning: repository is unrelated
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files (+1 heads)
+ (run 'hg heads' to see heads, 'hg merge' to merge)
+ $ hg merge
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ cd ..
+
+Testing -R/--repository:
+
+ $ hg -R a tip
+ changeset: 0:8580ff50825a
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: a
+
+ $ hg --repository b tip
+ changeset: 0:b6c483daf290
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: b
+
+
+Implicit -R:
+
+ $ hg ann a/a
+ 0: a
+ $ hg ann a/a a/a
+ 0: a
+ $ hg ann a/a b/b
+ abort: There is no Mercurial repository here (.hg not found)!
+ $ hg -R b ann a/a
+ abort: a/a not under root
+ $ hg log
+ abort: There is no Mercurial repository here (.hg not found)!
+
+Abbreviation of long option:
+
+ $ hg --repo c tip
+ changeset: 1:b6c483daf290
+ tag: tip
+ parent: -1:000000000000
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: b
+
+
+earlygetopt with duplicate options (36d23de02da1):
+
+ $ hg --cwd a --cwd b --cwd c tip
+ changeset: 1:b6c483daf290
+ tag: tip
+ parent: -1:000000000000
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: b
+
+ $ hg --repo c --repository b -R a tip
+ changeset: 0:8580ff50825a
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: a
+
+
+earlygetopt short option without following space:
+
+ $ hg -q -Rb tip
+ 0:b6c483daf290
+
+earlygetopt with illegal abbreviations:
+
+ $ hg --confi "foo.bar=baz"
+ abort: option --config may not be abbreviated!
+ $ hg --cw a tip
+ abort: option --cwd may not be abbreviated!
+ $ hg --rep a tip
+ abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+ $ hg --repositor a tip
+ abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+ $ hg -qR a tip
+ abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+ $ hg -qRa tip
+ abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
+
+Testing --cwd:
+
+ $ hg --cwd a parents
+ changeset: 0:8580ff50825a
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ summary: a
+
+
+Testing -y/--noninteractive - just be sure it is parsed:
+
+ $ hg --cwd a tip -q --noninteractive
+ 0:8580ff50825a
+ $ hg --cwd a tip -q -y
+ 0:8580ff50825a
+
+Testing -q/--quiet:
+
+ $ hg -R a -q tip
+ 0:8580ff50825a
+ $ hg -R b -q tip
+ 0:b6c483daf290
+ $ hg -R c --quiet parents
+ 0:8580ff50825a
+ 1:b6c483daf290
+
+Testing -v/--verbose:
+
+ $ hg --cwd c head -v
+ changeset: 1:b6c483daf290
+ tag: tip
+ parent: -1:000000000000
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ files: b
+ description:
+ b
+
+
+ changeset: 0:8580ff50825a
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ files: a
+ description:
+ a
+
+
+ $ hg --cwd b tip --verbose
+ changeset: 0:b6c483daf290
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ files: b
+ description:
+ b
+
+
+
+Testing --config:
+
+ $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
+ quuxfoo
+ $ hg --cwd c --config '' tip -q
+ abort: malformed --config option: '' (use --config section.name=value)
+ $ hg --cwd c --config a.b tip -q
+ abort: malformed --config option: 'a.b' (use --config section.name=value)
+ $ hg --cwd c --config a tip -q
+ abort: malformed --config option: 'a' (use --config section.name=value)
+ $ hg --cwd c --config a.= tip -q
+ abort: malformed --config option: 'a.=' (use --config section.name=value)
+ $ hg --cwd c --config .b= tip -q
+ abort: malformed --config option: '.b=' (use --config section.name=value)
+
+Testing --debug:
+
+ $ hg --cwd c log --debug
+ changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
+ tag: tip
+ parent: -1:0000000000000000000000000000000000000000
+ parent: -1:0000000000000000000000000000000000000000
+ manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ files+: b
+ extra: branch=default
+ description:
+ b
+
+
+ changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
+ parent: -1:0000000000000000000000000000000000000000
+ parent: -1:0000000000000000000000000000000000000000
+ manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
+ user: test
+ date: Thu Jan 01 00:00:01 1970 +0000
+ files+: a
+ extra: branch=default
+ description:
+ a
+
+
+
+Testing --traceback:
+
+ $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
+ Traceback (most recent call last):
+
+Testing --time:
+
+ $ hg --cwd a --time id
+ 8580ff50825a tip
+ Time: real .*
+
+Testing --version:
+
+ $ hg --version -q
+ Mercurial Distributed SCM .*
+
+Testing -h/--help:
+
+ $ hg -h
+ Mercurial Distributed SCM
+
+ list of commands:
+
+ add add the specified files on the next commit
+ addremove add all new files, delete all missing files
+ annotate show changeset information by line for each file
+ archive create an unversioned archive of a repository revision
+ backout reverse effect of earlier changeset
+ bisect subdivision search of changesets
+ branch set or show the current branch name
+ branches list repository named branches
+ bundle create a changegroup file
+ cat output the current or given revision of files
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ copy mark files as copied for the next commit
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ grep search for a pattern in specified files and revisions
+ heads show current repository heads or show branch heads
+ help show help for a given topic or a help overview
+ identify identify the working copy 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
+ locate locate files matching specific patterns
+ log show revision history of entire repository or files
+ manifest output the current or given revision of the project manifest
+ merge merge working directory with another revision
+ outgoing show changesets not found in the destination
+ parents show the parents of the working directory or revision
+ paths show aliases for remote repositories
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ recover roll back an interrupted transaction
+ remove remove the specified files on the next commit
+ rename rename files; equivalent of copy + remove
+ resolve redo merges or set/view the merge status of files
+ revert restore individual files or directories to an earlier state
+ rollback roll back the last transaction (dangerous)
+ root print the root (top) of the current working directory
+ serve start stand-alone webserver
+ showconfig show combined config settings from all hgrc files
+ status show changed files in the working directory
+ summary summarize working directory state
+ tag add one or more tags for the current or given revision
+ tags list repository tags
+ tip show the tip revision
+ unbundle apply one or more changegroup files
+ update update working directory (or switch revisions)
+ verify verify the integrity of the repository
+ version output version and copyright information
+
+ additional help topics:
+
+ config Configuration Files
+ dates Date Formats
+ patterns File Name Patterns
+ environment Environment Variables
+ revisions Specifying Single Revisions
+ multirevs Specifying Multiple Revisions
+ revsets Specifying Revision Sets
+ diffs Diff Formats
+ templating Template Usage
+ urls URL Paths
+ extensions Using additional features
+ hgweb Configuring hgweb
+ glossary Glossary
+
+ use "hg -v help" to show aliases and global options
+
+ $ hg --help
+ Mercurial Distributed SCM
+
+ list of commands:
+
+ add add the specified files on the next commit
+ addremove add all new files, delete all missing files
+ annotate show changeset information by line for each file
+ archive create an unversioned archive of a repository revision
+ backout reverse effect of earlier changeset
+ bisect subdivision search of changesets
+ branch set or show the current branch name
+ branches list repository named branches
+ bundle create a changegroup file
+ cat output the current or given revision of files
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ copy mark files as copied for the next commit
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ grep search for a pattern in specified files and revisions
+ heads show current repository heads or show branch heads
+ help show help for a given topic or a help overview
+ identify identify the working copy 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
+ locate locate files matching specific patterns
+ log show revision history of entire repository or files
+ manifest output the current or given revision of the project manifest
+ merge merge working directory with another revision
+ outgoing show changesets not found in the destination
+ parents show the parents of the working directory or revision
+ paths show aliases for remote repositories
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ recover roll back an interrupted transaction
+ remove remove the specified files on the next commit
+ rename rename files; equivalent of copy + remove
+ resolve redo merges or set/view the merge status of files
+ revert restore individual files or directories to an earlier state
+ rollback roll back the last transaction (dangerous)
+ root print the root (top) of the current working directory
+ serve start stand-alone webserver
+ showconfig show combined config settings from all hgrc files
+ status show changed files in the working directory
+ summary summarize working directory state
+ tag add one or more tags for the current or given revision
+ tags list repository tags
+ tip show the tip revision
+ unbundle apply one or more changegroup files
+ update update working directory (or switch revisions)
+ verify verify the integrity of the repository
+ version output version and copyright information
+
+ additional help topics:
+
+ config Configuration Files
+ dates Date Formats
+ patterns File Name Patterns
+ environment Environment Variables
+ revisions Specifying Single Revisions
+ multirevs Specifying Multiple Revisions
+ revsets Specifying Revision Sets
+ diffs Diff Formats
+ templating Template Usage
+ urls URL Paths
+ extensions Using additional features
+ hgweb Configuring hgweb
+ glossary Glossary
+
+ use "hg -v help" to show aliases and global options
+
+Not tested: --debugger
+
--- a/tests/test-help Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-hg
-hg -q
-hg help
-hg -q help
-
-echo %% test short command list with verbose option
-hg -v help shortlist | sed 's/[(]version [^)]*[)]/(version xxx)/'
-
-hg add -h
-
-echo %% verbose help for add
-hg add -hv
-
-echo %% test help option with version option
-hg add -h --version | sed 's/[(]version [^)]*[)]/(version xxx)/'
-
-hg add --skjdfks
-
-echo %% test ambiguous command help
-hg help ad
-
-echo %% test command without options
-hg help verify
-
-hg help diff
-hg help status
-hg -q help status
-hg help foo
-hg skjdfks
-
-cat > helpext.py <<EOF
-import os
-from mercurial import commands
-
-def nohelp(ui, *args, **kwargs):
- pass
-
-cmdtable = {
- "nohelp": (nohelp, [], "hg nohelp"),
-}
-
-commands.norepo += ' nohelp'
-EOF
-abspath=`pwd`/helpext.py
-
-echo '[extensions]' >> $HGRCPATH
-echo "helpext = $abspath" >> $HGRCPATH
-
-echo %% test command with no help text
-hg help nohelp
-
-echo %% test that default list of commands omits extension commands
-hg help
-
-echo %% test list of commands with command with no help text
-hg help helpext
-
-echo %% test a help topic
-hg help revs
-
-exit 0
--- a/tests/test-help.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,678 +0,0 @@
-Mercurial Distributed SCM
-
-basic commands:
-
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
-Mercurial Distributed SCM
-
-list of commands:
-
- add add the specified files on the next commit
- addremove add all new files, delete all missing files
- annotate show changeset information by line for each file
- archive create an unversioned archive of a repository revision
- backout reverse effect of earlier changeset
- bisect subdivision search of changesets
- branch set or show the current branch name
- branches list repository named branches
- bundle create a changegroup file
- cat output the current or given revision of files
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- copy mark files as copied for the next commit
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- grep search for a pattern in specified files and revisions
- heads show current repository heads or show branch heads
- help show help for a given topic or a help overview
- identify identify the working copy 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
- locate locate files matching specific patterns
- log show revision history of entire repository or files
- manifest output the current or given revision of the project manifest
- merge merge working directory with another revision
- outgoing show changesets not found in the destination
- parents show the parents of the working directory or revision
- paths show aliases for remote repositories
- pull pull changes from the specified source
- push push changes to the specified destination
- recover roll back an interrupted transaction
- remove remove the specified files on the next commit
- rename rename files; equivalent of copy + remove
- resolve redo merges or set/view the merge status of files
- revert restore individual files or directories to an earlier state
- rollback roll back the last transaction (dangerous)
- root print the root (top) of the current working directory
- serve start stand-alone webserver
- showconfig show combined config settings from all hgrc files
- status show changed files in the working directory
- summary summarize working directory state
- tag add one or more tags for the current or given revision
- tags list repository tags
- tip show the tip revision
- unbundle apply one or more changegroup files
- update update working directory (or switch revisions)
- verify verify the integrity of the repository
- version output version and copyright information
-
-additional help topics:
-
- config Configuration Files
- dates Date Formats
- patterns File Name Patterns
- environment Environment Variables
- revisions Specifying Single Revisions
- multirevs Specifying Multiple Revisions
- revsets Specifying Revision Sets
- diffs Diff Formats
- templating Template Usage
- urls URL Paths
- extensions Using additional features
- hgweb Configuring hgweb
- glossary Glossary
-
-use "hg -v help" to show aliases and global options
- add add the specified files on the next commit
- addremove add all new files, delete all missing files
- annotate show changeset information by line for each file
- archive create an unversioned archive of a repository revision
- backout reverse effect of earlier changeset
- bisect subdivision search of changesets
- branch set or show the current branch name
- branches list repository named branches
- bundle create a changegroup file
- cat output the current or given revision of files
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- copy mark files as copied for the next commit
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- grep search for a pattern in specified files and revisions
- heads show current repository heads or show branch heads
- help show help for a given topic or a help overview
- identify identify the working copy 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
- locate locate files matching specific patterns
- log show revision history of entire repository or files
- manifest output the current or given revision of the project manifest
- merge merge working directory with another revision
- outgoing show changesets not found in the destination
- parents show the parents of the working directory or revision
- paths show aliases for remote repositories
- pull pull changes from the specified source
- push push changes to the specified destination
- recover roll back an interrupted transaction
- remove remove the specified files on the next commit
- rename rename files; equivalent of copy + remove
- resolve redo merges or set/view the merge status of files
- revert restore individual files or directories to an earlier state
- rollback roll back the last transaction (dangerous)
- root print the root (top) of the current working directory
- serve start stand-alone webserver
- showconfig show combined config settings from all hgrc files
- status show changed files in the working directory
- summary summarize working directory state
- tag add one or more tags for the current or given revision
- tags list repository tags
- tip show the tip revision
- unbundle apply one or more changegroup files
- update update working directory (or switch revisions)
- verify verify the integrity of the repository
- version output version and copyright information
-
-additional help topics:
-
- config Configuration Files
- dates Date Formats
- patterns File Name Patterns
- environment Environment Variables
- revisions Specifying Single Revisions
- multirevs Specifying Multiple Revisions
- revsets Specifying Revision Sets
- diffs Diff Formats
- templating Template Usage
- urls URL Paths
- extensions Using additional features
- hgweb Configuring hgweb
- glossary Glossary
-%% test short command list with verbose option
-Mercurial Distributed SCM (version xxx)
-
-Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> 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.
-
-basic commands:
-
- add:
- add the specified files on the next commit
- annotate, blame:
- show changeset information by line for each file
- clone:
- make a copy of an existing repository
- commit, ci:
- commit the specified files or all outstanding changes
- diff:
- diff repository (or selected files)
- export:
- dump the header and diffs for one or more changesets
- forget:
- forget the specified files on the next commit
- init:
- create a new repository in the given directory
- log, history:
- show revision history of entire repository or files
- merge:
- merge working directory with another revision
- pull:
- pull changes from the specified source
- push:
- push changes to the specified destination
- remove, rm:
- remove the specified files on the next commit
- serve:
- start stand-alone webserver
- status, st:
- show changed files in the working directory
- summary, sum:
- summarize working directory state
- update, up, checkout, co:
- update working directory (or switch revisions)
-
-global options:
- -R --repository REPO repository root directory or name of overlay bundle
- file
- --cwd DIR change working directory
- -y --noninteractive do not prompt, assume 'yes' for any required answers
- -q --quiet suppress output
- -v --verbose enable additional output
- --config CONFIG [+] set/override config option (use 'section.name=value')
- --debug enable debugging output
- --debugger start debugger
- --encoding ENCODE set the charset encoding (default: ascii)
- --encodingmode MODE set the charset encoding mode (default: strict)
- --traceback always print a traceback on exception
- --time time how long the command takes
- --profile print command execution profile
- --version output version information and exit
- -h --help display help and exit
-
-[+] marked option can be specified multiple times
-
-use "hg help" for the full list of commands
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
- Schedule files to be version controlled and added to the repository.
-
- The files will be added to the repository at the next commit. To undo an
- add before that, see "hg forget".
-
- If no names are given, add all files to the repository.
-
- Returns 0 if all files are successfully added.
-
-use "hg -v help add" to show verbose help
-
-options:
-
- -I --include PATTERN [+] include names matching the given patterns
- -X --exclude PATTERN [+] exclude names matching the given patterns
- -n --dry-run do not perform actions, just print output
-
-[+] marked option can be specified multiple times
-
-use "hg -v help add" to show global options
-%% verbose help for add
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
- Schedule files to be version controlled and added to the repository.
-
- The files will be added to the repository at the next commit. To undo an
- add before that, see "hg forget".
-
- If no names are given, add all files to the repository.
-
- An example showing how new (unknown) files are added automatically by "hg
- add":
-
- $ ls
- foo.c
- $ hg status
- ? foo.c
- $ hg add
- adding foo.c
- $ hg status
- A foo.c
-
- Returns 0 if all files are successfully added.
-
-options:
-
- -I --include PATTERN [+] include names matching the given patterns
- -X --exclude PATTERN [+] exclude names matching the given patterns
- -n --dry-run do not perform actions, just print output
-
-global options:
- -R --repository REPO repository root directory or name of overlay bundle
- file
- --cwd DIR change working directory
- -y --noninteractive do not prompt, assume 'yes' for any required
- answers
- -q --quiet suppress output
- -v --verbose enable additional output
- --config CONFIG [+] set/override config option (use
- 'section.name=value')
- --debug enable debugging output
- --debugger start debugger
- --encoding ENCODE set the charset encoding (default: ascii)
- --encodingmode MODE set the charset encoding mode (default: strict)
- --traceback always print a traceback on exception
- --time time how long the command takes
- --profile print command execution profile
- --version output version information and exit
- -h --help display help and exit
-
-[+] marked option can be specified multiple times
-%% test help option with version option
-Mercurial Distributed SCM (version xxx)
-
-Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> 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.
-
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
- Schedule files to be version controlled and added to the repository.
-
- The files will be added to the repository at the next commit. To undo an
- add before that, see "hg forget".
-
- If no names are given, add all files to the repository.
-
- Returns 0 if all files are successfully added.
-
-use "hg -v help add" to show verbose help
-
-options:
-
- -I --include PATTERN [+] include names matching the given patterns
- -X --exclude PATTERN [+] exclude names matching the given patterns
- -n --dry-run do not perform actions, just print output
-
-[+] marked option can be specified multiple times
-
-use "hg -v help add" to show global options
-hg add: option --skjdfks not recognized
-hg add [OPTION]... [FILE]...
-
-add the specified files on the next commit
-
- Schedule files to be version controlled and added to the repository.
-
- The files will be added to the repository at the next commit. To undo an
- add before that, see "hg forget".
-
- If no names are given, add all files to the repository.
-
- Returns 0 if all files are successfully added.
-
-use "hg -v help add" to show verbose help
-
-options:
-
- -I --include PATTERN [+] include names matching the given patterns
- -X --exclude PATTERN [+] exclude names matching the given patterns
- -n --dry-run do not perform actions, just print output
-
-[+] marked option can be specified multiple times
-
-use "hg -v help add" to show global options
-%% test ambiguous command help
-list of commands:
-
- add add the specified files on the next commit
- addremove add all new files, delete all missing files
-
-use "hg -v help ad" to show aliases and global options
-%% test command without options
-hg verify
-
-verify the integrity of the repository
-
- Verify the integrity of the current repository.
-
- This will perform an extensive check of the repository's integrity,
- validating the hashes and checksums of each entry in the changelog,
- manifest, and tracked files, as well as the integrity of their crosslinks
- and indices.
-
- Returns 0 on success, 1 if errors are encountered.
-
-use "hg -v help verify" to show global options
-hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
-
-diff repository (or selected files)
-
- Show differences between revisions for the specified files.
-
- Differences between files are shown using the unified diff format.
-
- NOTE: diff may generate unexpected results for merges, as it will default
- to comparing against the working directory's first parent changeset if no
- revisions are specified.
-
- When two revision arguments are given, then changes are shown between
- those revisions. If only one revision is specified then that revision is
- compared to the working directory, and, when no revisions are specified,
- the working directory files are compared to its parent.
-
- Alternatively you can specify -c/--change with a revision to see the
- changes in that changeset relative to its first parent.
-
- Without the -a/--text option, diff will avoid generating diffs of files it
- detects as binary. With -a, diff will generate a diff anyway, probably
- with undesirable results.
-
- Use the -g/--git option to generate diffs in the git extended diff format.
- For more information, read "hg help diffs".
-
- Returns 0 on success.
-
-options:
-
- -r --rev REV [+] revision
- -c --change REV change made by revision
- -a --text treat all files as text
- -g --git use git extended diff format
- --nodates omit dates from diff headers
- -p --show-function show which function each change is in
- --reverse produce a diff that undoes the changes
- -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
- -U --unified NUM number of lines of context to show
- --stat output diffstat-style summary of changes
- -I --include PATTERN [+] include names matching the given patterns
- -X --exclude PATTERN [+] exclude names matching the given patterns
-
-[+] marked option can be specified multiple times
-
-use "hg -v help diff" to show global options
-hg status [OPTION]... [FILE]...
-
-aliases: st
-
-show changed files in the working directory
-
- Show status of files in the repository. If names are given, only files
- that match are shown. Files that are clean or ignored or the source of a
- copy/move operation, are not listed unless -c/--clean, -i/--ignored,
- -C/--copies or -A/--all are given. Unless options described with "show
- only ..." are given, the options -mardu are used.
-
- Option -q/--quiet hides untracked (unknown and ignored) files unless
- explicitly requested with -u/--unknown or -i/--ignored.
-
- NOTE: status may appear to disagree with diff if permissions have changed
- or a merge has occurred. The standard diff format does not report
- permission changes and diff only reports changes relative to one merge
- parent.
-
- If one revision is given, it is used as the base revision. If two
- revisions are given, the differences between them are shown. The --change
- option can also be used as a shortcut to list the changed files of a
- revision from its first parent.
-
- The codes used to show the status of files are:
-
- M = modified
- A = added
- R = removed
- C = clean
- ! = missing (deleted by non-hg command, but still tracked)
- ? = not tracked
- I = ignored
- = origin of the previous file listed as A (added)
-
- Returns 0 on success.
-
-options:
-
- -A --all show status of all files
- -m --modified show only modified files
- -a --added show only added files
- -r --removed show only removed files
- -d --deleted show only deleted (but tracked) files
- -c --clean show only files without changes
- -u --unknown show only unknown (not tracked) files
- -i --ignored show only ignored files
- -n --no-status hide status prefix
- -C --copies show source of copied files
- -0 --print0 end filenames with NUL, for use with xargs
- --rev REV [+] show difference from revision
- --change REV list the changed files of a revision
- -I --include PATTERN [+] include names matching the given patterns
- -X --exclude PATTERN [+] exclude names matching the given patterns
-
-[+] marked option can be specified multiple times
-
-use "hg -v help status" to show global options
-hg status [OPTION]... [FILE]...
-
-show changed files in the working directory
-hg: unknown command 'foo'
-Mercurial Distributed SCM
-
-basic commands:
-
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-hg: unknown command 'skjdfks'
-Mercurial Distributed SCM
-
-basic commands:
-
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-%% test command with no help text
-hg nohelp
-
-(no help text available)
-
-use "hg -v help nohelp" to show global options
-%% test that default list of commands omits extension commands
-Mercurial Distributed SCM
-
-list of commands:
-
- add add the specified files on the next commit
- addremove add all new files, delete all missing files
- annotate show changeset information by line for each file
- archive create an unversioned archive of a repository revision
- backout reverse effect of earlier changeset
- bisect subdivision search of changesets
- branch set or show the current branch name
- branches list repository named branches
- bundle create a changegroup file
- cat output the current or given revision of files
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- copy mark files as copied for the next commit
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- grep search for a pattern in specified files and revisions
- heads show current repository heads or show branch heads
- help show help for a given topic or a help overview
- identify identify the working copy 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
- locate locate files matching specific patterns
- log show revision history of entire repository or files
- manifest output the current or given revision of the project manifest
- merge merge working directory with another revision
- outgoing show changesets not found in the destination
- parents show the parents of the working directory or revision
- paths show aliases for remote repositories
- pull pull changes from the specified source
- push push changes to the specified destination
- recover roll back an interrupted transaction
- remove remove the specified files on the next commit
- rename rename files; equivalent of copy + remove
- resolve redo merges or set/view the merge status of files
- revert restore individual files or directories to an earlier state
- rollback roll back the last transaction (dangerous)
- root print the root (top) of the current working directory
- serve start stand-alone webserver
- showconfig show combined config settings from all hgrc files
- status show changed files in the working directory
- summary summarize working directory state
- tag add one or more tags for the current or given revision
- tags list repository tags
- tip show the tip revision
- unbundle apply one or more changegroup files
- update update working directory (or switch revisions)
- verify verify the integrity of the repository
- version output version and copyright information
-
-enabled extensions:
-
- helpext (no help text available)
-
-additional help topics:
-
- config Configuration Files
- dates Date Formats
- patterns File Name Patterns
- environment Environment Variables
- revisions Specifying Single Revisions
- multirevs Specifying Multiple Revisions
- revsets Specifying Revision Sets
- diffs Diff Formats
- templating Template Usage
- urls URL Paths
- extensions Using additional features
- hgweb Configuring hgweb
- glossary Glossary
-
-use "hg -v help" to show aliases and global options
-%% test list of commands with command with no help text
-helpext extension - no help text available
-
-list of commands:
-
- nohelp (no help text available)
-
-use "hg -v help helpext" to show aliases and global options
-%% test a help topic
-Specifying Single Revisions
-
- Mercurial supports several ways to specify individual revisions.
-
- A plain integer is treated as a revision number. Negative integers are
- treated as sequential offsets from the tip, with -1 denoting the tip, -2
- denoting the revision prior to the tip, and so forth.
-
- A 40-digit hexadecimal string is treated as a unique revision identifier.
-
- A hexadecimal string less than 40 characters long is treated as a unique
- revision identifier and is referred to as a short-form identifier. A
- short-form identifier is only valid if it is the prefix of exactly one
- full-length identifier.
-
- Any other string is treated as a tag or branch name. A tag name is a
- symbolic name associated with a revision identifier. A branch name denotes
- the tipmost revision of that branch. Tag and branch names must not contain
- the ":" character.
-
- The reserved name "tip" is a special tag that always identifies the most
- recent revision.
-
- The reserved name "null" indicates the null revision. This is the revision
- of an empty repository, and the parent of revision 0.
-
- The reserved name "." indicates the working directory parent. If no
- working directory is checked out, it is equivalent to null. If an
- uncommitted merge is in progress, "." is the revision of the first parent.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-help.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,746 @@
+#!/bin/sh
+
+ $ hg
+ Mercurial Distributed SCM
+
+ basic commands:
+
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
+
+ use "hg help" for the full list of commands or "hg -v" for details
+
+ $ hg -q
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
+
+ $ hg help
+ Mercurial Distributed SCM
+
+ list of commands:
+
+ add add the specified files on the next commit
+ addremove add all new files, delete all missing files
+ annotate show changeset information by line for each file
+ archive create an unversioned archive of a repository revision
+ backout reverse effect of earlier changeset
+ bisect subdivision search of changesets
+ branch set or show the current branch name
+ branches list repository named branches
+ bundle create a changegroup file
+ cat output the current or given revision of files
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ copy mark files as copied for the next commit
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ grep search for a pattern in specified files and revisions
+ heads show current repository heads or show branch heads
+ help show help for a given topic or a help overview
+ identify identify the working copy 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
+ locate locate files matching specific patterns
+ log show revision history of entire repository or files
+ manifest output the current or given revision of the project manifest
+ merge merge working directory with another revision
+ outgoing show changesets not found in the destination
+ parents show the parents of the working directory or revision
+ paths show aliases for remote repositories
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ recover roll back an interrupted transaction
+ remove remove the specified files on the next commit
+ rename rename files; equivalent of copy + remove
+ resolve redo merges or set/view the merge status of files
+ revert restore individual files or directories to an earlier state
+ rollback roll back the last transaction (dangerous)
+ root print the root (top) of the current working directory
+ serve start stand-alone webserver
+ showconfig show combined config settings from all hgrc files
+ status show changed files in the working directory
+ summary summarize working directory state
+ tag add one or more tags for the current or given revision
+ tags list repository tags
+ tip show the tip revision
+ unbundle apply one or more changegroup files
+ update update working directory (or switch revisions)
+ verify verify the integrity of the repository
+ version output version and copyright information
+
+ additional help topics:
+
+ config Configuration Files
+ dates Date Formats
+ patterns File Name Patterns
+ environment Environment Variables
+ revisions Specifying Single Revisions
+ multirevs Specifying Multiple Revisions
+ revsets Specifying Revision Sets
+ diffs Diff Formats
+ templating Template Usage
+ urls URL Paths
+ extensions Using additional features
+ hgweb Configuring hgweb
+ glossary Glossary
+
+ use "hg -v help" to show aliases and global options
+
+ $ hg -q help
+ add add the specified files on the next commit
+ addremove add all new files, delete all missing files
+ annotate show changeset information by line for each file
+ archive create an unversioned archive of a repository revision
+ backout reverse effect of earlier changeset
+ bisect subdivision search of changesets
+ branch set or show the current branch name
+ branches list repository named branches
+ bundle create a changegroup file
+ cat output the current or given revision of files
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ copy mark files as copied for the next commit
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ grep search for a pattern in specified files and revisions
+ heads show current repository heads or show branch heads
+ help show help for a given topic or a help overview
+ identify identify the working copy 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
+ locate locate files matching specific patterns
+ log show revision history of entire repository or files
+ manifest output the current or given revision of the project manifest
+ merge merge working directory with another revision
+ outgoing show changesets not found in the destination
+ parents show the parents of the working directory or revision
+ paths show aliases for remote repositories
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ recover roll back an interrupted transaction
+ remove remove the specified files on the next commit
+ rename rename files; equivalent of copy + remove
+ resolve redo merges or set/view the merge status of files
+ revert restore individual files or directories to an earlier state
+ rollback roll back the last transaction (dangerous)
+ root print the root (top) of the current working directory
+ serve start stand-alone webserver
+ showconfig show combined config settings from all hgrc files
+ status show changed files in the working directory
+ summary summarize working directory state
+ tag add one or more tags for the current or given revision
+ tags list repository tags
+ tip show the tip revision
+ unbundle apply one or more changegroup files
+ update update working directory (or switch revisions)
+ verify verify the integrity of the repository
+ version output version and copyright information
+
+ additional help topics:
+
+ config Configuration Files
+ dates Date Formats
+ patterns File Name Patterns
+ environment Environment Variables
+ revisions Specifying Single Revisions
+ multirevs Specifying Multiple Revisions
+ revsets Specifying Revision Sets
+ diffs Diff Formats
+ templating Template Usage
+ urls URL Paths
+ extensions Using additional features
+ hgweb Configuring hgweb
+ glossary Glossary
+
+Test short command list with verbose option
+
+ $ hg -v help shortlist
+ Mercurial Distributed SCM \(version .*?\)
+
+ Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> 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.
+
+ basic commands:
+
+ add:
+ add the specified files on the next commit
+ annotate, blame:
+ show changeset information by line for each file
+ clone:
+ make a copy of an existing repository
+ commit, ci:
+ commit the specified files or all outstanding changes
+ diff:
+ diff repository (or selected files)
+ export:
+ dump the header and diffs for one or more changesets
+ forget:
+ forget the specified files on the next commit
+ init:
+ create a new repository in the given directory
+ log, history:
+ show revision history of entire repository or files
+ merge:
+ merge working directory with another revision
+ pull:
+ pull changes from the specified source
+ push:
+ push changes to the specified destination
+ remove, rm:
+ remove the specified files on the next commit
+ serve:
+ start stand-alone webserver
+ status, st:
+ show changed files in the working directory
+ summary, sum:
+ summarize working directory state
+ update, up, checkout, co:
+ update working directory (or switch revisions)
+
+ global options:
+ -R --repository REPO repository root directory or name of overlay bundle
+ file
+ --cwd DIR change working directory
+ -y --noninteractive do not prompt, assume 'yes' for any required answers
+ -q --quiet suppress output
+ -v --verbose enable additional output
+ --config CONFIG [+] set/override config option (use 'section.name=value')
+ --debug enable debugging output
+ --debugger start debugger
+ --encoding ENCODE set the charset encoding (default: ascii)
+ --encodingmode MODE set the charset encoding mode (default: strict)
+ --traceback always print a traceback on exception
+ --time time how long the command takes
+ --profile print command execution profile
+ --version output version information and exit
+ -h --help display help and exit
+
+ [+] marked option can be specified multiple times
+
+ use "hg help" for the full list of commands
+
+ $ hg add -h
+ hg add [OPTION]... [FILE]...
+
+ add the specified files on the next commit
+
+ Schedule files to be version controlled and added to the repository.
+
+ The files will be added to the repository at the next commit. To undo an
+ add before that, see "hg forget".
+
+ If no names are given, add all files to the repository.
+
+ Returns 0 if all files are successfully added.
+
+ use "hg -v help add" to show verbose help
+
+ options:
+
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+ -n --dry-run do not perform actions, just print output
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help add" to show global options
+
+Verbose help for add
+
+ $ hg add -hv
+ hg add [OPTION]... [FILE]...
+
+ add the specified files on the next commit
+
+ Schedule files to be version controlled and added to the repository.
+
+ The files will be added to the repository at the next commit. To undo an
+ add before that, see "hg forget".
+
+ If no names are given, add all files to the repository.
+
+ An example showing how new (unknown) files are added automatically by "hg
+ add":
+
+ $ ls
+ foo.c
+ $ hg status
+ ? foo.c
+ $ hg add
+ adding foo.c
+ $ hg status
+ A foo.c
+
+ Returns 0 if all files are successfully added.
+
+ options:
+
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+ -n --dry-run do not perform actions, just print output
+
+ global options:
+ -R --repository REPO repository root directory or name of overlay bundle
+ file
+ --cwd DIR change working directory
+ -y --noninteractive do not prompt, assume 'yes' for any required
+ answers
+ -q --quiet suppress output
+ -v --verbose enable additional output
+ --config CONFIG [+] set/override config option (use
+ 'section.name=value')
+ --debug enable debugging output
+ --debugger start debugger
+ --encoding ENCODE set the charset encoding (default: ascii)
+ --encodingmode MODE set the charset encoding mode (default: strict)
+ --traceback always print a traceback on exception
+ --time time how long the command takes
+ --profile print command execution profile
+ --version output version information and exit
+ -h --help display help and exit
+
+ [+] marked option can be specified multiple times
+
+Test help option with version option
+
+ $ hg add -h --version
+ Mercurial Distributed SCM \(version .+?\)
+
+ Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> 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.
+
+ hg add [OPTION]... [FILE]...
+
+ add the specified files on the next commit
+
+ Schedule files to be version controlled and added to the repository.
+
+ The files will be added to the repository at the next commit. To undo an
+ add before that, see "hg forget".
+
+ If no names are given, add all files to the repository.
+
+ Returns 0 if all files are successfully added.
+
+ use "hg -v help add" to show verbose help
+
+ options:
+
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+ -n --dry-run do not perform actions, just print output
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help add" to show global options
+
+ $ hg add --skjdfks
+ hg add: option --skjdfks not recognized
+ hg add [OPTION]... [FILE]...
+
+ add the specified files on the next commit
+
+ Schedule files to be version controlled and added to the repository.
+
+ The files will be added to the repository at the next commit. To undo an
+ add before that, see "hg forget".
+
+ If no names are given, add all files to the repository.
+
+ Returns 0 if all files are successfully added.
+
+ use "hg -v help add" to show verbose help
+
+ options:
+
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+ -n --dry-run do not perform actions, just print output
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help add" to show global options
+
+Test ambiguous command help
+
+ $ hg help ad
+ list of commands:
+
+ add add the specified files on the next commit
+ addremove add all new files, delete all missing files
+
+ use "hg -v help ad" to show aliases and global options
+
+Test command without options
+
+ $ hg help verify
+ hg verify
+
+ verify the integrity of the repository
+
+ Verify the integrity of the current repository.
+
+ This will perform an extensive check of the repository's integrity,
+ validating the hashes and checksums of each entry in the changelog,
+ manifest, and tracked files, as well as the integrity of their crosslinks
+ and indices.
+
+ Returns 0 on success, 1 if errors are encountered.
+
+ use "hg -v help verify" to show global options
+
+ $ hg help diff
+ hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
+
+ diff repository (or selected files)
+
+ Show differences between revisions for the specified files.
+
+ Differences between files are shown using the unified diff format.
+
+ NOTE: diff may generate unexpected results for merges, as it will default
+ to comparing against the working directory's first parent changeset if no
+ revisions are specified.
+
+ When two revision arguments are given, then changes are shown between
+ those revisions. If only one revision is specified then that revision is
+ compared to the working directory, and, when no revisions are specified,
+ the working directory files are compared to its parent.
+
+ Alternatively you can specify -c/--change with a revision to see the
+ changes in that changeset relative to its first parent.
+
+ Without the -a/--text option, diff will avoid generating diffs of files it
+ detects as binary. With -a, diff will generate a diff anyway, probably
+ with undesirable results.
+
+ Use the -g/--git option to generate diffs in the git extended diff format.
+ For more information, read "hg help diffs".
+
+ Returns 0 on success.
+
+ options:
+
+ -r --rev REV [+] revision
+ -c --change REV change made by revision
+ -a --text treat all files as text
+ -g --git use git extended diff format
+ --nodates omit dates from diff headers
+ -p --show-function show which function each change is in
+ --reverse produce a diff that undoes the changes
+ -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
+ -U --unified NUM number of lines of context to show
+ --stat output diffstat-style summary of changes
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+ -S --subrepos recurse into subrepositories
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help diff" to show global options
+
+ $ hg help status
+ hg status [OPTION]... [FILE]...
+
+ aliases: st
+
+ show changed files in the working directory
+
+ Show status of files in the repository. If names are given, only files
+ that match are shown. Files that are clean or ignored or the source of a
+ copy/move operation, are not listed unless -c/--clean, -i/--ignored,
+ -C/--copies or -A/--all are given. Unless options described with "show
+ only ..." are given, the options -mardu are used.
+
+ Option -q/--quiet hides untracked (unknown and ignored) files unless
+ explicitly requested with -u/--unknown or -i/--ignored.
+
+ NOTE: status may appear to disagree with diff if permissions have changed
+ or a merge has occurred. The standard diff format does not report
+ permission changes and diff only reports changes relative to one merge
+ parent.
+
+ If one revision is given, it is used as the base revision. If two
+ revisions are given, the differences between them are shown. The --change
+ option can also be used as a shortcut to list the changed files of a
+ revision from its first parent.
+
+ The codes used to show the status of files are:
+
+ M = modified
+ A = added
+ R = removed
+ C = clean
+ ! = missing (deleted by non-hg command, but still tracked)
+ ? = not tracked
+ I = ignored
+ = origin of the previous file listed as A (added)
+
+ Returns 0 on success.
+
+ options:
+
+ -A --all show status of all files
+ -m --modified show only modified files
+ -a --added show only added files
+ -r --removed show only removed files
+ -d --deleted show only deleted (but tracked) files
+ -c --clean show only files without changes
+ -u --unknown show only unknown (not tracked) files
+ -i --ignored show only ignored files
+ -n --no-status hide status prefix
+ -C --copies show source of copied files
+ -0 --print0 end filenames with NUL, for use with xargs
+ --rev REV [+] show difference from revision
+ --change REV list the changed files of a revision
+ -I --include PATTERN [+] include names matching the given patterns
+ -X --exclude PATTERN [+] exclude names matching the given patterns
+ -S --subrepos recurse into subrepositories
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help status" to show global options
+
+ $ hg -q help status
+ hg status [OPTION]... [FILE]...
+
+ show changed files in the working directory
+
+ $ hg help foo
+ hg: unknown command 'foo'
+ Mercurial Distributed SCM
+
+ basic commands:
+
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
+
+ use "hg help" for the full list of commands or "hg -v" for details
+
+ $ hg skjdfks
+ hg: unknown command 'skjdfks'
+ Mercurial Distributed SCM
+
+ basic commands:
+
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
+
+ use "hg help" for the full list of commands or "hg -v" for details
+
+ $ cat > helpext.py <<EOF
+ > import os
+ > from mercurial import commands
+ >
+ > def nohelp(ui, *args, **kwargs):
+ > pass
+ >
+ > cmdtable = {
+ > "nohelp": (nohelp, [], "hg nohelp"),
+ > }
+ >
+ > commands.norepo += ' nohelp'
+ > EOF
+ $ echo '[extensions]' >> $HGRCPATH
+ $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
+
+Test command with no help text
+
+ $ hg help nohelp
+ hg nohelp
+
+ (no help text available)
+
+ use "hg -v help nohelp" to show global options
+
+Test that default list of commands omits extension commands
+
+ $ hg help
+ Mercurial Distributed SCM
+
+ list of commands:
+
+ add add the specified files on the next commit
+ addremove add all new files, delete all missing files
+ annotate show changeset information by line for each file
+ archive create an unversioned archive of a repository revision
+ backout reverse effect of earlier changeset
+ bisect subdivision search of changesets
+ branch set or show the current branch name
+ branches list repository named branches
+ bundle create a changegroup file
+ cat output the current or given revision of files
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ copy mark files as copied for the next commit
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ grep search for a pattern in specified files and revisions
+ heads show current repository heads or show branch heads
+ help show help for a given topic or a help overview
+ identify identify the working copy 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
+ locate locate files matching specific patterns
+ log show revision history of entire repository or files
+ manifest output the current or given revision of the project manifest
+ merge merge working directory with another revision
+ outgoing show changesets not found in the destination
+ parents show the parents of the working directory or revision
+ paths show aliases for remote repositories
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ recover roll back an interrupted transaction
+ remove remove the specified files on the next commit
+ rename rename files; equivalent of copy + remove
+ resolve redo merges or set/view the merge status of files
+ revert restore individual files or directories to an earlier state
+ rollback roll back the last transaction (dangerous)
+ root print the root (top) of the current working directory
+ serve start stand-alone webserver
+ showconfig show combined config settings from all hgrc files
+ status show changed files in the working directory
+ summary summarize working directory state
+ tag add one or more tags for the current or given revision
+ tags list repository tags
+ tip show the tip revision
+ unbundle apply one or more changegroup files
+ update update working directory (or switch revisions)
+ verify verify the integrity of the repository
+ version output version and copyright information
+
+ enabled extensions:
+
+ helpext (no help text available)
+
+ additional help topics:
+
+ config Configuration Files
+ dates Date Formats
+ patterns File Name Patterns
+ environment Environment Variables
+ revisions Specifying Single Revisions
+ multirevs Specifying Multiple Revisions
+ revsets Specifying Revision Sets
+ diffs Diff Formats
+ templating Template Usage
+ urls URL Paths
+ extensions Using additional features
+ hgweb Configuring hgweb
+ glossary Glossary
+
+ use "hg -v help" to show aliases and global options
+
+Test list of commands with command with no help text
+
+ $ hg help helpext
+ helpext extension - no help text available
+
+ list of commands:
+
+ nohelp (no help text available)
+
+ use "hg -v help helpext" to show aliases and global options
+
+Test a help topic
+
+ $ hg help revs
+ Specifying Single Revisions
+
+ Mercurial supports several ways to specify individual revisions.
+
+ A plain integer is treated as a revision number. Negative integers are
+ treated as sequential offsets from the tip, with -1 denoting the tip, -2
+ denoting the revision prior to the tip, and so forth.
+
+ A 40-digit hexadecimal string is treated as a unique revision identifier.
+
+ A hexadecimal string less than 40 characters long is treated as a unique
+ revision identifier and is referred to as a short-form identifier. A
+ short-form identifier is only valid if it is the prefix of exactly one
+ full-length identifier.
+
+ Any other string is treated as a tag or branch name. A tag name is a
+ symbolic name associated with a revision identifier. A branch name denotes
+ the tipmost revision of that branch. Tag and branch names must not contain
+ the ":" character.
+
+ The reserved name "tip" is a special tag that always identifies the most
+ recent revision.
+
+ The reserved name "null" indicates the null revision. This is the revision
+ of an empty repository, and the parent of revision 0.
+
+ The reserved name "." indicates the working directory parent. If no
+ working directory is checked out, it is equivalent to null. If an
+ uncommitted merge is in progress, "." is the revision of the first parent.
--- a/tests/test-hgrc.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hgrc.t Sat Sep 11 00:40:19 2010 +0200
@@ -59,7 +59,7 @@
John Doe
$ cd ..
- $ hg showconfig | sed -e "s:$p:...:"
+ $ hg showconfig
ui.username=$FAKEUSER
$ unset FAKEUSER
--- a/tests/test-hgweb Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hgweb Sat Sep 11 00:40:19 2010 +0200
@@ -43,7 +43,7 @@
python -c "print len(file('access.log').readlines()), 'log lines written'"
echo % static file
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css'
+"$TESTDIR/get-with-headers.py" --twice localhost:$HGPORT '/static/style-gitweb.css'
echo % errors
cat errors.log
--- a/tests/test-hgweb-no-path-info Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hgweb-no-path-info Sat Sep 11 00:40:19 2010 +0200
@@ -8,7 +8,7 @@
hg init
echo foo > bar
hg add bar
-hg commit -m "test" -u "Testing"
+hg commit -m "test"
hg tip
cat > request.py <<EOF
@@ -19,11 +19,12 @@
errors = StringIO()
input = StringIO()
-def startrsp(headers, data):
+def startrsp(status, headers):
+ print '---- STATUS'
+ print status
print '---- HEADERS'
- print headers
+ print [i for i in headers if i[0] != 'ETag']
print '---- DATA'
- print data
return output.write
env = {
--- a/tests/test-hgweb-no-path-info.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hgweb-no-path-info.out Sat Sep 11 00:40:19 2010 +0200
@@ -1,13 +1,14 @@
-changeset: 0:4cbec7e6f8c4
+changeset: 0:61c9426e69fe
tag: tip
-user: Testing
+user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: test
----- HEADERS
+---- STATUS
200 Script output follows
+---- HEADERS
+[('Content-Type', 'application/atom+xml; charset=ascii')]
---- DATA
-[('Content-Type', 'application/atom+xml; charset=ascii')]
<?xml version="1.0" encoding="ascii"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<!-- Changelog -->
@@ -19,11 +20,11 @@
<entry>
<title>test</title>
- <id>http://127.0.0.1/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e</id>
- <link href="http://127.0.0.1/rev/4cbec7e6f8c4"/>
+ <id>http://127.0.0.1/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id>
+ <link href="http://127.0.0.1/rev/61c9426e69fe"/>
<author>
- <name>Testing</name>
- <email>Testing</email>
+ <name>test</name>
+ <email>test</email>
</author>
<updated>1970-01-01T00:00:00+00:00</updated>
<published>1970-01-01T00:00:00+00:00</published>
@@ -37,10 +38,11 @@
</feed>
---- ERRORS
----- HEADERS
+---- STATUS
200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
repo/
--- a/tests/test-hgweb-no-request-uri Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hgweb-no-request-uri Sat Sep 11 00:40:19 2010 +0200
@@ -8,7 +8,7 @@
hg init
echo foo > bar
hg add bar
-hg commit -m "test" -u "Testing"
+hg commit -m "test"
hg tip
cat > request.py <<EOF
@@ -19,11 +19,12 @@
errors = StringIO()
input = StringIO()
-def startrsp(headers, data):
+def startrsp(status, headers):
+ print '---- STATUS'
+ print status
print '---- HEADERS'
- print headers
+ print [i for i in headers if i[0] != 'ETag']
print '---- DATA'
- print data
return output.write
env = {
--- a/tests/test-hgweb-no-request-uri.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hgweb-no-request-uri.out Sat Sep 11 00:40:19 2010 +0200
@@ -1,13 +1,14 @@
-changeset: 0:4cbec7e6f8c4
+changeset: 0:61c9426e69fe
tag: tip
-user: Testing
+user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: test
----- HEADERS
+---- STATUS
200 Script output follows
+---- HEADERS
+[('Content-Type', 'application/atom+xml; charset=ascii')]
---- DATA
-[('Content-Type', 'application/atom+xml; charset=ascii')]
<?xml version="1.0" encoding="ascii"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<!-- Changelog -->
@@ -19,11 +20,11 @@
<entry>
<title>test</title>
- <id>http://127.0.0.1/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e</id>
- <link href="http://127.0.0.1/rev/4cbec7e6f8c4"/>
+ <id>http://127.0.0.1/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id>
+ <link href="http://127.0.0.1/rev/61c9426e69fe"/>
<author>
- <name>Testing</name>
- <email>Testing</email>
+ <name>test</name>
+ <email>test</email>
</author>
<updated>1970-01-01T00:00:00+00:00</updated>
<published>1970-01-01T00:00:00+00:00</published>
@@ -37,29 +38,32 @@
</feed>
---- ERRORS
----- HEADERS
+---- STATUS
200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
-rw-r--r-- 4 bar
---- ERRORS
----- HEADERS
+---- STATUS
200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
/repo/
---- ERRORS
----- HEADERS
+---- STATUS
200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/plain; charset=ascii')]
---- DATA
-[('Content-Type', 'text/plain; charset=ascii')]
-rw-r--r-- 4 bar
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-non-interactive Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,74 @@
+#!/bin/sh
+# Tests if hgweb can run without touching sys.stdin, as is required
+# by the WSGI standard and strictly implemented by mod_wsgi.
+
+mkdir repo
+cd repo
+hg init
+echo foo > bar
+hg add bar
+hg commit -m "test"
+hg tip
+
+cat > request.py <<EOF
+from mercurial import dispatch
+from mercurial.hgweb.hgweb_mod import hgweb
+from mercurial.ui import ui
+from mercurial import hg
+from StringIO import StringIO
+import os, sys
+
+class FileLike(object):
+ def __init__(self, real):
+ self.real = real
+ def fileno(self):
+ print >> sys.__stdout__, 'FILENO'
+ return self.real.fileno()
+ def read(self):
+ print >> sys.__stdout__, 'READ'
+ return self.real.read()
+ def readline(self):
+ print >> sys.__stdout__, 'READLINE'
+ return self.real.readline()
+
+sys.stdin = FileLike(sys.stdin)
+errors = StringIO()
+input = StringIO()
+output = StringIO()
+
+def startrsp(status, headers):
+ print '---- STATUS'
+ print status
+ print '---- HEADERS'
+ print [i for i in headers if i[0] != 'ETag']
+ print '---- DATA'
+ return output.write
+
+env = {
+ 'wsgi.version': (1, 0),
+ 'wsgi.url_scheme': 'http',
+ 'wsgi.errors': errors,
+ 'wsgi.input': input,
+ 'wsgi.multithread': False,
+ 'wsgi.multiprocess': False,
+ 'wsgi.run_once': False,
+ 'REQUEST_METHOD': 'GET',
+ 'SCRIPT_NAME': '',
+ 'PATH_INFO': '',
+ 'QUERY_STRING': '',
+ 'SERVER_NAME': '127.0.0.1',
+ 'SERVER_PORT': os.environ['HGPORT'],
+ 'SERVER_PROTOCOL': 'HTTP/1.0'
+}
+
+i = hgweb('.')
+i(env, startrsp)
+print '---- ERRORS'
+print errors.getvalue()
+print '---- OS.ENVIRON wsgi variables'
+print sorted([x for x in os.environ if x.startswith('wsgi')])
+print '---- request.ENVIRON wsgi variables'
+print sorted([x for x in i.repo.ui.environ if x.startswith('wsgi')])
+EOF
+
+python request.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-non-interactive.out Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,17 @@
+changeset: 0:61c9426e69fe
+tag: tip
+user: test
+date: Thu Jan 01 00:00:00 1970 +0000
+summary: test
+
+---- STATUS
+200 Script output follows
+---- HEADERS
+[('Content-Type', 'text/html; charset=ascii')]
+---- DATA
+---- ERRORS
+
+---- OS.ENVIRON wsgi variables
+[]
+---- request.ENVIRON wsgi variables
+['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version']
--- a/tests/test-hgweb.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hgweb.out Sat Sep 11 00:40:19 2010 +0200
@@ -364,4 +364,6 @@
top: -3px;
font-style: italic;
}
+304 Not Modified
+
% errors
--- a/tests/test-hook.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-hook.t Sat Sep 11 00:40:19 2010 +0200
@@ -15,12 +15,12 @@
$ echo 'post-cat = python ../printenv.py post-cat' >> .hg/hgrc
$ echo a > a
$ hg add a
- $ hg commit -m a -d "1000000 0"
+ $ hg commit -m a
precommit hook: HG_PARENT1=0000000000000000000000000000000000000000
- pretxncommit hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$HGTMP/test-hook.t/a
- 0:29b62aeb769f
- commit hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000
- commit.b hook: HG_NODE=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PARENT1=0000000000000000000000000000000000000000
+ pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$HGTMP/test-hook.t/a
+ 0:cb9a9f314b8b
+ commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
+ commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
$ hg clone . ../b
updating to branch default
@@ -39,31 +39,31 @@
$ cd ../a
$ echo b >> a
$ hg commit -m a1 -d "1 0"
- precommit hook: HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
- pretxncommit hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PENDING=$HGTMP/test-hook.t/a
- 1:b702efe96888
- commit hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
- commit.b hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
+ precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
+ pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/test-hook.t/a
+ 1:ab228980c14d
+ commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
+ commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
$ hg update -C 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo b > b
$ hg add b
$ hg commit -m b -d '1 0'
- precommit hook: HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
- pretxncommit hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b HG_PENDING=$HGTMP/test-hook.t/a
- 2:1324a5531bac
- commit hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
- commit.b hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT1=29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
+ precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
+ pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$HGTMP/test-hook.t/a
+ 2:ee9deb46ab31
+ commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
+ commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
created new head
$ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg commit -m merge -d '2 0'
- precommit hook: HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2
- pretxncommit hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2 HG_PENDING=$HGTMP/test-hook.t/a
- 3:4c52fb2e4022
- commit hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2
- commit.b hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2
+ precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
+ pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$HGTMP/test-hook.t/a
+ 3:07f3376c1e65
+ commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
+ commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
# test generic hooks
@@ -78,10 +78,10 @@
$ cd ../b
$ hg pull ../a
prechangegroup hook: HG_SOURCE=pull HG_URL=file:
- changegroup hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_SOURCE=pull HG_URL=file:
- incoming hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_SOURCE=pull HG_URL=file:
- incoming hook: HG_NODE=1324a5531bac09b329c3845d35ae6a7526874edb HG_SOURCE=pull HG_URL=file:
- incoming hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_SOURCE=pull HG_URL=file:
+ changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:
+ incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:
+ incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:
+ incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:
pulling from ../a
searching for changes
adding changesets
@@ -96,27 +96,27 @@
$ echo 'pretag = python ../printenv.py pretag' >> .hg/hgrc
$ echo 'tag = unset HG_PARENT1 HG_PARENT2; python ../printenv.py tag' >> .hg/hgrc
$ hg tag -d '3 0' a
- pretag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a
- precommit hook: HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321
- pretxncommit hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321 HG_PENDING=$HGTMP/test-hook.t/a
- 4:8ea2ef7ad3e8
- commit hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321
- commit.b hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PARENT1=4c52fb2e402287dd5dc052090682536c8406c321
- tag hook: HG_LOCAL=0 HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_TAG=a
+ pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
+ precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
+ pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$HGTMP/test-hook.t/a
+ 4:539e4b31b6dc
+ commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
+ commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
+ tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
$ hg tag -l la
- pretag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=la
- tag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=la
+ pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
+ tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
# pretag hook can forbid tagging
$ echo 'pretag.forbid = python ../printenv.py pretag.forbid 1' >> .hg/hgrc
$ hg tag -d '4 0' fa
- pretag hook: HG_LOCAL=0 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fa
- pretag.forbid hook: HG_LOCAL=0 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fa
+ pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
+ pretag.forbid hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
abort: pretag.forbid hook exited with status 1
$ hg tag -l fla
- pretag hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fla
- pretag.forbid hook: HG_LOCAL=1 HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_TAG=fla
+ pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
+ pretag.forbid hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
abort: pretag.forbid hook exited with status 1
# pretxncommit hook can see changeset, can roll back txn, changeset
@@ -127,49 +127,49 @@
$ echo z > z
$ hg add z
$ hg -q tip
- 4:8ea2ef7ad3e8
+ 4:539e4b31b6dc
$ hg commit -m 'fail' -d '4 0'
- precommit hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198
- pretxncommit hook: HG_NODE=fad284daf8c032148abaffcd745dafeceefceb61 HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PENDING=$HGTMP/test-hook.t/a
- 5:fad284daf8c0
- 5:fad284daf8c0
- pretxncommit.forbid hook: HG_NODE=fad284daf8c032148abaffcd745dafeceefceb61 HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PENDING=$HGTMP/test-hook.t/a
+ precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
+ pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/a
+ 5:6f611f8018c1
+ 5:6f611f8018c1
+ pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/a
transaction abort!
rollback completed
abort: pretxncommit.forbid1 hook exited with status 1
$ hg -q tip
- 4:8ea2ef7ad3e8
+ 4:539e4b31b6dc
# precommit hook can prevent commit
$ echo 'precommit.forbid = python ../printenv.py precommit.forbid 1' >> .hg/hgrc
$ hg commit -m 'fail' -d '4 0'
- precommit hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198
- precommit.forbid hook: HG_PARENT1=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198
+ precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
+ precommit.forbid hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
abort: precommit.forbid hook exited with status 1
$ hg -q tip
- 4:8ea2ef7ad3e8
+ 4:539e4b31b6dc
# preupdate hook can prevent update
$ echo 'preupdate = python ../printenv.py preupdate' >> .hg/hgrc
$ hg update 1
- preupdate hook: HG_PARENT1=b702efe96888
+ preupdate hook: HG_PARENT1=ab228980c14d
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
# update hook
$ echo 'update = python ../printenv.py update' >> .hg/hgrc
$ hg update
- preupdate hook: HG_PARENT1=8ea2ef7ad3e8
- update hook: HG_ERROR=0 HG_PARENT1=8ea2ef7ad3e8
+ preupdate hook: HG_PARENT1=539e4b31b6dc
+ update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
# prechangegroup hook can prevent incoming changes
$ cd ../b
$ hg -q tip
- 3:4c52fb2e4022
+ 3:07f3376c1e65
$ echo '[hooks]' > .hg/hgrc
$ echo 'prechangegroup.forbid = python ../printenv.py prechangegroup.forbid 1' >> .hg/hgrc
$ hg pull ../a
@@ -185,8 +185,8 @@
$ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
$ echo 'pretxnchangegroup.forbid1 = python ../printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc
$ hg pull ../a
- 4:8ea2ef7ad3e8
- pretxnchangegroup.forbid hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_PENDING=$HGTMP/test-hook.t/b HG_SOURCE=pull HG_URL=file:
+ 4:539e4b31b6dc
+ pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$HGTMP/test-hook.t/b HG_SOURCE=pull HG_URL=file:
pulling from ../a
searching for changes
adding changesets
@@ -197,7 +197,7 @@
rollback completed
abort: pretxnchangegroup.forbid1 hook exited with status 1
$ hg -q tip
- 3:4c52fb2e4022
+ 3:07f3376c1e65
# outgoing hooks can see env vars
@@ -207,7 +207,7 @@
$ echo 'outgoing = python ../printenv.py outgoing' >> ../a/.hg/hgrc
$ hg pull ../a
preoutgoing hook: HG_SOURCE=pull
- outgoing hook: HG_NODE=8ea2ef7ad3e8cac946c72f1e0c79d6aebc301198 HG_SOURCE=pull
+ outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull
pulling from ../a
searching for changes
adding changesets
@@ -441,7 +441,7 @@
$ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
$ echo a >> a
- $ hg --traceback commit -d '0 0' -ma 2>&1 | egrep '^(exception|Traceback|ImportError)'
+ $ hg --traceback commit -ma 2>&1 | egrep '^(exception|Traceback|ImportError)'
exception from first failed import attempt:
Traceback (most recent call last):
ImportError: No module named somebogusmodule
@@ -456,10 +456,10 @@
$ echo 'commit = hg id' >> .hg/hgrc
$ echo 'update = hg id' >> .hg/hgrc
$ echo bb > a
- $ hg ci -d '0 0' -ma
- 8da618c33484 tip
+ $ hg ci -ma
+ 223eafe2750c tip
$ hg up 0
- 29b62aeb769f
+ cb9a9f314b8b
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ exit 0
--- a/tests/test-identify.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-identify.t Sat Sep 11 00:40:19 2010 +0200
@@ -3,7 +3,7 @@
no repo
$ hg id
- abort: There is no Mercurial repository here (.hg not found)
+ abort: there is no Mercurial repository here (.hg not found)
create repo
--- a/tests/test-impexp-branch Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-cat >findbranch.py <<EOF
-import re, sys
-
-head_re = re.compile('^#(?:(?:\\s+([A-Za-z][A-Za-z0-9_]*)(?:\\s.*)?)|(?:\\s*))$')
-
-for line in sys.stdin:
- hmatch = head_re.match(line)
- if not hmatch:
- sys.exit(1)
- if hmatch.group(1) == 'Branch':
- sys.exit(0)
-sys.exit(1)
-EOF
-hg init a
-cd a
-echo "Rev 1" >rev
-hg add rev
-hg commit -m "No branch."
-hg branch abranch
-echo "Rev 2" >rev
-hg commit -m "With branch."
-if hg export 0 | python ../findbranch.py; then
- echo "Export of default branch revision has Branch header" 1>&2
- exit 1
-fi
-if hg export 1 | python ../findbranch.py; then
- : # Do nothing
-else
- echo "Export of branch revision is missing Branch header" 1>&2
- exit 1
-fi
-# Make sure import still works with branch information in patches.
-cd ..
-hg init b
-cd b
-hg -R ../a export 0 | hg import -
-hg -R ../a export 1 | hg import -
-cd ..
-rm -rf b
-hg init b
-cd b
-hg -R ../a export 0 | hg import --exact -
-hg -R ../a export 1 | hg import --exact -
--- a/tests/test-impexp-branch.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-marked working directory as branch abranch
-applying patch from stdin
-applying patch from stdin
-applying patch from stdin
-applying patch from stdin
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-impexp-branch.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,50 @@
+ $ cat >findbranch.py <<EOF
+ > import re, sys
+ >
+ > head_re = re.compile('^#(?:(?:\\s+([A-Za-z][A-Za-z0-9_]*)(?:\\s.*)?)|(?:\\s*))$')
+ >
+ > for line in sys.stdin:
+ > hmatch = head_re.match(line)
+ > if not hmatch:
+ > sys.exit(1)
+ > if hmatch.group(1) == 'Branch':
+ > sys.exit(0)
+ > sys.exit(1)
+ > EOF
+ $ hg init a
+ $ cd a
+ $ echo "Rev 1" >rev
+ $ hg add rev
+ $ hg commit -m "No branch."
+ $ hg branch abranch
+ marked working directory as branch abranch
+ $ echo "Rev 2" >rev
+ $ hg commit -m "With branch."
+ $ if hg export 0 | python ../findbranch.py; then
+ > echo "Export of default branch revision has Branch header" 1>&2
+ > exit 1
+ > fi
+ $ if hg export 1 | python ../findbranch.py; then
+ > : # Do nothing
+ > else
+ > echo "Export of branch revision is missing Branch header" 1>&2
+ > exit 1
+ > fi
+
+Make sure import still works with branch information in patches.
+
+ $ cd ..
+ $ hg init b
+ $ cd b
+ $ hg -R ../a export 0 | hg import -
+ applying patch from stdin
+ $ hg -R ../a export 1 | hg import -
+ applying patch from stdin
+ $ cd ..
+ $ rm -rf b
+ $ hg init b
+ $ cd b
+ $ hg -R ../a export 0 | hg import --exact -
+ applying patch from stdin
+ $ hg -R ../a export 1 | hg import --exact -
+ applying patch from stdin
--- a/tests/test-import-eol.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-import-eol.t Sat Sep 11 00:40:19 2010 +0200
@@ -36,7 +36,7 @@
$ hg --config patch.eol='LFCR' import eol.diff
applying eol.diff
- abort: Unsupported line endings type: LFCR
+ abort: unsupported line endings type: LFCR
$ hg revert -a
--- a/tests/test-incoming-outgoing Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-mkdir test
-cd test
-hg init
-for i in 0 1 2 3 4 5 6 7 8; do
- echo $i >> foo
- hg commit -A -m $i -d "1000000 0"
-done
-hg verify
-hg serve -p $HGPORT -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-cd ..
-
-hg init new
-# http incoming
-hg -R new incoming http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-# local incoming
-hg -R new incoming test
-hg -R new incoming -r 4 test
-echo "% limit to 2 changesets"
-hg -R new incoming -l 2 test
-echo "% limit to 2 changesets, test with -p --git"
-hg -R new incoming -l 2 -p --git test
-
-# test with --bundle
-hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg -R new incoming --bundle test2.hg test
-
-# test the resulting bundles
-hg init temp
-hg init temp2
-hg -R temp unbundle test.hg
-hg -R temp2 unbundle test2.hg
-hg -R temp tip
-hg -R temp2 tip
-
-rm -r temp temp2 new
-
-# test outgoing
-hg clone test test-dev
-cd test-dev
-for i in 9 10 11 12 13; do
- echo $i >> foo
- hg commit -A -m $i -d "1000000 0"
-done
-hg verify
-cd ..
-hg -R test-dev outgoing test
-echo "% limit to 3 changesets"
-hg -R test-dev outgoing -l 3 test
-hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
--- a/tests/test-incoming-outgoing.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,405 +0,0 @@
-adding foo
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 9 changesets, 9 total revisions
-comparing with http://localhost:$HGPORT/
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-changeset: 2:c0d6b86da426
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 3:dfacbd43b3fe
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 3
-
-changeset: 4:1f3a964b6022
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 4
-
-changeset: 5:c028bcc7a28a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 5
-
-changeset: 6:a0c0095f3389
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 6
-
-changeset: 7:d4be65f4e891
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 7
-
-changeset: 8:92b83e334ef8
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 8
-
-comparing with http://localhost:$HGPORT/
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-changeset: 2:c0d6b86da426
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 3:dfacbd43b3fe
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 3
-
-changeset: 4:1f3a964b6022
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 4
-
-comparing with test
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-changeset: 2:c0d6b86da426
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 3:dfacbd43b3fe
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 3
-
-changeset: 4:1f3a964b6022
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 4
-
-changeset: 5:c028bcc7a28a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 5
-
-changeset: 6:a0c0095f3389
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 6
-
-changeset: 7:d4be65f4e891
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 7
-
-changeset: 8:92b83e334ef8
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 8
-
-comparing with test
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-changeset: 2:c0d6b86da426
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 3:dfacbd43b3fe
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 3
-
-changeset: 4:1f3a964b6022
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 4
-
-% limit to 2 changesets
-comparing with test
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-% limit to 2 changesets, test with -p --git
-comparing with test
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-diff --git a/foo b/foo
-new file mode 100644
---- /dev/null
-+++ b/foo
-@@ -0,0 +1,1 @@
-+0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-diff --git a/foo b/foo
---- a/foo
-+++ b/foo
-@@ -1,1 +1,2 @@
- 0
-+1
-
-comparing with http://localhost:$HGPORT/
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-changeset: 2:c0d6b86da426
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 3:dfacbd43b3fe
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 3
-
-changeset: 4:1f3a964b6022
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 4
-
-changeset: 5:c028bcc7a28a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 5
-
-changeset: 6:a0c0095f3389
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 6
-
-changeset: 7:d4be65f4e891
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 7
-
-changeset: 8:92b83e334ef8
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 8
-
-comparing with test
-changeset: 0:9cb21d99fe27
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 0
-
-changeset: 1:d717f5dfad6a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-changeset: 2:c0d6b86da426
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 3:dfacbd43b3fe
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 3
-
-changeset: 4:1f3a964b6022
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 4
-
-changeset: 5:c028bcc7a28a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 5
-
-changeset: 6:a0c0095f3389
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 6
-
-changeset: 7:d4be65f4e891
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 7
-
-changeset: 8:92b83e334ef8
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 8
-
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 9 changes to 1 files
-(run 'hg update' to get a working copy)
-adding changesets
-adding manifests
-adding file changes
-added 9 changesets with 9 changes to 1 files
-(run 'hg update' to get a working copy)
-changeset: 8:92b83e334ef8
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 8
-
-changeset: 8:92b83e334ef8
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 8
-
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 14 changesets, 14 total revisions
-comparing with test
-searching for changes
-changeset: 9:3741c3ad1096
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 9
-
-changeset: 10:de4143c8d9a5
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 10
-
-changeset: 11:0e1c188b9a7a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 11
-
-changeset: 12:251354d0fdd3
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 12
-
-changeset: 13:bdaadd969642
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 13
-
-% limit to 3 changesets
-comparing with test
-searching for changes
-changeset: 9:3741c3ad1096
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 9
-
-changeset: 10:de4143c8d9a5
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 10
-
-changeset: 11:0e1c188b9a7a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 11
-
-comparing with http://localhost:$HGPORT/
-searching for changes
-changeset: 9:3741c3ad1096
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 9
-
-changeset: 10:de4143c8d9a5
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 10
-
-changeset: 11:0e1c188b9a7a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 11
-
-changeset: 12:251354d0fdd3
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 12
-
-changeset: 13:bdaadd969642
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 13
-
-comparing with http://localhost:$HGPORT/
-searching for changes
-changeset: 9:3741c3ad1096
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 9
-
-changeset: 10:de4143c8d9a5
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 10
-
-changeset: 11:0e1c188b9a7a
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 11
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-incoming-outgoing.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,468 @@
+ $ mkdir test
+ $ cd test
+ $ hg init
+ $ for i in 0 1 2 3 4 5 6 7 8; do
+ > echo $i >> foo
+ > hg commit -A -m $i
+ > done
+ adding foo
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 1 files, 9 changesets, 9 total revisions
+ $ hg serve -p $HGPORT -d --pid-file=hg.pid
+ $ cat hg.pid >> $DAEMON_PIDS
+ $ cd ..
+
+ $ hg init new
+
+http incoming
+
+ $ hg -R new incoming http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+ comparing with http://localhost:$HGPORT/
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ changeset: 2:d9f42cd1a1ec
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ changeset: 3:376476025137
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 3
+
+ changeset: 4:70d7eb252d49
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 4
+
+ changeset: 5:ad284ee3b5ee
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 5
+
+ changeset: 6:e9229f2de384
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 6
+
+ changeset: 7:d152815bb8db
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 7
+
+ changeset: 8:e4feb4ac9035
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 8
+
+ $ hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+ comparing with http://localhost:$HGPORT/
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ changeset: 2:d9f42cd1a1ec
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ changeset: 3:376476025137
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 3
+
+ changeset: 4:70d7eb252d49
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 4
+
+
+local incoming
+
+ $ hg -R new incoming test
+ comparing with test
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ changeset: 2:d9f42cd1a1ec
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ changeset: 3:376476025137
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 3
+
+ changeset: 4:70d7eb252d49
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 4
+
+ changeset: 5:ad284ee3b5ee
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 5
+
+ changeset: 6:e9229f2de384
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 6
+
+ changeset: 7:d152815bb8db
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 7
+
+ changeset: 8:e4feb4ac9035
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 8
+
+ $ hg -R new incoming -r 4 test
+ comparing with test
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ changeset: 2:d9f42cd1a1ec
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ changeset: 3:376476025137
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 3
+
+ changeset: 4:70d7eb252d49
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 4
+
+
+limit to 2 changesets
+
+ $ hg -R new incoming -l 2 test
+ comparing with test
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+
+limit to 2 changesets, test with -p --git
+
+ $ hg -R new incoming -l 2 -p --git test
+ comparing with test
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ diff --git a/foo b/foo
+ new file mode 100644
+ --- /dev/null
+ +++ b/foo
+ @@ -0,0 +1,1 @@
+ +0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ diff --git a/foo b/foo
+ --- a/foo
+ +++ b/foo
+ @@ -1,1 +1,2 @@
+ 0
+ +1
+
+
+test with --bundle
+
+ $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+ comparing with http://localhost:$HGPORT/
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ changeset: 2:d9f42cd1a1ec
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ changeset: 3:376476025137
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 3
+
+ changeset: 4:70d7eb252d49
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 4
+
+ changeset: 5:ad284ee3b5ee
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 5
+
+ changeset: 6:e9229f2de384
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 6
+
+ changeset: 7:d152815bb8db
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 7
+
+ changeset: 8:e4feb4ac9035
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 8
+
+ $ hg -R new incoming --bundle test2.hg test
+ comparing with test
+ changeset: 0:00a43fa82f62
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ changeset: 1:5460a410df01
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ changeset: 2:d9f42cd1a1ec
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ changeset: 3:376476025137
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 3
+
+ changeset: 4:70d7eb252d49
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 4
+
+ changeset: 5:ad284ee3b5ee
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 5
+
+ changeset: 6:e9229f2de384
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 6
+
+ changeset: 7:d152815bb8db
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 7
+
+ changeset: 8:e4feb4ac9035
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 8
+
+
+
+test the resulting bundles
+
+ $ hg init temp
+ $ hg init temp2
+ $ hg -R temp unbundle test.hg
+ adding changesets
+ adding manifests
+ adding file changes
+ added 9 changesets with 9 changes to 1 files
+ (run 'hg update' to get a working copy)
+ $ hg -R temp2 unbundle test2.hg
+ adding changesets
+ adding manifests
+ adding file changes
+ added 9 changesets with 9 changes to 1 files
+ (run 'hg update' to get a working copy)
+ $ hg -R temp tip
+ changeset: 8:e4feb4ac9035
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 8
+
+ $ hg -R temp2 tip
+ changeset: 8:e4feb4ac9035
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 8
+
+
+ $ rm -r temp temp2 new
+
+test outgoing
+
+ $ hg clone test test-dev
+ updating to branch default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cd test-dev
+ $ for i in 9 10 11 12 13; do
+ > echo $i >> foo
+ > hg commit -A -m $i
+ > done
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 1 files, 14 changesets, 14 total revisions
+ $ cd ..
+ $ hg -R test-dev outgoing test
+ comparing with test
+ searching for changes
+ changeset: 9:d89d4abea5bc
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 9
+
+ changeset: 10:820095aa7158
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 10
+
+ changeset: 11:09ede2f3a638
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 11
+
+ changeset: 12:e576b1bed305
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 12
+
+ changeset: 13:96bbff09a7cc
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 13
+
+
+limit to 3 changesets
+
+ $ hg -R test-dev outgoing -l 3 test
+ comparing with test
+ searching for changes
+ changeset: 9:d89d4abea5bc
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 9
+
+ changeset: 10:820095aa7158
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 10
+
+ changeset: 11:09ede2f3a638
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 11
+
+ $ hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+ comparing with http://localhost:$HGPORT/
+ searching for changes
+ changeset: 9:d89d4abea5bc
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 9
+
+ changeset: 10:820095aa7158
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 10
+
+ changeset: 11:09ede2f3a638
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 11
+
+ changeset: 12:e576b1bed305
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 12
+
+ changeset: 13:96bbff09a7cc
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 13
+
+ $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+ comparing with http://localhost:$HGPORT/
+ searching for changes
+ changeset: 9:d89d4abea5bc
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 9
+
+ changeset: 10:820095aa7158
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 10
+
+ changeset: 11:09ede2f3a638
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 11
+
--- a/tests/test-inherit-mode Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-# test that new files created in .hg inherit the permissions from .hg/store
-
-"$TESTDIR/hghave" unix-permissions || exit 80
-
-mkdir dir
-# just in case somebody has a strange $TMPDIR
-chmod g-s dir
-cd dir
-
-cat >printmodes.py <<EOF
-import os, sys
-
-allnames = []
-isdir = {}
-for root, dirs, files in os.walk(sys.argv[1]):
- for d in dirs:
- name = os.path.join(root, d)
- isdir[name] = 1
- allnames.append(name)
- for f in files:
- name = os.path.join(root, f)
- allnames.append(name)
-allnames.sort()
-for name in allnames:
- suffix = name in isdir and '/' or ''
- print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
-EOF
-
-cat >mode.py <<EOF
-import sys
-import os
-print '%05o' % os.lstat(sys.argv[1]).st_mode
-EOF
-
-umask 077
-
-hg init repo
-cd repo
-
-chmod 0770 .hg/store
-
-echo '% before commit'
-echo '% store can be written by the group, other files cannot'
-echo '% store is setgid'
-python ../printmodes.py .
-
-mkdir dir
-touch foo dir/bar
-hg ci -qAm 'add files'
-
-echo
-echo '% after commit'
-echo '% working dir files can only be written by the owner'
-echo '% files created in .hg can be written by the group'
-echo '% (in particular, store/**, dirstate, branch cache file, undo files)'
-echo '% new directories are setgid'
-python ../printmodes.py .
-
-umask 007
-hg init ../push
-echo
-echo '% before push'
-echo '% group can write everything'
-python ../printmodes.py ../push
-
-umask 077
-hg -q push ../push
-echo
-echo '% after push'
-echo '% group can still write everything'
-python ../printmodes.py ../push
-
-# Test that we don't lose the setgid bit when we call chmod.
-# Not all systems support setgid directories (e.g. HFS+), so
-# just check that directories have the same mode.
-cd ..
-hg init setgid
-cd setgid
-chmod g+rwx .hg/store
-chmod g+s .hg/store 2> /dev/null
-mkdir dir
-touch dir/file
-hg ci -qAm 'add dir/file'
-storemode=`python ../mode.py .hg/store`
-dirmode=`python ../mode.py .hg/store/data/dir`
-if [ "$storemode" != "$dirmode" ]; then
- echo "$storemode != $dirmode"
-fi
-
--- a/tests/test-inherit-mode.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-% before commit
-% store can be written by the group, other files cannot
-% store is setgid
-00700 ./.hg/
-00600 ./.hg/00changelog.i
-00600 ./.hg/requires
-00770 ./.hg/store/
-
-% after commit
-% working dir files can only be written by the owner
-% files created in .hg can be written by the group
-% (in particular, store/**, dirstate, branch cache file, undo files)
-% new directories are setgid
-00700 ./.hg/
-00600 ./.hg/00changelog.i
-00660 ./.hg/dirstate
-00660 ./.hg/last-message.txt
-00600 ./.hg/requires
-00770 ./.hg/store/
-00660 ./.hg/store/00changelog.i
-00660 ./.hg/store/00manifest.i
-00770 ./.hg/store/data/
-00770 ./.hg/store/data/dir/
-00660 ./.hg/store/data/dir/bar.i
-00660 ./.hg/store/data/foo.i
-00660 ./.hg/store/fncache
-00660 ./.hg/store/undo
-00660 ./.hg/undo.branch
-00660 ./.hg/undo.desc
-00660 ./.hg/undo.dirstate
-00700 ./dir/
-00600 ./dir/bar
-00600 ./foo
-
-% before push
-% group can write everything
-00770 ../push/.hg/
-00660 ../push/.hg/00changelog.i
-00660 ../push/.hg/requires
-00770 ../push/.hg/store/
-
-% after push
-% group can still write everything
-00770 ../push/.hg/
-00660 ../push/.hg/00changelog.i
-00660 ../push/.hg/branchheads.cache
-00660 ../push/.hg/requires
-00770 ../push/.hg/store/
-00660 ../push/.hg/store/00changelog.i
-00660 ../push/.hg/store/00manifest.i
-00770 ../push/.hg/store/data/
-00770 ../push/.hg/store/data/dir/
-00660 ../push/.hg/store/data/dir/bar.i
-00660 ../push/.hg/store/data/foo.i
-00660 ../push/.hg/store/fncache
-00660 ../push/.hg/store/undo
-00660 ../push/.hg/undo.branch
-00660 ../push/.hg/undo.desc
-00660 ../push/.hg/undo.dirstate
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inherit-mode.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,140 @@
+test that new files created in .hg inherit the permissions from .hg/store
+
+
+ $ "$TESTDIR/hghave" unix-permissions || exit 80
+
+ $ mkdir dir
+
+just in case somebody has a strange $TMPDIR
+
+ $ chmod g-s dir
+ $ cd dir
+
+ $ cat >printmodes.py <<EOF
+ > import os, sys
+ >
+ > allnames = []
+ > isdir = {}
+ > for root, dirs, files in os.walk(sys.argv[1]):
+ > for d in dirs:
+ > name = os.path.join(root, d)
+ > isdir[name] = 1
+ > allnames.append(name)
+ > for f in files:
+ > name = os.path.join(root, f)
+ > allnames.append(name)
+ > allnames.sort()
+ > for name in allnames:
+ > suffix = name in isdir and '/' or ''
+ > print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
+ > EOF
+
+ $ cat >mode.py <<EOF
+ > import sys
+ > import os
+ > print '%05o' % os.lstat(sys.argv[1]).st_mode
+ > EOF
+
+ $ umask 077
+
+ $ hg init repo
+ $ cd repo
+
+ $ chmod 0770 .hg/store
+
+before commit
+store can be written by the group, other files cannot
+store is setgid
+
+ $ python ../printmodes.py .
+ 00700 ./.hg/
+ 00600 ./.hg/00changelog.i
+ 00600 ./.hg/requires
+ 00770 ./.hg/store/
+
+ $ mkdir dir
+ $ touch foo dir/bar
+ $ hg ci -qAm 'add files'
+
+after commit
+working dir files can only be written by the owner
+files created in .hg can be written by the group
+(in particular, store/**, dirstate, branch cache file, undo files)
+new directories are setgid
+
+ $ python ../printmodes.py .
+ 00700 ./.hg/
+ 00600 ./.hg/00changelog.i
+ 00660 ./.hg/dirstate
+ 00660 ./.hg/last-message.txt
+ 00600 ./.hg/requires
+ 00770 ./.hg/store/
+ 00660 ./.hg/store/00changelog.i
+ 00660 ./.hg/store/00manifest.i
+ 00770 ./.hg/store/data/
+ 00770 ./.hg/store/data/dir/
+ 00660 ./.hg/store/data/dir/bar.i
+ 00660 ./.hg/store/data/foo.i
+ 00660 ./.hg/store/fncache
+ 00660 ./.hg/store/undo
+ 00660 ./.hg/undo.branch
+ 00660 ./.hg/undo.desc
+ 00660 ./.hg/undo.dirstate
+ 00700 ./dir/
+ 00600 ./dir/bar
+ 00600 ./foo
+
+ $ umask 007
+ $ hg init ../push
+
+before push
+group can write everything
+
+ $ python ../printmodes.py ../push
+ 00770 ../push/.hg/
+ 00660 ../push/.hg/00changelog.i
+ 00660 ../push/.hg/requires
+ 00770 ../push/.hg/store/
+
+ $ umask 077
+ $ hg -q push ../push
+
+after push
+group can still write everything
+
+ $ python ../printmodes.py ../push
+ 00770 ../push/.hg/
+ 00660 ../push/.hg/00changelog.i
+ 00660 ../push/.hg/branchheads.cache
+ 00660 ../push/.hg/requires
+ 00770 ../push/.hg/store/
+ 00660 ../push/.hg/store/00changelog.i
+ 00660 ../push/.hg/store/00manifest.i
+ 00770 ../push/.hg/store/data/
+ 00770 ../push/.hg/store/data/dir/
+ 00660 ../push/.hg/store/data/dir/bar.i
+ 00660 ../push/.hg/store/data/foo.i
+ 00660 ../push/.hg/store/fncache
+ 00660 ../push/.hg/store/undo
+ 00660 ../push/.hg/undo.branch
+ 00660 ../push/.hg/undo.desc
+ 00660 ../push/.hg/undo.dirstate
+
+
+Test that we don't lose the setgid bit when we call chmod.
+Not all systems support setgid directories (e.g. HFS+), so
+just check that directories have the same mode.
+
+ $ cd ..
+ $ hg init setgid
+ $ cd setgid
+ $ chmod g+rwx .hg/store
+ $ chmod g+s .hg/store 2> /dev/null
+ $ mkdir dir
+ $ touch dir/file
+ $ hg ci -qAm 'add dir/file'
+ $ storemode=`python ../mode.py .hg/store`
+ $ dirmode=`python ../mode.py .hg/store/data/dir`
+ $ if [ "$storemode" != "$dirmode" ]; then
+ > echo "$storemode != $dirmode"
+ $ fi
--- a/tests/test-init.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-init.t Sat Sep 11 00:40:19 2010 +0200
@@ -43,7 +43,7 @@
store
fncache
$ echo this > local/foo
- $ hg ci --cwd local -A -m "init" -d "1000000 0"
+ $ hg ci --cwd local -A -m "init"
adding foo
creating repo with format.usestore=false
@@ -71,10 +71,10 @@
$ hg init -e "python ./dummyssh" ssh://user@dummy/remote2
$ hg incoming -R remote2 local
comparing with local
- changeset: 0:c4e059d443be
+ changeset: 0:08b9e9f63b32
tag: tip
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: init
@@ -121,11 +121,11 @@
comparing repositories
$ hg tip -q -R local
- 0:c4e059d443be
+ 0:08b9e9f63b32
$ hg tip -q -R remote1
- 0:c4e059d443be
+ 0:08b9e9f63b32
$ hg tip -q -R remote2
- 0:c4e059d443be
+ 0:08b9e9f63b32
check names for repositories (clashes with URL schemes, special chars)
--- a/tests/test-install.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-install.t Sat Sep 11 00:40:19 2010 +0200
@@ -17,7 +17,7 @@
Checking commit editor...
Checking username...
no username supplied (see "hg help config")
- (specify a username in your .hgrc file)
+ (specify a username in your configuration file)
1 problems detected, please check your install!
$ true
--- a/tests/test-interhg Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-
-cat > .hg/hgrc <<EOF
-[extensions]
-interhg =
-
-[interhg]
-issues = s|Issue(\d+)|<a href="http://bts.example.org/issue\1">Issue\1</a>|
-
-# yes, 'x' is a weird delimiter...
-markbugs = sxbugx<i class="\x">bug</i>x
-EOF
-
-touch foo
-hg add foo
-hg commit -d '1 0' -m 'Issue123: fixed the bug!'
-
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % log
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/' | grep bts
-
-echo % errors
-cat errors.log
--- a/tests/test-interhg.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-% log
- <td class="description"><a href="/rev/1b0e7ece6bd6"><a href="http://bts.example.org/issue123">Issue123</a>: fixed the <i class="x">bug</i>!</a><span class="branchhead">default</span> <span class="tag">tip</span> </td>
-% errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-interhg.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,29 @@
+ $ hg init test
+ $ cd test
+
+ $ cat > .hg/hgrc <<EOF
+ > [extensions]
+ > interhg =
+ >
+ > [interhg]
+ > issues = s|Issue(\d+)|<a href="http://bts.example.org/issue\1">Issue\1</a>|
+ >
+ > # yes, 'x' is a weird delimiter...
+ > markbugs = sxbugx<i class="\x">bug</i>x
+ > EOF
+
+ $ touch foo
+ $ hg add foo
+ $ hg commit -d '1 0' -m 'Issue123: fixed the bug!'
+
+ $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+ $ cat hg.pid >> $DAEMON_PIDS
+
+log
+
+ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/' | grep bts
+ <td class="description"><a href="/rev/1b0e7ece6bd6"><a href="http://bts.example.org/issue123">Issue123</a>: fixed the <i class="x">bug</i>!</a><span class="branchhead">default</span> <span class="tag">tip</span> </td>
+
+errors
+
+ $ cat errors.log
--- a/tests/test-issue1089 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-mkdir a
-echo a > a/b
-hg ci -Am m
-hg rm a
-hg ci -m m a
-
-mkdir a b
-echo a > a/b
-hg ci -Am m
-hg rm a
-cd b
-# relative delete
-hg ci -m m ../a
--- a/tests/test-issue1089.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-adding a/b
-removing a/b
-adding a/b
-removing a/b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1089.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,25 @@
+# http://mercurial.selenic.com/bts/issue1089
+
+ $ hg init
+ $ mkdir a
+ $ echo a > a/b
+ $ hg ci -Am m
+ adding a/b
+
+ $ hg rm a
+ removing a/b
+ $ hg ci -m m a
+
+ $ mkdir a b
+ $ echo a > a/b
+ $ hg ci -Am m
+ adding a/b
+
+ $ hg rm a
+ removing a/b
+ $ cd b
+
+Relative delete:
+
+ $ hg ci -m m ../a
+
--- a/tests/test-issue1175 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-rm -rf a
-hg init a
-cd a
-touch a
-hg ci -Am0
-hg mv a a1
-hg ci -m1
-hg co 0
-hg mv a a2
-hg up
-hg ci -m2
-
-touch a
-hg ci -Am3
-hg mv a b
-hg ci -Am4 a
-hg ci --debug --traceback -Am5 b
-hg verify
-hg export --git tip
--- a/tests/test-issue1175.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-adding a
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-warning: detected divergent renames of a to:
- a2
- a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding a
-b
- b: searching for copy revision for a
- b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db
-committed changeset 5:89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 6 changesets, 4 total revisions
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID 89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
-# Parent 7fc86ba705e717a721dbc361bf8c9bc05a18ca2f
-5
-
-diff --git a/b b/b
-new file mode 100644
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1175.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,53 @@
+# http://mercurial.selenic.com/bts/issue1175
+
+ $ hg init
+ $ touch a
+ $ hg ci -Am0
+ adding a
+
+ $ hg mv a a1
+ $ hg ci -m1
+
+ $ hg co 0
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ hg mv a a2
+ $ hg up
+ warning: detected divergent renames of a to:
+ a2
+ a1
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg ci -m2
+
+ $ touch a
+ $ hg ci -Am3
+ adding a
+
+ $ hg mv a b
+ $ hg ci -Am4 a
+
+ $ hg ci --debug --traceback -Am5 b
+ b
+ b: searching for copy revision for a
+ b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db
+ committed changeset 5:89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
+
+ $ hg verify
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 4 files, 6 changesets, 4 total revisions
+
+ $ hg export --git tip
+ # HG changeset patch
+ # User test
+ # Date 0 0
+ # Node ID 89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
+ # Parent 7fc86ba705e717a721dbc361bf8c9bc05a18ca2f
+ 5
+
+ diff --git a/b b/b
+ new file mode 100644
+
--- a/tests/test-issue1306 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-echo % initialize remote repo with branches
-hg init remote
-cd remote
-echo a > a
-hg ci -Ama
-hg branch br
-hg ci -Amb
-echo c > c
-hg ci -Amc
-hg log
-
-cd ..
-echo % try cloning -r branch
-hg clone -rbr remote local1
-hg -R local1 parents
-
-echo % try cloning -rother clone#branch
-hg clone -r0 remote#br local2
-hg -R local2 parents
-
-echo % try cloning -r1 clone#branch
-hg clone -r1 remote#br local3
-hg -R local3 parents
--- a/tests/test-issue1306.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-% initialize remote repo with branches
-adding a
-marked working directory as branch br
-adding c
-changeset: 2:1630aed6ed2b
-branch: br
-tag: tip
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: c
-
-changeset: 1:234f53e6c5ff
-branch: br
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: b
-
-changeset: 0:cb9a9f314b8b
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: a
-
-% try cloning -r branch
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 2 files
-updating to branch br
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset: 2:1630aed6ed2b
-branch: br
-tag: tip
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: c
-
-% try cloning -rother clone#branch
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 2 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset: 0:cb9a9f314b8b
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: a
-
-% try cloning -r1 clone#branch
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 2 files
-updating to branch br
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset: 1:234f53e6c5ff
-branch: br
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: b
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1306.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,98 @@
+# http://mercurial.selenic.com/bts/issue1306
+
+Initialize remote repo with branches:
+
+ $ hg init remote
+ $ cd remote
+
+ $ echo a > a
+ $ hg ci -Ama
+ adding a
+
+ $ hg branch br
+ marked working directory as branch br
+ $ hg ci -Amb
+
+ $ echo c > c
+ $ hg ci -Amc
+ adding c
+
+ $ hg log
+ changeset: 2:1630aed6ed2b
+ branch: br
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: c
+
+ changeset: 1:234f53e6c5ff
+ branch: br
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: b
+
+ changeset: 0:cb9a9f314b8b
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: a
+
+
+ $ cd ..
+
+Try cloning -r branch:
+
+ $ hg clone -rbr remote local1
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 3 changesets with 2 changes to 2 files
+ updating to branch br
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg -R local1 parents
+ changeset: 2:1630aed6ed2b
+ branch: br
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: c
+
+
+Try cloning -rother clone#branch:
+
+ $ hg clone -r0 remote#br local2
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 3 changesets with 2 changes to 2 files
+ updating to branch default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg -R local2 parents
+ changeset: 0:cb9a9f314b8b
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: a
+
+
+Try cloning -r1 clone#branch:
+
+ $ hg clone -r1 remote#br local3
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 3 changesets with 2 changes to 2 files
+ updating to branch br
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg -R local3 parents
+ changeset: 1:234f53e6c5ff
+ branch: br
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: b
+
+
--- a/tests/test-issue1438 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#!/bin/sh
-"$TESTDIR/hghave" symlink || exit 80
-
-rm -rf a
-hg init a
-cd a
-
-ln -s foo link
-hg add link
-hg ci -mbad link
-hg rm link
-hg ci -mok
-hg diff -g -r 0:1 > bad.patch
-hg up 0
-hg import --no-commit bad.patch
-hg st
--- a/tests/test-issue1438.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-applying bad.patch
-R link
-? bad.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue1438.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,23 @@
+# http://mercurial.selenic.com/bts/issue1438
+
+ $ "$TESTDIR/hghave" symlink || exit 80
+
+ $ hg init
+
+ $ ln -s foo link
+ $ hg add link
+ $ hg ci -mbad link
+ $ hg rm link
+ $ hg ci -mok
+ $ hg diff -g -r 0:1 > bad.patch
+
+ $ hg up 0
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg import --no-commit bad.patch
+ applying bad.patch
+
+ $ hg status
+ R link
+ ? bad.patch
+
--- a/tests/test-issue2137 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-echo "% setup"
-
-# create a little extension that has 3 side-effects:
-# 1) ensure changelog data is not inlined
-# 2) make revlog to use lazyparser
-# 3) test that repo.lookup() works
-# 1 and 2 are preconditions for the bug; 3 is the bug.
-cat > commitwrapper.py <<EOF
-from mercurial import extensions, node, revlog
-
-def reposetup(ui, repo):
- def wrapcommit(orig, *args, **kwargs):
- result = orig(*args, **kwargs)
- tip1 = node.short(repo.changelog.tip())
- tip2 = node.short(repo.lookup(tip1))
- assert tip1 == tip2
- ui.write('new tip: %s\n' % tip1)
- return result
-
- extensions.wrapfunction(repo, 'commit', wrapcommit)
-
-def extsetup(ui):
- revlog._maxinline = 8 # split out 00changelog.d early
- revlog._prereadsize = 8 # use revlog.lazyparser
-EOF
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-commitwrapper = `pwd`/commitwrapper.py
-EOF
-
-hg init repo1
-cd repo1
-echo a > a
-hg commit -A -m'add a with a long commit message to make the changelog a bit bigger'
-
-echo ""
-echo "% test that new changesets are visible to repo.lookup()"
-echo a >> a
-hg commit -m'one more commit to demonstrate the bug'
-hg tip
--- a/tests/test-issue2137.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-% setup
-adding a
-new tip: 553596fad57b
-
-% test that new changesets are visible to repo.lookup()
-new tip: 799ae3599e0e
-changeset: 1:799ae3599e0e
-tag: tip
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: one more commit to demonstrate the bug
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue2137.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,56 @@
+# http://mercurial.selenic.com/bts/issue2137
+
+Setup:
+
+# create a little extension that has 3 side-effects:
+# 1) ensure changelog data is not inlined
+# 2) make revlog to use lazyparser
+# 3) test that repo.lookup() works
+# 1 and 2 are preconditions for the bug; 3 is the bug.
+
+ $ cat > commitwrapper.py <<EOF
+ > from mercurial import extensions, node, revlog
+ >
+ > def reposetup(ui, repo):
+ > def wrapcommit(orig, *args, **kwargs):
+ > result = orig(*args, **kwargs)
+ > tip1 = node.short(repo.changelog.tip())
+ > tip2 = node.short(repo.lookup(tip1))
+ > assert tip1 == tip2
+ > ui.write('new tip: %s\n' % tip1)
+ > return result
+ >
+ > extensions.wrapfunction(repo, 'commit', wrapcommit)
+ >
+ > def extsetup(ui):
+ > revlog._maxinline = 8 # split out 00changelog.d early
+ > revlog._prereadsize = 8 # use revlog.lazyparser
+ > EOF
+
+ $ cat >> $HGRCPATH <<EOF
+ > [extensions]
+ > commitwrapper = `pwd`/commitwrapper.py
+ > EOF
+
+ $ hg init repo1
+ $ cd repo1
+ $ echo a > a
+ $ hg commit -A -m'add a with a long commit message to make the changelog a bit bigger'
+ adding a
+ new tip: 553596fad57b
+
+
+Test that new changesets are visible to repo.lookup():
+
+ $ echo a >> a
+ $ hg commit -m'one more commit to demonstrate the bug'
+ new tip: 799ae3599e0e
+
+ $ hg tip
+ changeset: 1:799ae3599e0e
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: one more commit to demonstrate the bug
+
+
--- a/tests/test-issue322 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-# http://mercurial.selenic.com/bts/issue322
-
-echo % file replaced with directory
-
-hg init a
-cd a
-echo a > a
-hg commit -Ama
-rm a
-mkdir a
-echo a > a/a
-
-echo % should fail - would corrupt dirstate
-hg add a/a
-
-cd ..
-
-echo % directory replaced with file
-
-hg init c
-cd c
-mkdir a
-echo a > a/a
-hg commit -Ama
-
-rm -r a
-echo a > a
-
-echo % should fail - would corrupt dirstate
-hg add a
-
-cd ..
-
-echo % directory replaced with file
-
-hg init d
-cd d
-mkdir b
-mkdir b/c
-echo a > b/c/d
-hg commit -Ama
-rm -r b
-echo a > b
-
-echo % should fail - would corrupt dirstate
-hg add b
-
-exit 0
--- a/tests/test-issue322.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-% file replaced with directory
-adding a
-% should fail - would corrupt dirstate
-abort: file 'a' in dirstate clashes with 'a/a'
-% directory replaced with file
-adding a/a
-% should fail - would corrupt dirstate
-abort: directory 'a' already in dirstate
-% directory replaced with file
-adding b/c/d
-% should fail - would corrupt dirstate
-abort: directory 'b' already in dirstate
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue322.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,58 @@
+# http://mercurial.selenic.com/bts/issue322
+
+File replaced with directory:
+
+ $ hg init a
+ $ cd a
+ $ echo a > a
+ $ hg commit -Ama
+ adding a
+ $ rm a
+ $ mkdir a
+ $ echo a > a/a
+
+Should fail - would corrupt dirstate:
+
+ $ hg add a/a
+ abort: file 'a' in dirstate clashes with 'a/a'
+
+ $ cd ..
+
+Directory replaced with file:
+
+ $ hg init c
+ $ cd c
+ $ mkdir a
+ $ echo a > a/a
+ $ hg commit -Ama
+ adding a/a
+
+ $ rm -r a
+ $ echo a > a
+
+Should fail - would corrupt dirstate:
+
+ $ hg add a
+ abort: directory 'a' already in dirstate
+
+ $ cd ..
+
+Directory replaced with file:
+
+ $ hg init d
+ $ cd d
+ $ mkdir b
+ $ mkdir b/c
+ $ echo a > b/c/d
+ $ hg commit -Ama
+ adding b/c/d
+ $ rm -r b
+ $ echo a > b
+
+Should fail - would corrupt dirstate:
+
+ $ hg add b
+ abort: directory 'b' already in dirstate
+
+ $ exit 0
+
--- a/tests/test-issue433 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/bin/sh
-# http://mercurial.selenic.com/bts/issue433
-
-hg init a
-cd a
-echo a > a
-hg commit -Ama
-
-hg parents -r 0 doesnotexist
-true
--- a/tests/test-issue433.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-adding a
-abort: 'doesnotexist' not found in manifest!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue433.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,12 @@
+# http://mercurial.selenic.com/bts/issue433
+
+ $ hg init
+ $ echo a > a
+ $ hg commit -Ama
+ adding a
+
+ $ hg parents -r 0 doesnotexist
+ abort: 'doesnotexist' not found in manifest!
+
+ $ true
+
--- a/tests/test-issue436 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-hg -v log -v
-hg -v log -v x
-true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue436.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,6 @@
+# http://mercurial.selenic.com/bts/issue436
+
+ $ hg init
+ $ hg -v log -v
+ $ hg -v log -v x
+
--- a/tests/test-issue522 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-# In the merge below, the file "foo" has the same contents in both
-# parents, but if we look at the file-level history, we'll notice that
-# the version in p1 is an ancestor of the version in p2. This test
-# makes sure that we'll use the version from p2 in the manifest of the
-# merge revision.
-
-hg init repo
-cd repo
-
-echo foo > foo
-hg ci -qAm 'add foo'
-
-echo bar >> foo
-hg ci -m 'change foo'
-
-hg backout -r tip -m 'backout changed foo'
-
-hg up -C 0
-touch bar
-hg ci -qAm 'add bar'
-
-hg merge --debug
-hg debugstate | grep foo
-hg st -A foo
-hg ci -m 'merge'
-
-hg manifest --debug | grep foo
-hg debugindex .hg/store/data/foo.i
-
--- a/tests/test-issue522.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-reverting foo
-changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
- searching for copies back to rev 1
- unmatched files in local:
- bar
-resolving manifests
- overwrite None partial False
- ancestor bbd179dfa0a7 local 71766447bdbb+ remote 4d9e78aaceee
- foo: remote is newer -> g
-updating: foo 1/1 files (100.00%)
-getting foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-n 0 -2 unset foo
-M foo
-c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo
- rev offset length base linkrev nodeid p1 p2
- 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
- 1 5 9 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000
- 2 14 5 2 2 c6fc755d7e68 6f4310b00b9a 000000000000
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue522.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,56 @@
+# http://mercurial.selenic.com/bts/issue522
+
+# In the merge below, the file "foo" has the same contents in both
+# parents, but if we look at the file-level history, we'll notice that
+# the version in p1 is an ancestor of the version in p2. This test
+# makes sure that we'll use the version from p2 in the manifest of the
+# merge revision.
+
+ $ hg init
+
+ $ echo foo > foo
+ $ hg ci -qAm 'add foo'
+
+ $ echo bar >> foo
+ $ hg ci -m 'change foo'
+
+ $ hg backout -r tip -m 'backout changed foo'
+ reverting foo
+ changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e
+
+ $ hg up -C 0
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ touch bar
+ $ hg ci -qAm 'add bar'
+
+ $ hg merge --debug
+ searching for copies back to rev 1
+ unmatched files in local:
+ bar
+ resolving manifests
+ overwrite None partial False
+ ancestor bbd179dfa0a7 local 71766447bdbb+ remote 4d9e78aaceee
+ foo: remote is newer -> g
+ updating: foo 1/1 files (100.00%)
+ getting foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ hg debugstate | grep foo
+ n 0 -2 unset foo
+
+ $ hg st -A foo
+ M foo
+
+ $ hg ci -m 'merge'
+
+ $ hg manifest --debug | grep foo
+ c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo
+
+ $ hg debugindex .hg/store/data/foo.i
+ rev offset length base linkrev nodeid p1 p2
+ 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000
+ 1 5 9 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000
+ 2 14 5 2 2 c6fc755d7e68 6f4310b00b9a 000000000000
+
--- a/tests/test-issue612 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-
-hg init
-mkdir src
-echo a > src/a.c
-hg ci -Ama -d "10000000 0"
-
-hg mv src source
-hg ci -Ammove -d "1000000 0"
-
-hg co -C 0
-echo new > src/a.c
-echo compiled > src/a.o
-hg ci -mupdate -d "1000000 0"
-
-hg st
-
-hg merge
-
-hg st
-
--- a/tests/test-issue612.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-adding src/a.c
-moving src/a.c to source/a.c
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-? src/a.o
-merging src/a.c and source/a.c to source/a.c
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M source/a.c
-R src/a.c
-? source/a.o
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue612.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,34 @@
+# http://mercurial.selenic.com/bts/issue612
+
+ $ hg init
+ $ mkdir src
+ $ echo a > src/a.c
+ $ hg ci -Ama
+ adding src/a.c
+
+ $ hg mv src source
+ moving src/a.c to source/a.c
+
+ $ hg ci -Ammove
+
+ $ hg co -C 0
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ echo new > src/a.c
+ $ echo compiled > src/a.o
+ $ hg ci -mupdate
+ created new head
+
+ $ hg status
+ ? src/a.o
+
+ $ hg merge
+ merging src/a.c and source/a.c to source/a.c
+ 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ hg status
+ M source/a.c
+ R src/a.c
+ ? source/a.o
+
--- a/tests/test-issue619 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg ci -Ama -d '1000000000 0'
-echo b > b
-hg branch b
-hg ci -Amb -d '1000000000 0'
-hg co -C 0
-
-echo fast-forward
-hg merge b
-hg ci -Ammerge -d '1000000000 0'
-
-echo bogus fast-forward should fail
-hg merge b
-
-echo done
--- a/tests/test-issue619.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-adding a
-marked working directory as branch b
-adding b
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-fast-forward
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-bogus fast-forward should fail
-abort: merging with a working directory ancestor has no effect
-done
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue619.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,30 @@
+# http://mercurial.selenic.com/bts/issue619
+
+ $ hg init
+ $ echo a > a
+ $ hg ci -Ama
+ adding a
+
+ $ echo b > b
+ $ hg branch b
+ marked working directory as branch b
+ $ hg ci -Amb
+ adding b
+
+ $ hg co -C 0
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+Fast-forward:
+
+ $ hg merge b
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg ci -Ammerge
+
+Bogus fast-forward should fail:
+
+ $ hg merge b
+ abort: merging with a working directory ancestor has no effect
+
+ $ true
+
--- a/tests/test-issue660 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#!/bin/sh
-# http://mercurial.selenic.com/bts/issue660
-
-
-hg init a
-cd a
-echo a > a
-mkdir b
-echo b > b/b
-hg commit -A -m "a is file, b is dir"
-
-echo % file replaced with directory
-
-rm a
-mkdir a
-echo a > a/a
-
-echo % should fail - would corrupt dirstate
-hg add a/a
-
-echo % removing shadow
-hg rm --after a
-
-echo % should succeed - shadow removed
-hg add a/a
-
-echo % directory replaced with file
-
-rm -r b
-echo b > b
-
-echo % should fail - would corrupt dirstate
-hg add b
-
-echo % removing shadow
-hg rm --after b/b
-
-echo % should succeed - shadow removed
-hg add b
-
-echo % look what we got
-hg st
-
-echo % revert reintroducing shadow - should fail
-rm -r a b
-hg revert b/b
-
-echo % revert all - should succeed
-hg revert --all
-hg st
-
-echo % addremove
-
-rm -r a b
-mkdir a
-echo a > a/a
-echo b > b
-
-hg addremove -s 0
-hg st
-
-echo % commit
-hg ci -A -m "a is dir, b is file"
-hg st --all
-
-echo % long directory replaced with file
-
-mkdir d
-mkdir d/d
-echo d > d/d/d
-hg commit -A -m "d is long directory"
-rm -r d
-echo d > d
-
-echo % should fail - would corrupt dirstate
-hg add d
-
-echo % removing shadow
-hg rm --after d/d/d
-
-echo % should succeed - shadow removed
-hg add d
-hg ci -md
-
-echo % update should work at least with clean workdir
-
-rm -r a b d
-hg up -r 0
-hg st --all
-rm -r a b
-hg up -r 1
-hg st --all
-
-exit 0
--- a/tests/test-issue660.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-adding a
-adding b/b
-% file replaced with directory
-% should fail - would corrupt dirstate
-abort: file 'a' in dirstate clashes with 'a/a'
-% removing shadow
-% should succeed - shadow removed
-% directory replaced with file
-% should fail - would corrupt dirstate
-abort: directory 'b' already in dirstate
-% removing shadow
-% should succeed - shadow removed
-% look what we got
-A a/a
-A b
-R a
-R b/b
-% revert reintroducing shadow - should fail
-abort: file 'b' in dirstate clashes with 'b/b'
-% revert all - should succeed
-undeleting a
-forgetting a/a
-forgetting b
-undeleting b/b
-% addremove
-removing a
-adding a/a
-adding b
-removing b/b
-A a/a
-A b
-R a
-R b/b
-% commit
-C a/a
-C b
-% long directory replaced with file
-adding d/d/d
-% should fail - would corrupt dirstate
-abort: directory 'd' already in dirstate
-% removing shadow
-% should succeed - shadow removed
-% update should work at least with clean workdir
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-C a
-C b/b
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-C a/a
-C b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue660.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,140 @@
+# http://mercurial.selenic.com/bts/issue660
+
+ $ hg init
+ $ echo a > a
+ $ mkdir b
+ $ echo b > b/b
+ $ hg commit -A -m "a is file, b is dir"
+ adding a
+ adding b/b
+
+File replaced with directory:
+
+ $ rm a
+ $ mkdir a
+ $ echo a > a/a
+
+Should fail - would corrupt dirstate:
+
+ $ hg add a/a
+ abort: file 'a' in dirstate clashes with 'a/a'
+
+Removing shadow:
+
+ $ hg rm --after a
+
+Should succeed - shadow removed:
+
+ $ hg add a/a
+
+Directory replaced with file:
+
+ $ rm -r b
+ $ echo b > b
+
+Should fail - would corrupt dirstate:
+
+ $ hg add b
+ abort: directory 'b' already in dirstate
+
+Removing shadow:
+
+ $ hg rm --after b/b
+
+Should succeed - shadow removed:
+
+ $ hg add b
+
+Look what we got:
+
+ $ hg st
+ A a/a
+ A b
+ R a
+ R b/b
+
+Revert reintroducing shadow - should fail:
+
+ $ rm -r a b
+ $ hg revert b/b
+ abort: file 'b' in dirstate clashes with 'b/b'
+
+Revert all - should succeed:
+
+ $ hg revert --all
+ undeleting a
+ forgetting a/a
+ forgetting b
+ undeleting b/b
+
+ $ hg st
+
+addremove:
+
+ $ rm -r a b
+ $ mkdir a
+ $ echo a > a/a
+ $ echo b > b
+
+ $ hg addremove -s 0
+ removing a
+ adding a/a
+ adding b
+ removing b/b
+
+ $ hg st
+ A a/a
+ A b
+ R a
+ R b/b
+
+commit:
+
+ $ hg ci -A -m "a is dir, b is file"
+ $ hg st --all
+ C a/a
+ C b
+
+Long directory replaced with file:
+
+ $ mkdir d
+ $ mkdir d/d
+ $ echo d > d/d/d
+ $ hg commit -A -m "d is long directory"
+ adding d/d/d
+
+ $ rm -r d
+ $ echo d > d
+
+Should fail - would corrupt dirstate:
+
+ $ hg add d
+ abort: directory 'd' already in dirstate
+
+Removing shadow:
+
+ $ hg rm --after d/d/d
+
+Should succeed - shadow removed:
+
+ $ hg add d
+ $ hg ci -md
+
+Update should work at least with clean working directory:
+
+ $ rm -r a b d
+ $ hg up -r 0
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg st --all
+ C a
+ C b/b
+
+ $ rm -r a b
+ $ hg up -r 1
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg st --all
+ C a/a
+ C b
+
--- a/tests/test-issue672 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-# 0-2-4
-# \ \ \
-# 1-3-5
-#
-# rename in #1, content change in #4.
-
-hg init t
-cd t
-
-touch 1
-touch 2
-hg commit -Am init # 0
-
-hg rename 1 1a
-hg commit -m rename # 1
-
-hg co -C 0
-echo unrelated >> 2
-hg ci -m unrelated1 # 2
-
-hg merge --debug 1
-hg ci -m merge1 # 3
-
-hg co -C 2
-echo hello >> 1
-hg ci -m unrelated2 # 4
-
-hg co -C 3
-hg merge -y --debug 4
-
-hg co -C 4
-hg merge -y --debug 3
-
--- a/tests/test-issue672.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-adding 1
-adding 2
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
- searching for copies back to rev 1
- unmatched files in other:
- 1a
- all copies found (* = to merge, ! = divergent):
- 1a -> 1
- checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 81f4b099af3d local c64f439569a9+ remote c12dcd37c90a
- 1: other deleted -> r
- 1a: remote created -> g
-updating: 1 1/2 files (50.00%)
-removing 1
-updating: 1a 2/2 files (100.00%)
-getting 1a
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
- searching for copies back to rev 1
- unmatched files in local:
- 1a
- all copies found (* = to merge, ! = divergent):
- 1a -> 1 *
- checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor c64f439569a9 local e327dca35ac8+ remote 746e9549ea96
- 1a: local copied/moved to 1 -> m
-preserving 1a for resolve of 1a
-updating: 1a 1/1 files (100.00%)
-picked tool 'internal:merge' for 1a (binary False symlink False)
-merging 1a and 1 to 1a
-my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
- premerge successful
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
- searching for copies back to rev 1
- unmatched files in other:
- 1a
- all copies found (* = to merge, ! = divergent):
- 1a -> 1 *
- checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor c64f439569a9 local 746e9549ea96+ remote e327dca35ac8
- 1: remote moved to 1a -> m
-preserving 1 for resolve of 1a
-removing 1
-updating: 1 1/1 files (100.00%)
-picked tool 'internal:merge' for 1a (binary False symlink False)
-merging 1 and 1a to 1a
-my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
- premerge successful
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue672.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,101 @@
+# http://mercurial.selenic.com/bts/issue672
+
+# 0-2-4
+# \ \ \
+# 1-3-5
+#
+# rename in #1, content change in #4.
+
+ $ hg init
+
+ $ touch 1
+ $ touch 2
+ $ hg commit -Am init # 0
+ adding 1
+ adding 2
+
+ $ hg rename 1 1a
+ $ hg commit -m rename # 1
+
+ $ hg co -C 0
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ echo unrelated >> 2
+ $ hg ci -m unrelated1 # 2
+ created new head
+
+ $ hg merge --debug 1
+ searching for copies back to rev 1
+ unmatched files in other:
+ 1a
+ all copies found (* = to merge, ! = divergent):
+ 1a -> 1
+ checking for directory renames
+ resolving manifests
+ overwrite None partial False
+ ancestor 81f4b099af3d local c64f439569a9+ remote c12dcd37c90a
+ 1: other deleted -> r
+ 1a: remote created -> g
+ updating: 1 1/2 files (50.00%)
+ removing 1
+ updating: 1a 2/2 files (100.00%)
+ getting 1a
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ hg ci -m merge1 # 3
+
+ $ hg co -C 2
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ echo hello >> 1
+ $ hg ci -m unrelated2 # 4
+ created new head
+
+ $ hg co -C 3
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ hg merge -y --debug 4
+ searching for copies back to rev 1
+ unmatched files in local:
+ 1a
+ all copies found (* = to merge, ! = divergent):
+ 1a -> 1 *
+ checking for directory renames
+ resolving manifests
+ overwrite None partial False
+ ancestor c64f439569a9 local e327dca35ac8+ remote 746e9549ea96
+ 1a: local copied/moved to 1 -> m
+ preserving 1a for resolve of 1a
+ updating: 1a 1/1 files (100.00%)
+ picked tool 'internal:merge' for 1a (binary False symlink False)
+ merging 1a and 1 to 1a
+ my 1a@e327dca35ac8+ other 1@746e9549ea96 ancestor 1@81f4b099af3d
+ premerge successful
+ 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ hg co -C 4
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ hg merge -y --debug 3
+ searching for copies back to rev 1
+ unmatched files in other:
+ 1a
+ all copies found (* = to merge, ! = divergent):
+ 1a -> 1 *
+ checking for directory renames
+ resolving manifests
+ overwrite None partial False
+ ancestor c64f439569a9 local 746e9549ea96+ remote e327dca35ac8
+ 1: remote moved to 1a -> m
+ preserving 1 for resolve of 1a
+ removing 1
+ updating: 1 1/1 files (100.00%)
+ picked tool 'internal:merge' for 1a (binary False symlink False)
+ merging 1 and 1a to 1a
+ my 1a@746e9549ea96+ other 1a@e327dca35ac8 ancestor 1@81f4b099af3d
+ premerge successful
+ 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
--- a/tests/test-issue842 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-echo foo > a
-hg ci -Ama
-
-hg up -r0000
-echo bar > a
-echo % should issue warning
-hg ci -Amb
-
-hg up -r0000
-echo stuffy > a
-echo % should not issue warning
-hg ci -q -Amc
-
-hg up -r0000
-echo crap > a
-hg branch testing
-echo % should not issue warning
-hg ci -q -Amd
--- a/tests/test-issue842.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-adding a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% should issue warning
-adding a
-created new head
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% should not issue warning
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch testing
-% should not issue warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue842.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,38 @@
+# http://mercurial.selenic.com/bts/issue842
+
+ $ hg init
+ $ echo foo > a
+ $ hg ci -Ama
+ adding a
+
+ $ hg up -r0000
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ echo bar > a
+
+Should issue new head warning:
+
+ $ hg ci -Amb
+ adding a
+ created new head
+
+ $ hg up -r0000
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ echo stuffy > a
+
+Should not issue new head warning:
+
+ $ hg ci -q -Amc
+
+ $ hg up -r0000
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+ $ echo crap > a
+ $ hg branch testing
+ marked working directory as branch testing
+
+Should not issue warning:
+
+ $ hg ci -q -Amd
+
--- a/tests/test-journal-exists Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-hg init
-echo a > a
-hg ci -Am0
-hg -q clone . foo
-
-touch .hg/store/journal
-
-echo foo > a
-hg ci -Am0
-
-hg recover
-
-echo % check that zero-size journals are correctly aborted
-hg bundle -qa repo.hg
-chmod -w foo/.hg/store/00changelog.i
-hg -R foo unbundle repo.hg 2>&1 | sed 's/\(abort: Permission denied\).*/\1/'
-if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
-exit 0
--- a/tests/test-journal-exists.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-adding a
-abort: abandoned transaction found - run hg recover!
-rolling back interrupted transaction
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-% check that zero-size journals are correctly aborted
-adding changesets
-abort: Permission denied
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-journal-exists.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,34 @@
+ $ hg init
+ $ echo a > a
+ $ hg ci -Am0
+ adding a
+
+ $ hg -q clone . foo
+
+ $ touch .hg/store/journal
+
+ $ echo foo > a
+ $ hg ci -Am0
+ abort: abandoned transaction found - run hg recover!
+
+ $ hg recover
+ rolling back interrupted transaction
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 1 files, 1 changesets, 1 total revisions
+
+Check that zero-size journals are correctly aborted:
+
+ $ hg bundle -qa repo.hg
+ $ chmod -w foo/.hg/store/00changelog.i
+
+ $ hg -R foo unbundle repo.hg
+ adding changesets
+ abort: Permission denied: .*
+
+ $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
+
+ $ exit 0
+
--- a/tests/test-keyword.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-keyword.t Sat Sep 11 00:40:19 2010 +0200
@@ -331,9 +331,10 @@
Diff remaining chunk
- $ hg diff | grep -v 'b/a'
+ $ hg diff
diff -r d17e03c92c97 a
--- a/a Wed Dec 31 23:59:51 1969 -0000
+ \+\+\+ b/a .*
@@ -2,3 +2,4 @@
foo
do not process $Id:
@@ -474,9 +475,10 @@
Diff specific revision
- $ hg diff --rev 1 | grep -v 'b/c'
+ $ hg diff --rev 1
diff -r ef63ca68695b c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+ \+\+\+ b/c .*
@@ -0,0 +1,3 @@
+expand $Id$
+do not process $Id:
--- a/tests/test-locate Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-hglocate()
-{
- echo "hg locate $@"
- hg locate "$@"
- ret=$?
- echo
- return $ret
-}
-
-mkdir t
-cd t
-hg init
-echo 0 > a
-echo 0 > b
-echo 0 > t.h
-mkdir t
-echo 0 > t/x
-echo 0 > t/b
-echo 0 > t/e.h
-mkdir dir.h
-echo 0 > dir.h/foo
-hg ci -A -m m -d "1000000 0"
-touch nottracked
-hglocate a && echo locate succeeded || echo locate failed
-hglocate NONEXISTENT && echo locate succeeded || echo locate failed
-hglocate
-hg rm a
-hg ci -m m -d "1000000 0"
-hglocate a
-hglocate NONEXISTENT
-hglocate relpath:NONEXISTENT
-hglocate
-hglocate -r 0 a
-hglocate -r 0 NONEXISTENT
-hglocate -r 0 relpath:NONEXISTENT
-hglocate -r 0
-echo % -I/-X with relative path should work
-cd t
-hglocate
-hglocate -I ../t
-# test issue294
-cd ..
-rm -r t
-hglocate 't/**'
-mkdir otherdir
-cd otherdir
-hglocate b
-hglocate '*.h'
-hglocate path:t/x
-hglocate 're:.*\.h$'
-hglocate -r 0 b
-hglocate -r 0 '*.h'
-hglocate -r 0 path:t/x
-hglocate -r 0 're:.*\.h$'
--- a/tests/test-locate.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-adding a
-adding b
-adding dir.h/foo
-adding t.h
-adding t/b
-adding t/e.h
-adding t/x
-hg locate a
-a
-
-locate succeeded
-hg locate NONEXISTENT
-
-locate failed
-hg locate
-a
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-hg locate a
-
-hg locate NONEXISTENT
-
-hg locate relpath:NONEXISTENT
-
-hg locate
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-hg locate -r 0 a
-a
-
-hg locate -r 0 NONEXISTENT
-
-hg locate -r 0 relpath:NONEXISTENT
-
-hg locate -r 0
-a
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-% -I/-X with relative path should work
-hg locate
-b
-dir.h/foo
-t.h
-t/b
-t/e.h
-t/x
-
-hg locate -I ../t
-t/b
-t/e.h
-t/x
-
-hg locate t/**
-t/b
-t/e.h
-t/x
-
-hg locate b
-../b
-../t/b
-
-hg locate *.h
-../t.h
-../t/e.h
-
-hg locate path:t/x
-../t/x
-
-hg locate re:.*\.h$
-../t.h
-../t/e.h
-
-hg locate -r 0 b
-../b
-../t/b
-
-hg locate -r 0 *.h
-../t.h
-../t/e.h
-
-hg locate -r 0 path:t/x
-../t/x
-
-hg locate -r 0 re:.*\.h$
-../t.h
-../t/e.h
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-locate.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,117 @@
+ $ mkdir t
+ $ cd t
+ $ hg init
+ $ echo 0 > a
+ $ echo 0 > b
+ $ echo 0 > t.h
+ $ mkdir t
+ $ echo 0 > t/x
+ $ echo 0 > t/b
+ $ echo 0 > t/e.h
+ $ mkdir dir.h
+ $ echo 0 > dir.h/foo
+
+ $ hg ci -A -m m
+ adding a
+ adding b
+ adding dir.h/foo
+ adding t.h
+ adding t/b
+ adding t/e.h
+ adding t/x
+
+ $ touch nottracked
+
+ $ hg locate a && echo locate succeeded || echo locate failed
+ a
+ locate succeeded
+
+ $ hg locate NONEXISTENT && echo locate succeeded || echo locate failed
+ locate failed
+
+ $ hg locate
+ a
+ b
+ dir.h/foo
+ t.h
+ t/b
+ t/e.h
+ t/x
+
+ $ hg rm a
+ $ hg ci -m m
+
+ $ hg locate a
+ $ hg locate NONEXISTENT
+ $ hg locate relpath:NONEXISTENT
+ $ hg locate
+ b
+ dir.h/foo
+ t.h
+ t/b
+ t/e.h
+ t/x
+ $ hg locate -r 0 a
+ a
+ $ hg locate -r 0 NONEXISTENT
+ $ hg locate -r 0 relpath:NONEXISTENT
+ $ hg locate -r 0
+ a
+ b
+ dir.h/foo
+ t.h
+ t/b
+ t/e.h
+ t/x
+
+-I/-X with relative path should work:
+
+ $ cd t
+ $ hg locate
+ b
+ dir.h/foo
+ t.h
+ t/b
+ t/e.h
+ t/x
+ $ hg locate -I ../t
+ t/b
+ t/e.h
+ t/x
+
+Test issue294:
+
+ $ cd ..
+ $ rm -r t
+
+ $ hg locate 't/**'
+ t/b
+ t/e.h
+ t/x
+
+ $ mkdir otherdir
+ $ cd otherdir
+
+ $ hg locate b
+ ../b
+ ../t/b
+ $ hg locate '*.h'
+ ../t.h
+ ../t/e.h
+ $ hg locate path:t/x
+ ../t/x
+ $ hg locate 're:.*\.h$'
+ ../t.h
+ ../t/e.h
+ $ hg locate -r 0 b
+ ../b
+ ../t/b
+ $ hg locate -r 0 '*.h'
+ ../t.h
+ ../t/e.h
+ $ hg locate -r 0 path:t/x
+ ../t/x
+ $ hg locate -r 0 're:.*\.h$'
+ ../t.h
+ ../t/e.h
+
--- a/tests/test-lock-badness Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-hg init a
-echo a > a/a
-hg --cwd a ci -A -m a
-hg clone a b
-echo b > b/b
-hg --cwd b ci -A -m b
-chmod 100 a/.hg/store
-hg --cwd b push ../a
-chmod 700 a/.hg/store
--- a/tests/test-lock-badness.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-pushing to ../a
-abort: could not lock repository ../a: Permission denied
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lock-badness.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,21 @@
+ $ hg init a
+ $ echo a > a/a
+ $ hg -R a ci -A -m a
+ adding a
+
+ $ hg clone a b
+ updating to branch default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ echo b > b/b
+ $ hg -R b ci -A -m b
+ adding b
+
+ $ chmod 100 a/.hg/store
+
+ $ hg -R b push a
+ pushing to a
+ abort: could not lock repository a: Permission denied
+
+ $ chmod 700 a/.hg/store
+
--- a/tests/test-merge-closedheads.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-closedheads.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,5 +1,5 @@
$ hgcommit() {
- > hg commit -u user -d '0 0' "$@"
+ > hg commit -u user "$@"
> }
$ hg init clhead
--- a/tests/test-merge-internal-tools-pattern Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-internal-tools-pattern Sat Sep 11 00:40:19 2010 +0200
@@ -11,18 +11,18 @@
echo "line 1" > f
echo "line 2" >> f
echo "line 3" >> f
-hg commit -Am "revision 0" -d "1000000 0"
+hg commit -Am "revision 0"
cat f
echo "# branch 1: editing line 1"
sed 's/line 1/first line/' f > f.new
mv f.new f
-hg commit -Am "edited first line" -d "1000000 0"
+hg commit -Am "edited first line"
echo "# branch 2: editing line 3"
hg update 0
sed 's/line 3/third line/' f > f.new
mv f.new f
-hg commit -Am "edited third line" -d "1000000 0"
+hg commit -Am "edited third line"
echo "# merge using internal:fail tool"
echo "[merge-patterns]" > .hg/hgrc
--- a/tests/test-merge-local Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-local Sat Sep 11 00:40:19 2010 +0200
@@ -11,7 +11,7 @@
echo "merge ok $i" >> zzz1_merge_ok
done
echo "merge bad" > zzz2_merge_bad
-hg ci -Am "revision 0" -d "1000000 0"
+hg ci -Am "revision 0"
echo "# revision 1"
hg rm remove
@@ -22,7 +22,7 @@
echo "new first line" > zzz1_merge_ok
hg cat zzz1_merge_ok >> zzz1_merge_ok
echo "new last line" >> zzz2_merge_bad
-hg ci -m "revision 1" -d "1000000 0"
+hg ci -m "revision 1"
echo "# local changes to revision 0"
hg co 0
--- a/tests/test-merge-revert Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-revert Sat Sep 11 00:40:19 2010 +0200
@@ -6,9 +6,9 @@
echo "added file1" > file1
echo "added file2" > file2
hg add file1 file2
-hg commit -m "added file1 and file2" -d "1000000 0" -u user
+hg commit -m "added file1 and file2"
echo "changed file1" >> file1
-hg commit -m "changed file1" -d "1000000 0" -u user
+hg commit -m "changed file1"
hg -q log
hg id
hg update -C 0
--- a/tests/test-merge-revert.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-revert.out Sat Sep 11 00:40:19 2010 +0200
@@ -1,23 +1,23 @@
-1:016807e6fdaf
-0:eb43f19ff115
-016807e6fdaf tip
+1:08a16e8e4408
+0:d29c767a4b52
+08a16e8e4408 tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-eb43f19ff115
-eb43f19ff115+
+d29c767a4b52
+d29c767a4b52+
reverting file1
? file1.orig
-eb43f19ff115
+d29c767a4b52
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
? file1.orig
-016807e6fdaf tip
+08a16e8e4408 tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
? file1.orig
-016807e6fdaf tip
+08a16e8e4408 tip
? file1.orig
-016807e6fdaf tip
+08a16e8e4408 tip
? file1.orig
-016807e6fdaf tip
+08a16e8e4408 tip
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
? file1.orig
-016807e6fdaf tip
+08a16e8e4408 tip
--- a/tests/test-merge-revert2 Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-revert2 Sat Sep 11 00:40:19 2010 +0200
@@ -7,9 +7,9 @@
echo "another line of text" >> file1
echo "added file2" > file2
hg add file1 file2
-hg commit -m "added file1 and file2" -d "1000000 0" -u user
+hg commit -m "added file1 and file2"
echo "changed file1" >> file1
-hg commit -m "changed file1" -d "1000000 0" -u user
+hg commit -m "changed file1"
hg -q log
hg id
hg update -C 0
--- a/tests/test-merge-revert2.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-revert2.out Sat Sep 11 00:40:19 2010 +0200
@@ -1,20 +1,20 @@
-1:f248da0d4c3e
-0:9eca13a34789
-f248da0d4c3e tip
+1:dfab7f3c2efb
+0:c3fa057dd86f
+dfab7f3c2efb tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-9eca13a34789
-9eca13a34789+
+c3fa057dd86f
+c3fa057dd86f+
reverting file1
-9eca13a34789
+c3fa057dd86f
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-f248da0d4c3e tip
+dfab7f3c2efb tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
merging file1
warning: conflicts during merge.
merging file1 failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges
-diff -r f248da0d4c3e file1
+diff -r dfab7f3c2efb file1
--- a/file1
+++ b/file1
@@ -1,3 +1,7 @@
@@ -27,12 +27,12 @@
+>>>>>>> other
M file1
? file1.orig
-f248da0d4c3e+ tip
+dfab7f3c2efb+ tip
reverting file1
? file1.orig
-f248da0d4c3e tip
+dfab7f3c2efb tip
? file1.orig
-f248da0d4c3e tip
+dfab7f3c2efb tip
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
? file1.orig
-f248da0d4c3e tip
+dfab7f3c2efb tip
--- a/tests/test-merge-tools Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge-tools Sat Sep 11 00:40:19 2010 +0200
@@ -9,23 +9,23 @@
echo "# revision 0"
echo "revision 0" > f
echo "space" >> f
-hg commit -Am "revision 0" -d "1000000 0"
+hg commit -Am "revision 0"
echo "# revision 1"
echo "revision 1" > f
echo "space" >> f
-hg commit -Am "revision 1" -d "1000000 0"
+hg commit -Am "revision 1"
hg update 0 > /dev/null
echo "# revision 2"
echo "revision 2" > f
echo "space" >> f
-hg commit -Am "revision 2" -d "1000000 0"
+hg commit -Am "revision 2"
hg update 0 > /dev/null
echo "# revision 3 - simple to merge"
echo "revision 3" >> f
-hg commit -Am "revision 3" -d "1000000 0"
+hg commit -Am "revision 3"
echo "[merge-tools]" > .hg/hgrc
--- a/tests/test-merge1.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge1.t Sat Sep 11 00:40:19 2010 +0200
@@ -17,30 +17,30 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ hg update 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo This is file c1 > c
$ hg add c
- $ hg commit -m "commit #2" -d "1000000 0"
+ $ hg commit -m "commit #2"
created new head
$ echo This is file b1 > b
no merges expected
$ hg merge -P 1
- changeset: 1:4ee19afe4659
+ changeset: 1:b8bb4a988f25
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: commit #1
$ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg diff --nodates
- diff -r d9e5953b9dec b
+ diff -r 49035e18a8e6 b
--- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
@@ -54,16 +54,16 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ hg update 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo This is file c1 > c
$ hg add c
- $ hg commit -m "commit #2" -d "1000000 0"
+ $ hg commit -m "commit #2"
created new head
$ echo This is file b2 > b
merge should fail
@@ -76,7 +76,7 @@
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg diff --nodates
- diff -r d9e5953b9dec b
+ diff -r 49035e18a8e6 b
--- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
@@ -90,17 +90,17 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ echo This is file b22 > b
- $ hg commit -m "commit #2" -d "1000000 0"
+ $ hg commit -m "commit #2"
$ hg update 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo This is file c1 > c
$ hg add c
- $ hg commit -m "commit #3" -d "1000000 0"
+ $ hg commit -m "commit #3"
created new head
Contents of b should be "this is file b1"
@@ -117,7 +117,7 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg diff --nodates
- diff -r c1dd73cbf59f b
+ diff -r 85de557015a8 b
--- a/b
+++ b/b
@@ -1,1 +1,1 @@
@@ -132,17 +132,17 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ echo This is file b22 > b
- $ hg commit -m "commit #2" -d "1000000 0"
+ $ hg commit -m "commit #2"
$ hg update 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo This is file c1 > c
$ hg add c
- $ hg commit -m "commit #3" -d "1000000 0"
+ $ hg commit -m "commit #3"
created new head
$ echo This is file b33 > b
merge of b should fail
@@ -155,7 +155,7 @@
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg diff --nodates
- diff -r c1dd73cbf59f b
+ diff -r 85de557015a8 b
--- a/b
+++ b/b
@@ -1,1 +1,1 @@
--- a/tests/test-merge10.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge10.t Sat Sep 11 00:40:19 2010 +0200
@@ -7,7 +7,7 @@
$ mkdir -p testdir
$ echo a > testdir/a
$ hg add testdir/a
- $ hg commit -d '1000000 0' -m a
+ $ hg commit -m a
$ cd ..
$ hg clone a b
@@ -15,17 +15,17 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd a
$ echo alpha > testdir/a
- $ hg commit -d '1000000 0' -m remote-change
+ $ hg commit -m remote-change
$ cd ..
$ cd b
$ mkdir testdir/subdir
$ hg mv testdir/a testdir/subdir/a
- $ hg commit -d '1000000 0' -m move
+ $ hg commit -m move
$ mkdir newdir
$ echo beta > newdir/beta
$ hg add newdir/beta
- $ hg commit -d '1000000 0' -m local-addition
+ $ hg commit -m local-addition
$ hg pull ../a
pulling from ../a
searching for changes
@@ -43,7 +43,7 @@
$ hg stat
M testdir/subdir/a
$ hg diff --nodates
- diff -r f7459795031e testdir/subdir/a
+ diff -r bc21c9773bfa testdir/subdir/a
--- a/testdir/subdir/a
+++ b/testdir/subdir/a
@@ -1,1 +1,1 @@
--- a/tests/test-merge2.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge2.t Sat Sep 11 00:40:19 2010 +0200
@@ -3,16 +3,16 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ rm b
$ hg update 0
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo This is file b2 > b
$ hg add b
- $ hg commit -m "commit #2" -d "1000000 0"
+ $ hg commit -m "commit #2"
created new head
$ cd ..; rm -r t
@@ -21,15 +21,15 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ rm b
$ hg update 0
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo This is file b2 > b
- $ hg commit -A -m "commit #2" -d "1000000 0"
+ $ hg commit -A -m "commit #2"
adding b
created new head
$ cd ..; rm -r t
@@ -39,15 +39,15 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ rm b
$ hg remove b
$ hg update 0
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo This is file b2 > b
- $ hg commit -A -m "commit #2" -d "1000000 0"
+ $ hg commit -A -m "commit #2"
adding b
created new head
--- a/tests/test-merge4.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge4.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,20 +1,20 @@
$ hg init
$ echo This is file a1 > a
$ hg add a
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b1 > b
$ hg add b
- $ hg commit -m "commit #1" -d "1000000 0"
+ $ hg commit -m "commit #1"
$ hg update 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo This is file c1 > c
$ hg add c
- $ hg commit -m "commit #2" -d "1000000 0"
+ $ hg commit -m "commit #2"
created new head
$ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ rm b
$ echo This is file c22 > c
- $ hg commit -m "commit #3" -d "1000000 0"
+ $ hg commit -m "commit #3"
--- a/tests/test-merge5.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge5.t Sat Sep 11 00:40:19 2010 +0200
@@ -1,29 +1,35 @@
- $ mkdir t
- $ cd t
$ hg init
$ echo This is file a1 > a
$ echo This is file b1 > b
$ hg add a b
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ echo This is file b22 > b
- $ hg commit -m"comment #1" -d "1000000 0"
+ $ hg commit -m "comment #1"
$ hg update 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ rm b
- $ hg commit -A -m"comment #2" -d "1000000 0"
+ $ hg commit -A -m "comment #2"
removing b
created new head
+ $ hg update 1
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg update
+ abort: crosses branches (use 'hg merge' or use 'hg update -c')
+ $ hg update -c
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ mv a c
-in theory, we shouldn't need the "-y" below, but it prevents
-this test from hanging when "hg update" erroneously prompts the
-user for "keep or delete"
-should abort
+In theory, we shouldn't need the "-y" below, but it prevents this test
+from hanging when "hg update" erroneously prompts the user for "keep
+or delete".
+
+Should abort:
+
$ hg update -y 1
abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
$ mv c a
-should succeed
+
+Should succeed:
+
$ hg update -y 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
- $ exit 0
--- a/tests/test-merge6.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge6.t Sat Sep 11 00:40:19 2010 +0200
@@ -10,7 +10,7 @@
$ echo This is file foo1 > foo
$ echo This is file bar1 > bar
$ hg add foo bar
- $ hg commit -m "commit text" -d "1000000 0"
+ $ hg commit -m "commit text"
$ cd ..
$ hg clone A1 B1
@@ -20,11 +20,11 @@
$ cd A1
$ rm bar
$ hg remove bar
- $ hg commit -m "commit test" -d "1000000 0"
+ $ hg commit -m "commit test"
$ cd ../B1
$ echo This is file foo22 > foo
- $ hg commit -m "commit test" -d "1000000 0"
+ $ hg commit -m "commit test"
$ cd ..
$ hg clone A1 A2
@@ -46,7 +46,7 @@
$ hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
- $ hg commit -m "commit test" -d "1000000 0"
+ $ hg commit -m "commit test"
bar should remain deleted.
$ hg manifest --debug
f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 foo
@@ -63,7 +63,7 @@
$ hg merge
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
- $ hg commit -m "commit test" -d "1000000 0"
+ $ hg commit -m "commit test"
bar should remain deleted.
$ hg manifest --debug
f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 foo
--- a/tests/test-merge7.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-merge7.t Sat Sep 11 00:40:19 2010 +0200
@@ -7,7 +7,7 @@
> 3
> EOF
$ hg add test.txt
- $ hg commit -m "Initial" -d "1000000 0"
+ $ hg commit -m "Initial"
clone
$ cd ..
@@ -22,7 +22,7 @@
> two
> three
> EOF
- $ hg commit -m "Numbers as words" -d "1000000 0"
+ $ hg commit -m "Numbers as words"
change test-b
$ cd ../test-b
@@ -31,7 +31,7 @@
> 2.5
> 3
> EOF
- $ hg commit -m "2 -> 2.5" -d "1000000 0"
+ $ hg commit -m "2 -> 2.5"
now pull and merge from test-a
$ hg pull ../test-a
@@ -56,7 +56,7 @@
> EOF
$ rm -f *.orig
$ hg resolve -m test.txt
- $ hg commit -m "Merge 1" -d "1000000 0"
+ $ hg commit -m "Merge 1"
change test-a again
$ cd ../test-a
@@ -65,7 +65,7 @@
> two-point-one
> three
> EOF
- $ hg commit -m "two -> two-point-one" -d "1000000 0"
+ $ hg commit -m "two -> two-point-one"
pull and merge from test-a again
$ cd ../test-b
@@ -81,13 +81,13 @@
searching for copies back to rev 1
resolving manifests
overwrite None partial False
- ancestor faaea63e63a9 local 451c744aabcc+ remote a070d41e8360
+ ancestor 96b70246a118 local 50c3a7e29886+ remote 40d11a4173a8
test.txt: versions differ -> m
preserving test.txt for resolve of test.txt
updating: test.txt 1/1 files (100.00%)
picked tool 'internal:merge' for test.txt (binary False symlink False)
merging test.txt
- my test.txt@451c744aabcc+ other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9
+ my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
warning: conflicts during merge.
merging test.txt failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -111,33 +111,33 @@
4 58 25 4 4 d40249267ae3 8fe46a3eb557 000000000000
$ hg log
- changeset: 4:a070d41e8360
+ changeset: 4:40d11a4173a8
tag: tip
- parent: 2:faaea63e63a9
+ parent: 2:96b70246a118
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: two -> two-point-one
- changeset: 3:451c744aabcc
- parent: 1:e409be6afcc0
- parent: 2:faaea63e63a9
+ changeset: 3:50c3a7e29886
+ parent: 1:d1e159716d41
+ parent: 2:96b70246a118
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: Merge 1
- changeset: 2:faaea63e63a9
- parent: 0:095c92b91f1a
+ changeset: 2:96b70246a118
+ parent: 0:b1832b9d912a
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: Numbers as words
- changeset: 1:e409be6afcc0
+ changeset: 1:d1e159716d41
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: 2 -> 2.5
- changeset: 0:095c92b91f1a
+ changeset: 0:b1832b9d912a
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: Initial
--- a/tests/test-mq-caches.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-mq-caches.t Sat Sep 11 00:40:19 2010 +0200
@@ -46,17 +46,17 @@
$ echo foo > foo
$ hg add foo
$ echo foo > .hg/branch
- $ hg ci -m 'branch foo' -d '1000000 0'
+ $ hg ci -m 'branch foo'
$ echo bar > bar
$ hg add bar
$ echo bar > .hg/branch
- $ hg ci -m 'branch bar' -d '1000000 0'
+ $ hg ci -m 'branch bar'
$ show_branch_cache
tip: 1
- 3f910abad313ff802d3a23a7529433872df9b3ae 1
- 3f910abad313ff802d3a23a7529433872df9b3ae bar
- 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
+ c229711f16da3d7591f89b1b8d963b79bda22714 1
+ c229711f16da3d7591f89b1b8d963b79bda22714 bar
+ dc25e3827021582e979f600811852e36cbe57341 foo
add some mq patches
@@ -65,9 +65,9 @@
now at: p1
$ show_branch_cache
tip: 2
- 3f910abad313ff802d3a23a7529433872df9b3ae 1
- 3f910abad313ff802d3a23a7529433872df9b3ae bar
- 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
+ c229711f16da3d7591f89b1b8d963b79bda22714 1
+ c229711f16da3d7591f89b1b8d963b79bda22714 bar
+ dc25e3827021582e979f600811852e36cbe57341 foo
$ hg qnew p2
$ echo foo > .hg/branch
@@ -75,9 +75,9 @@
$ hg qrefresh -m 'patch 2'
$ show_branch_cache 1
tip: 3
- 3f910abad313ff802d3a23a7529433872df9b3ae 1
- 3f910abad313ff802d3a23a7529433872df9b3ae bar
- 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
+ c229711f16da3d7591f89b1b8d963b79bda22714 1
+ c229711f16da3d7591f89b1b8d963b79bda22714 bar
+ dc25e3827021582e979f600811852e36cbe57341 foo
branch foo: 3
branch bar: 2
@@ -86,9 +86,9 @@
$ rm $branches
$ show_branch_cache 1
tip: 3
- 3f910abad313ff802d3a23a7529433872df9b3ae 1
- 3f910abad313ff802d3a23a7529433872df9b3ae bar
- 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
+ c229711f16da3d7591f89b1b8d963b79bda22714 1
+ c229711f16da3d7591f89b1b8d963b79bda22714 bar
+ dc25e3827021582e979f600811852e36cbe57341 foo
branch foo: 3
branch bar: 2
@@ -97,9 +97,9 @@
$ hg qimport -r 1 -n p0
$ show_branch_cache 1
tip: 3
- 3f910abad313ff802d3a23a7529433872df9b3ae 1
- 3f910abad313ff802d3a23a7529433872df9b3ae bar
- 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
+ c229711f16da3d7591f89b1b8d963b79bda22714 1
+ c229711f16da3d7591f89b1b8d963b79bda22714 bar
+ dc25e3827021582e979f600811852e36cbe57341 foo
branch foo: 3
branch bar: 2
$ hg log -r qbase --template 'qbase: {rev}\n'
@@ -119,6 +119,6 @@
now at: p2
$ show_branch_cache
tip: 3
- 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff 0
- 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
+ dc25e3827021582e979f600811852e36cbe57341 0
+ dc25e3827021582e979f600811852e36cbe57341 foo
--- a/tests/test-mq-safety.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-mq-safety.t Sat Sep 11 00:40:19 2010 +0200
@@ -36,8 +36,8 @@
$ hg qpop
abort: popping would remove a revision not managed by this patch queue
- $ hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
- using patch queue:
+ $ hg qpop -n patches
+ using patch queue: .*/repo/.hg/patches
abort: popping would remove a revision not managed by this patch queue
$ hg qrefresh
abort: working directory revision is not qtip
--- a/tests/test-mq.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-mq.t Sat Sep 11 00:40:19 2010 +0200
@@ -195,7 +195,7 @@
$ mkdir f
$ cd f
$ hg init --mq
- abort: There is no Mercurial repository here (.hg not found)
+ abort: there is no Mercurial repository here (.hg not found)
$ cd ..
init --mq with repo path
@@ -941,7 +941,7 @@
created new head
$ hg up -C 1
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
- $ hg qrefresh --git 2>&1 | grep -v 'saving bundle'
+ $ hg qrefresh --git
$ cat .hg/patches/bar
diff --git a/bar b/bar
new file mode 100644
@@ -983,7 +983,7 @@
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg mv bar quux
$ hg mv baz bleh
- $ hg qrefresh --git 2>&1 | grep -v 'saving bundle'
+ $ hg qrefresh --git
$ cat .hg/patches/bar
diff --git a/foo b/bleh
rename from foo
--- a/tests/test-newbranch Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-newbranch Sat Sep 11 00:40:19 2010 +0200
@@ -8,16 +8,16 @@
echo foo > a
hg add a
-hg ci -m "initial" -d "1000000 0"
+hg ci -m "initial"
hg branch foo
hg branch
-hg ci -m "add branch name" -d "1000000 0"
+hg ci -m "add branch name"
hg branch bar
-hg ci -m "change branch name" -d "1000000 0"
+hg ci -m "change branch name"
echo % branch shadowing
hg branch default
hg branch -f default
-hg ci -m "clear branch name" -d "1000000 0"
+hg ci -m "clear branch name"
echo % there should be only one default branch head
hg heads .
@@ -25,11 +25,11 @@
hg co foo
hg branch
echo bleah > a
-hg ci -m "modify a branch" -d "1000000 0"
+hg ci -m "modify a branch"
hg merge default
hg branch
-hg ci -m "merge" -d "1000000 0"
+hg ci -m "merge"
hg log
hg branches
@@ -68,11 +68,11 @@
echo % fastforward merge
hg branch ff
echo ff > ff
-hg ci -Am'fast forward' -d '1000000 0'
+hg ci -Am'fast forward'
hg up foo
hg merge ff
hg branch
-hg commit -m'Merge ff into foo' -d '1000000 0'
+hg commit -m'Merge ff into foo'
hg parents
hg manifest
--- a/tests/test-newbranch.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-newbranch.out Sat Sep 11 00:40:19 2010 +0200
@@ -6,10 +6,10 @@
marked working directory as branch default
created new head
% there should be only one default branch head
-changeset: 3:bf1bc2f45e83
+changeset: 3:9d567d0b51f9
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: clear branch name
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -17,92 +17,92 @@
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
foo
-changeset: 5:5f8fb06e083e
+changeset: 5:dc140083783b
branch: foo
tag: tip
-parent: 4:4909a3732169
-parent: 3:bf1bc2f45e83
+parent: 4:98d14f698afe
+parent: 3:9d567d0b51f9
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: merge
-changeset: 4:4909a3732169
+changeset: 4:98d14f698afe
branch: foo
-parent: 1:b699b1cec9c2
+parent: 1:0079f24813e2
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: modify a branch
-changeset: 3:bf1bc2f45e83
+changeset: 3:9d567d0b51f9
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: clear branch name
-changeset: 2:67ec16bde7f1
+changeset: 2:ed2bbf4e0102
branch: bar
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: change branch name
-changeset: 1:b699b1cec9c2
+changeset: 1:0079f24813e2
branch: foo
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: add branch name
-changeset: 0:be8523e69bf8
+changeset: 0:db01e8ea3388
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: initial
-foo 5:5f8fb06e083e
-default 3:bf1bc2f45e83 (inactive)
-bar 2:67ec16bde7f1 (inactive)
+foo 5:dc140083783b
+default 3:9d567d0b51f9 (inactive)
+bar 2:ed2bbf4e0102 (inactive)
foo
default
bar
% test for invalid branch cache
rolling back to revision 4 (undo commit)
-changeset: 4:4909a3732169
+changeset: 4:98d14f698afe
branch: foo
tag: tip
-parent: 1:b699b1cec9c2
+parent: 1:0079f24813e2
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: modify a branch
invalidating branch cache (tip differs)
-changeset: 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
+changeset: 4:98d14f698afeaff8cb612dcf215ce95e639effc3
branch: foo
tag: tip
-parent: 1:b699b1cec9c2966b3700de4fef0dc123cd754c31
+parent: 1:0079f24813e2b73a891577c243684c5066347bc8
parent: -1:0000000000000000000000000000000000000000
manifest: 4:d01b250baaa05909152f7ae07d7a649deea0df9a
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
files: a
extra: branch=foo
description:
modify a branch
-4:4909a3732169
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4
-bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
-67ec16bde7f1575d523313b9bca000f6a6f12dca bar
+4:98d14f698afe
+98d14f698afeaff8cb612dcf215ce95e639effc3 4
+9d567d0b51f9e2068b054e1948e1a927f99b5874 default
+98d14f698afeaff8cb612dcf215ce95e639effc3 foo
+ed2bbf4e01029020711be82ca905283e883f0e11 bar
% push should update the branch cache
% pushing just rev 0
-be8523e69bf892e25817fc97187516b3c0804ae4 0
-be8523e69bf892e25817fc97187516b3c0804ae4 default
+db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
+db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default
% pushing everything
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4
-bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default
-4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
-67ec16bde7f1575d523313b9bca000f6a6f12dca bar
+98d14f698afeaff8cb612dcf215ce95e639effc3 4
+9d567d0b51f9e2068b054e1948e1a927f99b5874 default
+98d14f698afeaff8cb612dcf215ce95e639effc3 foo
+ed2bbf4e01029020711be82ca905283e883f0e11 bar
% update with no arguments: tipmost revision of the current branch
-bf1bc2f45e83
-4909a3732169 (foo) tip
+9d567d0b51f9
+98d14f698afe (foo) tip
marked working directory as branch foobar
abort: branch foobar not found
% fastforward merge
@@ -112,13 +112,13 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
foo
-changeset: 6:f0c74f92a385
+changeset: 6:917eb54e1b4b
branch: foo
tag: tip
-parent: 4:4909a3732169
-parent: 5:c420d2121b71
+parent: 4:98d14f698afe
+parent: 5:6683a60370cb
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: Merge ff into foo
a
--- a/tests/test-non-interactive-wsgi Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/bin/sh
-# Tests if hgweb can run without touching sys.stdin, as is required
-# by the WSGI standard and strictly implemented by mod_wsgi.
-
-mkdir repo
-cd repo
-hg init
-echo foo > bar
-hg add bar
-hg commit -m "test"
-hg tip
-
-cat > request.py <<EOF
-from mercurial import dispatch
-from mercurial.hgweb.hgweb_mod import hgweb
-from mercurial.ui import ui
-from mercurial import hg
-from StringIO import StringIO
-import os, sys
-
-class FileLike(object):
- def __init__(self, real):
- self.real = real
- def fileno(self):
- print >> sys.__stdout__, 'FILENO'
- return self.real.fileno()
- def read(self):
- print >> sys.__stdout__, 'READ'
- return self.real.read()
- def readline(self):
- print >> sys.__stdout__, 'READLINE'
- return self.real.readline()
-
-sys.stdin = FileLike(sys.stdin)
-errors = StringIO()
-input = StringIO()
-output = StringIO()
-
-def startrsp(headers, data):
- print '---- HEADERS'
- print headers
- print '---- DATA'
- print data
- return output.write
-
-env = {
- 'wsgi.version': (1, 0),
- 'wsgi.url_scheme': 'http',
- 'wsgi.errors': errors,
- 'wsgi.input': input,
- 'wsgi.multithread': False,
- 'wsgi.multiprocess': False,
- 'wsgi.run_once': False,
- 'REQUEST_METHOD': 'GET',
- 'SCRIPT_NAME': '',
- 'PATH_INFO': '',
- 'QUERY_STRING': '',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': os.environ['HGPORT'],
- 'SERVER_PROTOCOL': 'HTTP/1.0'
-}
-
-i = hgweb('.')
-i(env, startrsp)
-print '---- ERRORS'
-print errors.getvalue()
-print '---- OS.ENVIRON wsgi variables'
-print sorted([x for x in os.environ if x.startswith('wsgi')])
-print '---- request.ENVIRON wsgi variables'
-print sorted([x for x in i.repo.ui.environ if x.startswith('wsgi')])
-EOF
-
-python request.py
--- a/tests/test-non-interactive-wsgi.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-changeset: 0:61c9426e69fe
-tag: tip
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: test
-
----- HEADERS
-200 Script output follows
----- DATA
-[('Content-Type', 'text/html; charset=ascii')]
----- ERRORS
-
----- OS.ENVIRON wsgi variables
-[]
----- request.ENVIRON wsgi variables
-['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version']
--- a/tests/test-parse-date Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-#!/bin/sh
-
-# This runs with TZ="GMT"
-hg init
-echo "test-parse-date" > a
-hg add a
-hg ci -d "2006-02-01 13:00:30" -m "rev 0"
-echo "hi!" >> a
-hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1"
-hg tag -d "2006-04-15 13:30" "Hi"
-hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1
-hg ci -d "1150000000 14400" -m "rev 4 (merge)"
-echo "fail" >> a
-hg ci -d "should fail" -m "fail"
-hg ci -d "100000000000000000 1400" -m "fail"
-hg ci -d "100000 1400000" -m "fail"
-
-# Check with local timezone other than GMT and with DST
-TZ="PST+8PDT"
-export TZ
-# PST=UTC-8 / PDT=UTC-7
-hg debugrebuildstate
-echo "a" > a
-hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
-hg debugrebuildstate
-echo "b" > a
-hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5"
-hg debugrebuildstate
-echo "c" > a
-hg ci -d "2006-01-15 13:30" -m "winter@UTC-8"
-hg debugrebuildstate
-echo "d" > a
-hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5"
-hg log --template '{date|date}\n'
-
-# Test issue1014 (fractional timezones)
-hg debugdate "1000000000 -16200" # 0430
-hg debugdate "1000000000 -15300" # 0415
-hg debugdate "1000000000 -14400" # 0400
-hg debugdate "1000000000 0" # GMT
-hg debugdate "1000000000 14400" # -0400
-hg debugdate "1000000000 15300" # -0415
-hg debugdate "1000000000 16200" # -0430
-hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
-hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
-
-# Test 12-hours times
-hg debugdate "2006-02-01 1:00:30PM +0000"
-hg debugdate "1:00:30PM" > /dev/null || echo 'failed'
-
-#Test date formats with '>' or '<' accompanied by space characters
-hg log -d '>' --template '{date|date}\n'
-hg log -d '<' hg log -d '>' --template '{date|date}\n'
-
-hg log -d ' >' --template '{date|date}\n'
-hg log -d ' <' --template '{date|date}\n'
-
-hg log -d '> ' --template '{date|date}\n'
-hg log -d '< ' --template '{date|date}\n'
-
-hg log -d ' > ' --template '{date|date}\n'
-hg log -d ' < ' --template '{date|date}\n'
-
-
-hg log -d '>02/01' --template '{date|date}\n'
-hg log -d '<02/01' --template '{date|date}\n'
-
-hg log -d ' >02/01' --template '{date|date}\n'
-hg log -d ' <02/01' --template '{date|date}\n'
-
-hg log -d '> 02/01' --template '{date|date}\n'
-hg log -d '< 02/01' --template '{date|date}\n'
-
-hg log -d ' > 02/01' --template '{date|date}\n'
-hg log -d ' < 02/01' --template '{date|date}\n'
-
-hg log -d '>02/01 ' --template '{date|date}\n'
-hg log -d '<02/01 ' --template '{date|date}\n'
-
-hg log -d ' >02/01 ' --template '{date|date}\n'
-hg log -d ' <02/01 ' --template '{date|date}\n'
-
-hg log -d '> 02/01 ' --template '{date|date}\n'
-hg log -d '< 02/01 ' --template '{date|date}\n'
-
-hg log -d ' > 02/01 ' --template '{date|date}\n'
-hg log -d ' < 02/01 ' --template '{date|date}\n'
--- a/tests/test-parse-date.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-reverting a
-created new head
-changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8
-merging with changeset 3:107ce1ee2b43
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-abort: invalid date: 'should fail'
-abort: date exceeds 32 bits: 100000000000000000
-abort: impossible time zone offset: 1400000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-internal: 1000000000 -16200
-standard: Sun Sep 09 06:16:40 2001 +0430
-internal: 1000000000 -15300
-standard: Sun Sep 09 06:01:40 2001 +0415
-internal: 1000000000 -14400
-standard: Sun Sep 09 05:46:40 2001 +0400
-internal: 1000000000 0
-standard: Sun Sep 09 01:46:40 2001 +0000
-internal: 1000000000 14400
-standard: Sat Sep 08 21:46:40 2001 -0400
-internal: 1000000000 15300
-standard: Sat Sep 08 21:31:40 2001 -0415
-internal: 1000000000 16200
-standard: Sat Sep 08 21:16:40 2001 -0430
-internal: 999967600 -16200
-standard: Sat Sep 08 21:16:40 2001 +0430
-internal: 1000000000 16200
-standard: Sat Sep 08 21:16:40 2001 -0430
-internal: 1138798830 0
-standard: Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
-Sun Jan 15 13:30:00 2006 +0500
-Sun Jan 15 13:30:00 2006 -0800
-Sat Jul 15 13:30:00 2006 +0500
-Sat Jul 15 13:30:00 2006 -0700
-Sun Jun 11 00:26:40 2006 -0400
-Sat Apr 15 13:30:00 2006 +0200
-Sat Apr 15 13:30:00 2006 +0000
-Wed Feb 01 13:00:30 2006 -0500
-Wed Feb 01 13:00:30 2006 +0000
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-parse-date.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,237 @@
+This runs with TZ="GMT"
+
+ $ hg init
+ $ echo "test-parse-date" > a
+ $ hg add a
+ $ hg ci -d "2006-02-01 13:00:30" -m "rev 0"
+ $ echo "hi!" >> a
+ $ hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1"
+ $ hg tag -d "2006-04-15 13:30" "Hi"
+ $ hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1
+ reverting a
+ created new head
+ changeset 3:107ce1ee2b43 backs out changeset 1:25a1420a55f8
+ merging with changeset 3:107ce1ee2b43
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg ci -d "1150000000 14400" -m "rev 4 (merge)"
+ $ echo "fail" >> a
+ $ hg ci -d "should fail" -m "fail"
+ abort: invalid date: 'should fail'
+ $ hg ci -d "100000000000000000 1400" -m "fail"
+ abort: date exceeds 32 bits: 100000000000000000
+ $ hg ci -d "100000 1400000" -m "fail"
+ abort: impossible time zone offset: 1400000
+
+Check with local timezone other than GMT and with DST
+
+ $ TZ="PST+8PDT"
+ $ export TZ
+
+PST=UTC-8 / PDT=UTC-7
+
+ $ hg debugrebuildstate
+ $ echo "a" > a
+ $ hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
+ $ hg debugrebuildstate
+ $ echo "b" > a
+ $ hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5"
+ $ hg debugrebuildstate
+ $ echo "c" > a
+ $ hg ci -d "2006-01-15 13:30" -m "winter@UTC-8"
+ $ hg debugrebuildstate
+ $ echo "d" > a
+ $ hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5"
+ $ hg log --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+Test issue1014 (fractional timezones)
+
+ $ hg debugdate "1000000000 -16200" # 0430
+ internal: 1000000000 -16200
+ standard: Sun Sep 09 06:16:40 2001 +0430
+ $ hg debugdate "1000000000 -15300" # 0415
+ internal: 1000000000 -15300
+ standard: Sun Sep 09 06:01:40 2001 +0415
+ $ hg debugdate "1000000000 -14400" # 0400
+ internal: 1000000000 -14400
+ standard: Sun Sep 09 05:46:40 2001 +0400
+ $ hg debugdate "1000000000 0" # GMT
+ internal: 1000000000 0
+ standard: Sun Sep 09 01:46:40 2001 +0000
+ $ hg debugdate "1000000000 14400" # -0400
+ internal: 1000000000 14400
+ standard: Sat Sep 08 21:46:40 2001 -0400
+ $ hg debugdate "1000000000 15300" # -0415
+ internal: 1000000000 15300
+ standard: Sat Sep 08 21:31:40 2001 -0415
+ $ hg debugdate "1000000000 16200" # -0430
+ internal: 1000000000 16200
+ standard: Sat Sep 08 21:16:40 2001 -0430
+ $ hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
+ internal: 999967600 -16200
+ standard: Sat Sep 08 21:16:40 2001 +0430
+ $ hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
+ internal: 1000000000 16200
+ standard: Sat Sep 08 21:16:40 2001 -0430
+
+Test 12-hours times
+
+ $ hg debugdate "2006-02-01 1:00:30PM +0000"
+ internal: 1138798830 0
+ standard: Wed Feb 01 13:00:30 2006 +0000
+ $ hg debugdate "1:00:30PM" > /dev/null || echo 'failed'
+
+Test date formats with '>' or '<' accompanied by space characters
+
+ $ hg log -d '>' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+ $ hg log -d '<' hg log -d '>' --template '{date|date}\n'
+
+ $ hg log -d ' >' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+ $ hg log -d ' <' --template '{date|date}\n'
+
+ $ hg log -d '> ' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+ $ hg log -d '< ' --template '{date|date}\n'
+
+ $ hg log -d ' > ' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+ $ hg log -d ' < ' --template '{date|date}\n'
+
+ $ hg log -d '>02/01' --template '{date|date}\n'
+ $ hg log -d '<02/01' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+ $ hg log -d ' >02/01' --template '{date|date}\n'
+ $ hg log -d ' <02/01' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+ $ hg log -d '> 02/01' --template '{date|date}\n'
+ $ hg log -d '< 02/01' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+ $ hg log -d ' > 02/01' --template '{date|date}\n'
+ $ hg log -d ' < 02/01' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+ $ hg log -d '>02/01 ' --template '{date|date}\n'
+ $ hg log -d '<02/01 ' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+ $ hg log -d ' >02/01 ' --template '{date|date}\n'
+ $ hg log -d ' <02/01 ' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+ $ hg log -d '> 02/01 ' --template '{date|date}\n'
+ $ hg log -d '< 02/01 ' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
+
+ $ hg log -d ' > 02/01 ' --template '{date|date}\n'
+ $ hg log -d ' < 02/01 ' --template '{date|date}\n'
+ Sun Jan 15 13:30:00 2006 +0500
+ Sun Jan 15 13:30:00 2006 -0800
+ Sat Jul 15 13:30:00 2006 +0500
+ Sat Jul 15 13:30:00 2006 -0700
+ Sun Jun 11 00:26:40 2006 -0400
+ Sat Apr 15 13:30:00 2006 +0200
+ Sat Apr 15 13:30:00 2006 +0000
+ Wed Feb 01 13:00:30 2006 -0500
+ Wed Feb 01 13:00:30 2006 +0000
--- a/tests/test-parseindex Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-parseindex Sat Sep 11 00:40:19 2010 +0200
@@ -14,10 +14,10 @@
cd a
echo abc > foo
hg add foo
-hg commit -m 'add foo' -d '1000000 0'
+hg commit -m 'add foo'
echo >> foo
-hg commit -m 'change foo' -d '1000001 0'
+hg commit -m 'change foo'
hg log -r 0:
cat >> test.py << EOF
--- a/tests/test-parseindex.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-parseindex.out Sat Sep 11 00:40:19 2010 +0200
@@ -1,14 +1,14 @@
-changeset: 0:9c2cf2b35aa7
+changeset: 0:7c31755bf9b5
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: add foo
-changeset: 1:3756a9556b89
+changeset: 1:26333235a41c
tag: tip
user: test
-date: Mon Jan 12 13:46:41 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: change foo
2 revisions:
-9c2cf2b35aa7
-3756a9556b89
+7c31755bf9b5
+26333235a41c
--- a/tests/test-patchbomb.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-patchbomb.t Sat Sep 11 00:40:19 2010 +0200
@@ -46,6 +46,23 @@
+a
+ $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
+ > n
+ > EOF
+ This patch series consists of 1 patches.
+
+
+ Final summary:
+
+ From: quux
+ To: foo
+ Cc: bar
+ Subject: [PATCH] a
+ a | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+ are you sure you want to send (yn)? abort: patchbomb canceled
+
$ echo b > b
$ hg commit -Amb -d '2 0'
adding b
@@ -332,11 +349,17 @@
> fixheaders
This patch series consists of 1 patches.
- c
+
+ Final summary:
+ From: quux
+ To: foo
+ Cc: bar
+ Subject: [PATCH] test
c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
+ are you sure you want to send (yn)? y
Displaying [PATCH] test ...
Content-Type: text/plain; charset="us-ascii"
@@ -374,25 +397,27 @@
> -r 0:1 | fixheaders
This patch series consists of 2 patches.
- a
+
+ Write the introductory message for the patch series.
+
+
+ Final summary:
+ From: quux
+ To: foo
+ Cc: bar
+ Subject: [PATCH 0 of 2] test
+ a | 1 +
+ b | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+ Subject: [PATCH 1 of 2] a
a | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
-
- b
-
+ Subject: [PATCH 2 of 2] b
b | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
- Final summary:
-
- a | 1 +
- b | 1 +
- 2 files changed, 2 insertions(+), 0 deletions(-)
-
-
- Write the introductory message for the patch series.
-
+ are you sure you want to send (yn)? y
Displaying [PATCH 0 of 2] test ...
Content-Type: text/plain; charset="us-ascii"
@@ -1772,6 +1797,7 @@
$ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0
This patch series consists of 1 patches.
+ Cc:
Writing [PATCH] test ...
@@ -1816,11 +1842,13 @@
$ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t
comparing with ../t
searching for changes
+ From [test]: test
This patch series consists of 8 patches.
Write the introductory message for the patch series.
+ Cc:
Displaying [PATCH 0 of 8] test ...
Content-Type: text/plain; charset="us-ascii"
@@ -2088,8 +2116,10 @@
$ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test
comparing with ../t
searching for changes
+ From [test]: test
This patch series consists of 1 patches.
+ Cc:
Displaying [PATCH] test ...
Content-Type: text/plain; charset="us-ascii"
--- a/tests/test-permissions Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-permissions Sat Sep 11 00:40:19 2010 +0200
@@ -7,7 +7,7 @@
echo '% hg add a'
hg add a
echo '% hg commit'
-hg commit -m "1" -d "1000000 0"
+hg commit -m "1"
echo '% hg verify'
hg verify
chmod -r .hg/store/data/a.i
@@ -19,7 +19,7 @@
chmod -w .hg/store/data/a.i
echo barber > a
echo '% hg commit'
-hg commit -m "2" -d "1000000 0" 2>/dev/null || echo commit failed
+hg commit -m "2" 2>/dev/null || echo commit failed
chmod -w .
echo '% hg diff'
hg diff --nodates
--- a/tests/test-permissions.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-permissions.out Sat Sep 11 00:40:19 2010 +0200
@@ -22,7 +22,7 @@
% hg commit
commit failed
% hg diff
-diff -r c1fab96507ef a
+diff -r 2a18120dc1c9 a
--- a/a
+++ b/a
@@ -1,1 +1,1 @@
--- a/tests/test-pull-permission Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-pull-permission Sat Sep 11 00:40:19 2010 +0200
@@ -5,7 +5,7 @@
hg init
echo foo > b
hg add b
-hg ci -m "b" -d "1000000 0"
+hg ci -m "b"
chmod -w .hg/store
--- a/tests/test-purge Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-purge =
-EOF
-
-echo % init
-hg init t
-cd t
-
-echo % setup
-echo r1 > r1
-hg ci -qAmr1 -d'0 0'
-mkdir directory
-echo r2 > directory/r2
-hg ci -qAmr2 -d'1 0'
-echo 'ignored' > .hgignore
-hg ci -qAmr3 -d'2 0'
-
-echo % delete an empty directory
-mkdir empty_dir
-hg purge -p
-hg purge -v
-ls
-
-echo % delete an untracked directory
-mkdir untracked_dir
-touch untracked_dir/untracked_file1
-touch untracked_dir/untracked_file2
-hg purge -p
-hg purge -v
-ls
-
-echo % delete an untracked file
-touch untracked_file
-touch untracked_file_readonly
-python <<EOF
-import os, stat
-f= 'untracked_file_readonly'
-os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE)
-EOF
-hg purge -p
-hg purge -v
-ls
-
-echo % delete an untracked file in a tracked directory
-touch directory/untracked_file
-hg purge -p
-hg purge -v
-ls
-
-echo % delete nested directories
-mkdir -p untracked_directory/nested_directory
-hg purge -p
-hg purge -v
-ls
-
-echo % delete nested directories from a subdir
-mkdir -p untracked_directory/nested_directory
-cd directory
-hg purge -p
-hg purge -v
-cd ..
-ls
-
-echo % delete only part of the tree
-mkdir -p untracked_directory/nested_directory
-touch directory/untracked_file
-cd directory
-hg purge -p ../untracked_directory
-hg purge -v ../untracked_directory
-cd ..
-ls
-ls directory/untracked_file
-rm directory/untracked_file
-
-echo % skip ignored files if --all not specified
-touch ignored
-hg purge -p
-hg purge -v
-ls
-hg purge -p --all
-hg purge -v --all
-ls
-
-echo % abort with missing files until we support name mangling filesystems
-touch untracked_file
-rm r1
-# hide error messages to avoid changing the output when the text changes
-hg purge -p 2> /dev/null
-hg st
-
-hg purge -p
-hg purge -v 2> /dev/null
-hg st
-
-hg purge -v
-hg revert --all --quiet
-hg st -a
-
-echo '% tracked file in ignored directory (issue621)'
-echo directory >> .hgignore
-hg ci -m 'ignore directory'
-touch untracked_file
-hg purge -p
-hg purge -v
-
-echo % skip excluded files
-touch excluded_file
-hg purge -p -X excluded_file
-hg purge -v -X excluded_file
-ls
-rm excluded_file
-
-echo % skip files in excluded dirs
-mkdir excluded_dir
-touch excluded_dir/file
-hg purge -p -X excluded_dir
-hg purge -v -X excluded_dir
-ls
-ls excluded_dir
-rm -R excluded_dir
-
-echo % skip excluded empty dirs
-mkdir excluded_dir
-hg purge -p -X excluded_dir
-hg purge -v -X excluded_dir
-ls
-rmdir excluded_dir
-
-echo % skip patterns
-mkdir .svn
-touch .svn/foo
-mkdir directory/.svn
-touch directory/.svn/foo
-hg purge -p -X .svn -X '*/.svn'
-hg purge -p -X re:.*.svn
--- a/tests/test-purge.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-% init
-% setup
-% delete an empty directory
-empty_dir
-Removing directory empty_dir
-directory
-r1
-% delete an untracked directory
-untracked_dir/untracked_file1
-untracked_dir/untracked_file2
-Removing file untracked_dir/untracked_file1
-Removing file untracked_dir/untracked_file2
-Removing directory untracked_dir
-directory
-r1
-% delete an untracked file
-untracked_file
-untracked_file_readonly
-Removing file untracked_file
-Removing file untracked_file_readonly
-directory
-r1
-% delete an untracked file in a tracked directory
-directory/untracked_file
-Removing file directory/untracked_file
-directory
-r1
-% delete nested directories
-untracked_directory/nested_directory
-Removing directory untracked_directory/nested_directory
-Removing directory untracked_directory
-directory
-r1
-% delete nested directories from a subdir
-untracked_directory/nested_directory
-Removing directory untracked_directory/nested_directory
-Removing directory untracked_directory
-directory
-r1
-% delete only part of the tree
-untracked_directory/nested_directory
-Removing directory untracked_directory/nested_directory
-Removing directory untracked_directory
-directory
-r1
-directory/untracked_file
-% skip ignored files if --all not specified
-directory
-ignored
-r1
-ignored
-Removing file ignored
-directory
-r1
-% abort with missing files until we support name mangling filesystems
-untracked_file
-! r1
-? untracked_file
-untracked_file
-Removing file untracked_file
-! r1
-% tracked file in ignored directory (issue621)
-untracked_file
-Removing file untracked_file
-% skip excluded files
-directory
-excluded_file
-r1
-% skip files in excluded dirs
-directory
-excluded_dir
-r1
-file
-% skip excluded empty dirs
-directory
-excluded_dir
-r1
-% skip patterns
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-purge.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,216 @@
+ $ cat <<EOF >> $HGRCPATH
+ > [extensions]
+ > purge =
+ > EOF
+
+init
+
+ $ hg init t
+ $ cd t
+
+setup
+
+ $ echo r1 > r1
+ $ hg ci -qAmr1 -d'0 0'
+ $ mkdir directory
+ $ echo r2 > directory/r2
+ $ hg ci -qAmr2 -d'1 0'
+ $ echo 'ignored' > .hgignore
+ $ hg ci -qAmr3 -d'2 0'
+
+delete an empty directory
+
+ $ mkdir empty_dir
+ $ hg purge -p
+ empty_dir
+ $ hg purge -v
+ Removing directory empty_dir
+ $ ls
+ directory
+ r1
+
+delete an untracked directory
+
+ $ mkdir untracked_dir
+ $ touch untracked_dir/untracked_file1
+ $ touch untracked_dir/untracked_file2
+ $ hg purge -p
+ untracked_dir/untracked_file1
+ untracked_dir/untracked_file2
+ $ hg purge -v
+ Removing file untracked_dir/untracked_file1
+ Removing file untracked_dir/untracked_file2
+ Removing directory untracked_dir
+ $ ls
+ directory
+ r1
+
+delete an untracked file
+
+ $ touch untracked_file
+ $ touch untracked_file_readonly
+ $ python <<EOF
+ > import os, stat
+ > f= 'untracked_file_readonly'
+ > os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE)
+ > EOF
+ $ hg purge -p
+ untracked_file
+ untracked_file_readonly
+ $ hg purge -v
+ Removing file untracked_file
+ Removing file untracked_file_readonly
+ $ ls
+ directory
+ r1
+
+delete an untracked file in a tracked directory
+
+ $ touch directory/untracked_file
+ $ hg purge -p
+ directory/untracked_file
+ $ hg purge -v
+ Removing file directory/untracked_file
+ $ ls
+ directory
+ r1
+
+delete nested directories
+
+ $ mkdir -p untracked_directory/nested_directory
+ $ hg purge -p
+ untracked_directory/nested_directory
+ $ hg purge -v
+ Removing directory untracked_directory/nested_directory
+ Removing directory untracked_directory
+ $ ls
+ directory
+ r1
+
+delete nested directories from a subdir
+
+ $ mkdir -p untracked_directory/nested_directory
+ $ cd directory
+ $ hg purge -p
+ untracked_directory/nested_directory
+ $ hg purge -v
+ Removing directory untracked_directory/nested_directory
+ Removing directory untracked_directory
+ $ cd ..
+ $ ls
+ directory
+ r1
+
+delete only part of the tree
+
+ $ mkdir -p untracked_directory/nested_directory
+ $ touch directory/untracked_file
+ $ cd directory
+ $ hg purge -p ../untracked_directory
+ untracked_directory/nested_directory
+ $ hg purge -v ../untracked_directory
+ Removing directory untracked_directory/nested_directory
+ Removing directory untracked_directory
+ $ cd ..
+ $ ls
+ directory
+ r1
+ $ ls directory/untracked_file
+ directory/untracked_file
+ $ rm directory/untracked_file
+
+skip ignored files if --all not specified
+
+ $ touch ignored
+ $ hg purge -p
+ $ hg purge -v
+ $ ls
+ directory
+ ignored
+ r1
+ $ hg purge -p --all
+ ignored
+ $ hg purge -v --all
+ Removing file ignored
+ $ ls
+ directory
+ r1
+
+abort with missing files until we support name mangling filesystems
+
+ $ touch untracked_file
+ $ rm r1
+
+hide error messages to avoid changing the output when the text changes
+
+ $ hg purge -p 2> /dev/null
+ untracked_file
+ $ hg st
+ ! r1
+ ? untracked_file
+
+ $ hg purge -p
+ untracked_file
+ $ hg purge -v 2> /dev/null
+ Removing file untracked_file
+ $ hg st
+ ! r1
+
+ $ hg purge -v
+ $ hg revert --all --quiet
+ $ hg st -a
+
+tracked file in ignored directory (issue621)
+
+ $ echo directory >> .hgignore
+ $ hg ci -m 'ignore directory'
+ $ touch untracked_file
+ $ hg purge -p
+ untracked_file
+ $ hg purge -v
+ Removing file untracked_file
+
+skip excluded files
+
+ $ touch excluded_file
+ $ hg purge -p -X excluded_file
+ $ hg purge -v -X excluded_file
+ $ ls
+ directory
+ excluded_file
+ r1
+ $ rm excluded_file
+
+skip files in excluded dirs
+
+ $ mkdir excluded_dir
+ $ touch excluded_dir/file
+ $ hg purge -p -X excluded_dir
+ $ hg purge -v -X excluded_dir
+ $ ls
+ directory
+ excluded_dir
+ r1
+ $ ls excluded_dir
+ file
+ $ rm -R excluded_dir
+
+skip excluded empty dirs
+
+ $ mkdir excluded_dir
+ $ hg purge -p -X excluded_dir
+ $ hg purge -v -X excluded_dir
+ $ ls
+ directory
+ excluded_dir
+ r1
+ $ rmdir excluded_dir
+
+skip patterns
+
+ $ mkdir .svn
+ $ touch .svn/foo
+ $ mkdir directory/.svn
+ $ touch directory/.svn/foo
+ $ hg purge -p -X .svn -X '*/.svn'
+ $ hg purge -p -X re:.*.svn
--- a/tests/test-push-warn Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-push-warn Sat Sep 11 00:40:19 2010 +0200
@@ -8,7 +8,7 @@
hg init
echo foo > t1
hg add t1
-hg commit -m "1" -d "1000000 0"
+hg commit -m "1"
cd ..
hg clone a b
@@ -16,18 +16,18 @@
cd a
echo foo > t2
hg add t2
-hg commit -m "2" -d "1000000 0"
+hg commit -m "2"
cd ../b
echo foo > t3
hg add t3
-hg commit -m "3" -d "1000000 0"
+hg commit -m "3"
hg push ../a
hg pull ../a
hg push ../a
hg merge
-hg commit -m "4" -d "1000000 0"
+hg commit -m "4"
hg push ../a
cd ..
@@ -35,7 +35,7 @@
cd c
for i in 0 1 2; do
echo $i >> foo
- hg ci -Am $i -d "1000000 0"
+ hg ci -Am $i
done
cd ..
@@ -44,11 +44,11 @@
for i in 0 1; do
hg co -C $i
echo d-$i >> foo
- hg ci -m d-$i -d "1000000 0"
+ hg ci -m d-$i
done
HGMERGE=true hg merge 3
-hg ci -m c-d -d "1000000 0"
+hg ci -m c-d
hg push ../c; echo $?
hg push -r 2 ../c; echo $?
@@ -70,16 +70,16 @@
cd f
hg -q branch a
echo 0 > foo
-hg -q ci -d "1000000 0" -Am 0
+hg -q ci -Am 0
echo 1 > foo
-hg -q ci -d "1000000 0" -m 1
+hg -q ci -m 1
hg -q up 0
echo 2 > foo
-hg -q ci -d "1000000 0" -m 2
+hg -q ci -m 2
hg -q up 0
hg -q branch b
echo 3 > foo
-hg -q ci -d "1000000 0" -m 3
+hg -q ci -m 3
cd ..
hg -q clone f g
@@ -88,18 +88,18 @@
echo % push on existing branch and new branch
hg -q up 1
echo 4 > foo
-hg -q ci -d "1000000 0" -m 4
+hg -q ci -m 4
hg -q up 0
echo 5 > foo
hg -q branch c
-hg -q ci -d "1000000 0" -m 5
+hg -q ci -m 5
hg push ../f; echo $?
hg push -r 4 -r 5 ../f; echo $?
echo % multiple new branches
hg -q branch d
echo 6 > foo
-hg -q ci -d "1000000 0" -m 6
+hg -q ci -m 6
hg push ../f; echo $?
hg push -r 4 -r 6 ../f; echo $?
cd ../g
@@ -107,41 +107,41 @@
echo % fail on multiple head push
hg -q up 1
echo 7 > foo
-hg -q ci -d "1000000 0" -m 7
+hg -q ci -m 7
hg push -r 4 -r 7 ../f; echo $?
echo % push replacement head on existing branches
hg -q up 3
echo 8 > foo
-hg -q ci -d "1000000 0" -m 8
+hg -q ci -m 8
hg push -r 7 -r 8 ../f; echo $?
echo % merge of branch a to other branch b followed by unrelated push on branch a
hg -q up 7
HGMERGE=true hg -q merge 8
-hg -q ci -d "1000000 0" -m 9
+hg -q ci -m 9
hg -q up 8
echo 10 > foo
-hg -q ci -d "1000000 0" -m 10
+hg -q ci -m 10
hg push -r 9 ../f; echo $?
hg push -r 10 ../f; echo $?
echo % cheating the counting algorithm
hg -q up 9
HGMERGE=true hg -q merge 2
-hg -q ci -d "1000000 0" -m 11
+hg -q ci -m 11
hg -q up 1
echo 12 > foo
-hg -q ci -d "1000000 0" -m 12
+hg -q ci -m 12
hg push -r 11 -r 12 ../f; echo $?
echo % failed push of new named branch
echo 12 > foo
-hg -q ci -d "1000000 0" -m 12a
+hg -q ci -m 12a
hg -q up 11
echo 13 > foo
hg -q branch e
-hg -q ci -d "1000000 0" -m 13d
+hg -q ci -m 13d
hg push -r 12 -r 13 ../f; echo $?
echo % using --new-branch to push new named branch
@@ -187,26 +187,26 @@
echo a >> foo
hg -q add foo
hg -q branch a
-hg -q ci -d '0 0' -ma
+hg -q ci -ma
hg -q up null
echo a >> foo
hg -q add foo
hg -q branch b
-hg -q ci -d '0 0' -mb
+hg -q ci -mb
cd ..
hg -q clone l m -u a
cd m
hg -q merge b
-hg -q ci -d '0 0' -mmb
+hg -q ci -mmb
hg -q up 0
echo a >> foo
hg -q ci -ma2
hg -q up 2
echo a >> foo
hg -q branch -f b
-hg -q ci -d '0 0' -mb2
+hg -q ci -mb2
hg -q merge 3
-hg -q ci -d '0 0' -mma
+hg -q ci -mma
hg push ../l -b b
cd ..
--- a/tests/test-qrecord Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-echo "[ui]" >> $HGRCPATH
-echo "interactive=true" >> $HGRCPATH
-echo "[extensions]" >> $HGRCPATH
-echo "record=" >> $HGRCPATH
-
-echo "% help (no mq, so no qrecord)"
-
-hg help qrecord
-
-echo "mq=" >> $HGRCPATH
-
-echo "% help (mq present)"
-
-hg help qrecord
-
-hg init a
-cd a
-
-echo % base commit
-
-cat > 1.txt <<EOF
-1
-2
-3
-4
-5
-EOF
-cat > 2.txt <<EOF
-a
-b
-c
-d
-e
-f
-EOF
-mkdir dir
-cat > dir/a.txt <<EOF
-hello world
-
-someone
-up
-there
-loves
-me
-EOF
-
-hg add 1.txt 2.txt dir/a.txt
-hg commit -m 'initial checkin'
-
-echo % changing files
-
-sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
-sed -e 's/b/b b/' 2.txt > 2.txt.new
-sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
-
-mv -f 1.txt.new 1.txt
-mv -f 2.txt.new 2.txt
-mv -f dir/a.txt.new dir/a.txt
-
-echo % whole diff
-
-hg diff --nodates
-
-echo % qrecord a.patch
-
-hg qrecord -d '0 0' -m aaa a.patch <<EOF
-y
-y
-n
-y
-y
-n
-EOF
-
-echo
-echo % "after qrecord a.patch 'tip'"
-hg tip -p
-echo
-echo % "after qrecord a.patch 'diff'"
-hg diff --nodates
-
-echo % qrecord b.patch
-hg qrecord -d '0 0' -m bbb b.patch <<EOF
-y
-y
-y
-y
-EOF
-
-echo
-echo % "after qrecord b.patch 'tip'"
-hg tip -p
-echo
-echo % "after qrecord b.patch 'diff'"
-hg diff --nodates
-
-echo
-echo % --- end ---
--- a/tests/test-qrecord.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-% help (no mq, so no qrecord)
-hg: unknown command 'qrecord'
-Mercurial Distributed SCM
-
-basic commands:
-
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-% help (mq present)
-hg qrecord [OPTION]... PATCH [FILE]...
-
-interactively record a new patch
-
- See "hg help qnew" & "hg help record" for more information and usage.
-
-options:
-
- -e --edit edit commit message
- -g --git use git extended diff format
- -U --currentuser add "From: <current user>" to patch
- -u --user USER add "From: <USER>" to patch
- -D --currentdate add "Date: <current date>" to patch
- -d --date DATE add "Date: <DATE>" to patch
- -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
-
-[+] marked option can be specified multiple times
-
-use "hg -v help qrecord" to show global options
-% base commit
-% changing files
-% whole diff
-diff -r 1057167b20ef 1.txt
---- a/1.txt
-+++ b/1.txt
-@@ -1,5 +1,5 @@
- 1
--2
-+2 2
- 3
--4
-+4 4
- 5
-diff -r 1057167b20ef 2.txt
---- a/2.txt
-+++ b/2.txt
-@@ -1,5 +1,5 @@
- a
--b
-+b b
- c
- d
- e
-diff -r 1057167b20ef dir/a.txt
---- a/dir/a.txt
-+++ b/dir/a.txt
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
-
- someone
- up
-% qrecord a.patch
-diff --git a/1.txt b/1.txt
-2 hunks, 2 lines changed
-examine changes to '1.txt'? [Ynsfdaq?]
-@@ -1,3 +1,3 @@
- 1
--2
-+2 2
- 3
-record change 1/6 to '1.txt'? [Ynsfdaq?]
-@@ -3,3 +3,3 @@
- 3
--4
-+4 4
- 5
-record change 2/6 to '1.txt'? [Ynsfdaq?]
-diff --git a/2.txt b/2.txt
-1 hunks, 1 lines changed
-examine changes to '2.txt'? [Ynsfdaq?]
-@@ -1,5 +1,5 @@
- a
--b
-+b b
- c
- d
- e
-record change 4/6 to '2.txt'? [Ynsfdaq?]
-diff --git a/dir/a.txt b/dir/a.txt
-1 hunks, 1 lines changed
-examine changes to 'dir/a.txt'? [Ynsfdaq?]
-
-% after qrecord a.patch 'tip'
-changeset: 1:5d1ca63427ee
-tag: a.patch
-tag: qbase
-tag: qtip
-tag: tip
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: aaa
-
-diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
---- a/1.txt Thu Jan 01 00:00:00 1970 +0000
-+++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
-@@ -1,5 +1,5 @@
- 1
--2
-+2 2
- 3
- 4
- 5
-diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
---- a/2.txt Thu Jan 01 00:00:00 1970 +0000
-+++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
-@@ -1,5 +1,5 @@
- a
--b
-+b b
- c
- d
- e
-
-
-% after qrecord a.patch 'diff'
-diff -r 5d1ca63427ee 1.txt
---- a/1.txt
-+++ b/1.txt
-@@ -1,5 +1,5 @@
- 1
- 2 2
- 3
--4
-+4 4
- 5
-diff -r 5d1ca63427ee dir/a.txt
---- a/dir/a.txt
-+++ b/dir/a.txt
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
-
- someone
- up
-% qrecord b.patch
-diff --git a/1.txt b/1.txt
-1 hunks, 1 lines changed
-examine changes to '1.txt'? [Ynsfdaq?]
-@@ -1,5 +1,5 @@
- 1
- 2 2
- 3
--4
-+4 4
- 5
-record change 1/3 to '1.txt'? [Ynsfdaq?]
-diff --git a/dir/a.txt b/dir/a.txt
-1 hunks, 1 lines changed
-examine changes to 'dir/a.txt'? [Ynsfdaq?]
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
-
- someone
- up
-record change 3/3 to 'dir/a.txt'? [Ynsfdaq?]
-
-% after qrecord b.patch 'tip'
-changeset: 2:b056198bf878
-tag: b.patch
-tag: qtip
-tag: tip
-user: test
-date: Thu Jan 01 00:00:00 1970 +0000
-summary: bbb
-
-diff -r 5d1ca63427ee -r b056198bf878 1.txt
---- a/1.txt Thu Jan 01 00:00:00 1970 +0000
-+++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
-@@ -1,5 +1,5 @@
- 1
- 2 2
- 3
--4
-+4 4
- 5
-diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
---- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
-+++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
-@@ -1,4 +1,4 @@
--hello world
-+hello world!
-
- someone
- up
-
-
-% after qrecord b.patch 'diff'
-
-% --- end ---
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-qrecord.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,305 @@
+Create configuration
+
+ $ echo "[ui]" >> $HGRCPATH
+ $ echo "interactive=true" >> $HGRCPATH
+ $ echo "[extensions]" >> $HGRCPATH
+ $ echo "record=" >> $HGRCPATH
+
+help (no mq, so no qrecord)
+
+ $ hg help qrecord
+ hg: unknown command 'qrecord'
+ Mercurial Distributed SCM
+
+ basic commands:
+
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
+
+ use "hg help" for the full list of commands or "hg -v" for details
+
+help (mq present)
+
+ $ echo "mq=" >> $HGRCPATH
+ $ hg help qrecord
+ hg qrecord [OPTION]... PATCH [FILE]...
+
+ interactively record a new patch
+
+ See "hg help qnew" & "hg help record" for more information and usage.
+
+ options:
+
+ -e --edit edit commit message
+ -g --git use git extended diff format
+ -U --currentuser add "From: <current user>" to patch
+ -u --user USER add "From: <USER>" to patch
+ -D --currentdate add "Date: <current date>" to patch
+ -d --date DATE add "Date: <DATE>" to patch
+ -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
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help qrecord" to show global options
+
+ $ hg init a
+ $ cd a
+
+Base commit
+
+ $ cat > 1.txt <<EOF
+ > 1
+ > 2
+ > 3
+ > 4
+ > 5
+ > EOF
+ $ cat > 2.txt <<EOF
+ > a
+ > b
+ > c
+ > d
+ > e
+ > f
+ > EOF
+
+ $ mkdir dir
+ $ cat > dir/a.txt <<EOF
+ > hello world
+ >
+ > someone
+ > up
+ > there
+ > loves
+ > me
+ > EOF
+
+ $ hg add 1.txt 2.txt dir/a.txt
+ $ hg commit -m 'initial checkin'
+
+Changing files
+
+ $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
+ $ sed -e 's/b/b b/' 2.txt > 2.txt.new
+ $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
+
+ $ mv -f 1.txt.new 1.txt
+ $ mv -f 2.txt.new 2.txt
+ $ mv -f dir/a.txt.new dir/a.txt
+
+Whole diff
+
+ $ hg diff --nodates
+ diff -r 1057167b20ef 1.txt
+ --- a/1.txt
+ +++ b/1.txt
+ @@ -1,5 +1,5 @@
+ 1
+ -2
+ +2 2
+ 3
+ -4
+ +4 4
+ 5
+ diff -r 1057167b20ef 2.txt
+ --- a/2.txt
+ +++ b/2.txt
+ @@ -1,5 +1,5 @@
+ a
+ -b
+ +b b
+ c
+ d
+ e
+ diff -r 1057167b20ef dir/a.txt
+ --- a/dir/a.txt
+ +++ b/dir/a.txt
+ @@ -1,4 +1,4 @@
+ -hello world
+ +hello world!
+
+ someone
+ up
+
+qrecord a.patch
+
+ $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
+ > y
+ > y
+ > n
+ > y
+ > y
+ > n
+ > EOF
+ diff --git a/1.txt b/1.txt
+ 2 hunks, 2 lines changed
+ examine changes to '1.txt'? [Ynsfdaq?]
+ @@ -1,3 +1,3 @@
+ 1
+ -2
+ +2 2
+ 3
+ record change 1/6 to '1.txt'? [Ynsfdaq?]
+ @@ -3,3 +3,3 @@
+ 3
+ -4
+ +4 4
+ 5
+ record change 2/6 to '1.txt'? [Ynsfdaq?]
+ diff --git a/2.txt b/2.txt
+ 1 hunks, 1 lines changed
+ examine changes to '2.txt'? [Ynsfdaq?]
+ @@ -1,5 +1,5 @@
+ a
+ -b
+ +b b
+ c
+ d
+ e
+ record change 4/6 to '2.txt'? [Ynsfdaq?]
+ diff --git a/dir/a.txt b/dir/a.txt
+ 1 hunks, 1 lines changed
+ examine changes to 'dir/a.txt'? [Ynsfdaq?]
+
+After qrecord a.patch 'tip'"
+
+ $ hg tip -p
+ changeset: 1:5d1ca63427ee
+ tag: a.patch
+ tag: qbase
+ tag: qtip
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: aaa
+
+ diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
+ --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,5 +1,5 @@
+ 1
+ -2
+ +2 2
+ 3
+ 4
+ 5
+ diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
+ --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,5 +1,5 @@
+ a
+ -b
+ +b b
+ c
+ d
+ e
+
+
+After qrecord a.patch 'diff'"
+
+ $ hg diff --nodates
+ diff -r 5d1ca63427ee 1.txt
+ --- a/1.txt
+ +++ b/1.txt
+ @@ -1,5 +1,5 @@
+ 1
+ 2 2
+ 3
+ -4
+ +4 4
+ 5
+ diff -r 5d1ca63427ee dir/a.txt
+ --- a/dir/a.txt
+ +++ b/dir/a.txt
+ @@ -1,4 +1,4 @@
+ -hello world
+ +hello world!
+
+ someone
+ up
+
+qrecord b.patch
+
+ $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
+ > y
+ > y
+ > y
+ > y
+ > EOF
+ diff --git a/1.txt b/1.txt
+ 1 hunks, 1 lines changed
+ examine changes to '1.txt'? [Ynsfdaq?]
+ @@ -1,5 +1,5 @@
+ 1
+ 2 2
+ 3
+ -4
+ +4 4
+ 5
+ record change 1/3 to '1.txt'? [Ynsfdaq?]
+ diff --git a/dir/a.txt b/dir/a.txt
+ 1 hunks, 1 lines changed
+ examine changes to 'dir/a.txt'? [Ynsfdaq?]
+ @@ -1,4 +1,4 @@
+ -hello world
+ +hello world!
+
+ someone
+ up
+ record change 3/3 to 'dir/a.txt'? [Ynsfdaq?]
+
+After qrecord b.patch 'tip'
+
+ $ hg tip -p
+ changeset: 2:b056198bf878
+ tag: b.patch
+ tag: qtip
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: bbb
+
+ diff -r 5d1ca63427ee -r b056198bf878 1.txt
+ --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,5 +1,5 @@
+ 1
+ 2 2
+ 3
+ -4
+ +4 4
+ 5
+ diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
+ --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
+ +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,4 +1,4 @@
+ -hello world
+ +hello world!
+
+ someone
+ up
+
+
+After qrecord b.patch 'diff'
+
+ $ hg diff --nodates
+
+End
\ No newline at end of file
--- a/tests/test-rebuildstate Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-# basic test for hg debugrebuildstate
-
-hg init repo
-cd repo
-
-touch foo bar
-hg ci -Am 'add foo bar'
-
-touch baz
-hg add baz
-hg rm bar
-
-hg debugrebuildstate
-echo '% state dump after'
-hg debugstate --nodates | sort
-echo '% status'
-hg st -A
-
--- a/tests/test-rebuildstate.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-adding bar
-adding foo
-% state dump after
-n 666 -1 bar
-n 666 -1 foo
-% status
-! bar
-? baz
-C foo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rebuildstate.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,29 @@
+basic test for hg debugrebuildstate
+
+ $ hg init repo
+ $ cd repo
+
+ $ touch foo bar
+ $ hg ci -Am 'add foo bar'
+ adding bar
+ adding foo
+
+ $ touch baz
+ $ hg add baz
+ $ hg rm bar
+
+ $ hg debugrebuildstate
+
+state dump after
+
+ $ hg debugstate --nodates | sort
+ n 666 -1 bar
+ n 666 -1 foo
+
+status
+
+ $ hg st -A
+ ! bar
+ ? baz
+ C foo
+
--- a/tests/test-record Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,332 +0,0 @@
-#!/bin/sh
-
-echo "[ui]" >> $HGRCPATH
-echo "interactive=true" >> $HGRCPATH
-echo "[extensions]" >> $HGRCPATH
-echo "record=" >> $HGRCPATH
-
-echo % help
-
-hg help record
-
-hg init a
-cd a
-
-echo % select no files
-
-touch empty-rw
-hg add empty-rw
-hg record empty-rw<<EOF
-n
-EOF
-echo; hg tip -p
-
-echo % select files but no hunks
-
-hg record empty-rw<<EOF
-y
-n
-EOF
-echo; hg tip -p
-
-echo % record empty file
-
-hg record -d '0 0' -m empty empty-rw<<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo % summary shows we updated to the new cset
-hg summary
-echo
-
-echo % rename empty file
-
-hg mv empty-rw empty-rename
-hg record -d '1 0' -m rename<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % copy empty file
-
-hg cp empty-rename empty-copy
-hg record -d '2 0' -m copy<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % delete empty file
-
-hg rm empty-copy
-hg record -d '3 0' -m delete<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % add binary file
-
-hg bundle --base -2 tip.bundle
-hg add tip.bundle
-hg record -d '4 0' -m binary<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % change binary file
-
-hg bundle --base -2 tip.bundle
-hg record -d '5 0' -m binary-change<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % rename and change binary file
-
-hg mv tip.bundle top.bundle
-hg bundle --base -2 top.bundle
-hg record -d '6 0' -m binary-change-rename<<EOF
-y
-EOF
-echo; hg tip -p
-
-echo % 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<<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo % modify end of plain file
-
-echo 11 >> plain
-hg record -d '8 0' -m end plain <<EOF
-y
-y
-EOF
-
-echo % modify end of plain file, no EOL
-
-hg tip --template '{node}' >> plain
-hg record -d '9 0' -m noeol plain <<EOF
-y
-y
-EOF
-
-echo % modify end of plain file, add EOL
-
-echo >> plain
-hg record -d '10 0' -m eol plain <<EOF
-y
-y
-y
-EOF
-
-echo % modify beginning, trim end, record both
-
-rm plain
-for i in 2 2 3 4 5 6 7 8 9 10; do
- echo $i >> plain
-done
-
-hg record -d '10 0' -m begin-and-end plain <<EOF
-y
-y
-y
-EOF
-echo; hg tip -p
-
-echo % trim beginning, modify end
-
-rm plain
-for i in 4 5 6 7 8 9 10.new; do
- echo $i >> plain
-done
-
-echo % record end
-
-hg record -d '11 0' -m end-only plain <<EOF
-y
-n
-y
-EOF
-echo; hg tip -p
-
-echo % record beginning
-
-hg record -d '12 0' -m begin-only plain <<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo % 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
-
-echo % record end
-
-hg record --traceback -d '13 0' -m end-again plain<<EOF
-y
-n
-y
-EOF
-
-echo % 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
-
-echo % record beginning, middle
-
-hg record -d '14 0' -m middle-only plain <<EOF
-y
-y
-y
-n
-EOF
-echo; hg tip -p
-
-echo % record end
-
-hg record -d '15 0' -m end-only plain <<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-mkdir subdir
-cd subdir
-echo a > a
-hg ci -d '16 0' -Amsubdir
-
-echo a >> a
-hg record -d '16 0' -m subdir-change a <<EOF
-y
-y
-EOF
-echo; hg tip -p
-
-echo a > f1
-echo b > f2
-hg add f1 f2
-
-hg ci -mz -d '17 0'
-
-echo a >> f1
-echo b >> f2
-
-echo % help, quit
-
-hg record <<EOF
-?
-q
-EOF
-
-echo % skip
-
-hg record <<EOF
-s
-EOF
-
-echo % no
-
-hg record <<EOF
-n
-EOF
-
-echo % f, quit
-
-hg record <<EOF
-f
-q
-EOF
-
-echo % s, all
-
-hg record -d '18 0' -mx <<EOF
-s
-a
-EOF
-echo; hg tip -p
-
-echo % f
-
-hg record -d '19 0' -my <<EOF
-f
-EOF
-echo; hg tip -p
-
-echo % preserve chmod +x
-
-chmod +x f1
-echo a >> f1
-hg record -d '20 0' -mz <<EOF
-y
-y
-y
-EOF
-echo; hg tip --config diff.git=True -p
-
-echo % preserve execute permission on original
-
-echo b >> f1
-hg record -d '21 0' -maa <<EOF
-y
-y
-y
-EOF
-echo; hg tip --config diff.git=True -p
-
-echo % preserve chmod -x
-
-chmod -x f1
-echo c >> f1
-hg record -d '22 0' -mab <<EOF
-y
-y
-y
-EOF
-echo; hg tip --config diff.git=True -p
-
-cd ..
-
-echo % abort early when a merge is in progress
-hg up 4
-touch iwillmergethat
-hg add iwillmergethat
-hg branch thatbranch
-hg ci -m'new head'
-hg up default
-hg merge thatbranch
-echo; hg record -m'will abort'
-hg up -C
-
-echo % with win32ext
-echo '[extensions]' >> .hg/hgrc
-echo 'win32text = ' >> .hg/hgrc
-echo '[decode]' >> .hg/hgrc
-echo '** = cleverdecode:' >> .hg/hgrc
-echo '[encode]' >> .hg/hgrc
-echo '** = cleverencode:' >> .hg/hgrc
-echo '[patch]' >> .hg/hgrc
-echo 'eol = crlf' >> .hg/hgrc
-
-echo d >> subdir/f1
-hg record -d '23 0' -mw1 <<EOF
-y
-y
-EOF
-echo; hg tip -p
--- a/tests/test-record.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,670 +0,0 @@
-% help
-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
-
- 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:
-
- -A --addremove mark new/missing files as added/removed before
- committing
- --close-branch mark a branch as closed, hiding it from the branch
- list
- -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 datecode as commit date
- -u --user USER record the specified user as committer
-
-[+] marked option can be specified multiple times
-
-use "hg -v help record" to show global options
-% select no files
-diff --git a/empty-rw b/empty-rw
-new file mode 100644
-examine changes to 'empty-rw'? [Ynsfdaq?]
-no changes to record
-
-changeset: -1:000000000000
-tag: tip
-user:
-date: Thu Jan 01 00:00:00 1970 +0000
-
-
-% select files but no hunks
-diff --git a/empty-rw b/empty-rw
-new file mode 100644
-examine changes to 'empty-rw'? [Ynsfdaq?]
-abort: empty commit message
-
-changeset: -1:000000000000
-tag: tip
-user:
-date: Thu Jan 01 00:00:00 1970 +0000
-
-
-% record empty file
-diff --git a/empty-rw b/empty-rw
-new file mode 100644
-examine changes to 'empty-rw'? [Ynsfdaq?]
-
-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
-parent: 0:c0708cf4e46e tip
- empty
-branch: default
-commit: (clean)
-update: (current)
-
-% rename empty file
-diff --git a/empty-rw b/empty-rename
-rename from empty-rw
-rename to empty-rename
-examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?]
-
-changeset: 1:d695e8dcb197
-tag: tip
-user: test
-date: Thu Jan 01 00:00:01 1970 +0000
-summary: rename
-
-
-% copy empty file
-diff --git a/empty-rename b/empty-copy
-copy from empty-rename
-copy to empty-copy
-examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?]
-
-changeset: 2:1d4b90bea524
-tag: tip
-user: test
-date: Thu Jan 01 00:00:02 1970 +0000
-summary: copy
-
-
-% delete empty file
-diff --git a/empty-copy b/empty-copy
-deleted file mode 100644
-examine changes to 'empty-copy'? [Ynsfdaq?]
-
-changeset: 3:b39a238f01a1
-tag: tip
-user: test
-date: Thu Jan 01 00:00:03 1970 +0000
-summary: delete
-
-
-% add binary file
-1 changesets found
-diff --git a/tip.bundle b/tip.bundle
-new file mode 100644
-this is a binary file
-examine changes to 'tip.bundle'? [Ynsfdaq?]
-
-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
-1 changesets found
-diff --git a/tip.bundle b/tip.bundle
-this modifies a binary file (all or nothing)
-examine changes to 'tip.bundle'? [Ynsfdaq?]
-
-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
-1 changesets found
-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'? [Ynsfdaq?]
-
-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
-diff --git a/plain b/plain
-new file mode 100644
-examine changes to 'plain'? [Ynsfdaq?]
-
-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
-diff --git a/plain b/plain
-1 hunks, 1 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -8,3 +8,4 @@
- 8
- 9
- 10
-+11
-record this change to 'plain'? [Ynsfdaq?]
-% modify end of plain file, no EOL
-diff --git a/plain b/plain
-1 hunks, 1 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -9,3 +9,4 @@
- 9
- 10
- 11
-+7264f99c5f5ff3261504828afa4fb4d406c3af54
-\ No newline at end of file
-record this change to 'plain'? [Ynsfdaq?]
-% modify end of plain file, add EOL
-diff --git a/plain b/plain
-1 hunks, 1 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -9,4 +9,4 @@
- 9
- 10
- 11
--7264f99c5f5ff3261504828afa4fb4d406c3af54
-\ No newline at end of file
-+7264f99c5f5ff3261504828afa4fb4d406c3af54
-record this change to 'plain'? [Ynsfdaq?]
-% modify beginning, trim end, record both
-diff --git a/plain b/plain
-2 hunks, 3 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -1,4 +1,4 @@
--1
-+2
- 2
- 3
- 4
-record change 1/2 to 'plain'? [Ynsfdaq?]
-@@ -8,5 +8,3 @@
- 8
- 9
- 10
--11
--7264f99c5f5ff3261504828afa4fb4d406c3af54
-record change 2/2 to 'plain'? [Ynsfdaq?]
-
-changeset: 11:efca65c9b09e
-tag: tip
-user: test
-date: Thu Jan 01 00:00:10 1970 +0000
-summary: begin-and-end
-
-diff -r cd07d48e8cbe -r efca65c9b09e 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
-
-% trim beginning, modify end
-% record end
-diff --git a/plain b/plain
-2 hunks, 4 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -1,9 +1,6 @@
--2
--2
--3
- 4
- 5
- 6
- 7
- 8
- 9
-record change 1/2 to 'plain'? [Ynsfdaq?]
-@@ -4,7 +1,7 @@
- 4
- 5
- 6
- 7
- 8
- 9
--10
-+10.new
-record change 2/2 to 'plain'? [Ynsfdaq?]
-
-changeset: 12:7d1e66983c15
-tag: tip
-user: test
-date: Thu Jan 01 00:00:11 1970 +0000
-summary: end-only
-
-diff -r efca65c9b09e -r 7d1e66983c15 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
-diff --git a/plain b/plain
-1 hunks, 3 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -1,6 +1,3 @@
--2
--2
--3
- 4
- 5
- 6
-record this change to 'plain'? [Ynsfdaq?]
-
-changeset: 13:a09fc62a0e61
-tag: tip
-user: test
-date: Thu Jan 01 00:00:12 1970 +0000
-summary: begin-only
-
-diff -r 7d1e66983c15 -r a09fc62a0e61 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
-% record end
-diff --git a/plain b/plain
-2 hunks, 4 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -1,6 +1,9 @@
-+1
-+2
-+3
- 4
- 5
- 6
- 7
- 8
- 9
-record change 1/2 to 'plain'? [Ynsfdaq?]
-@@ -1,7 +4,6 @@
- 4
- 5
- 6
- 7
- 8
- 9
--10.new
-record change 2/2 to 'plain'? [Ynsfdaq?]
-% add to beginning, middle, end
-% record beginning, middle
-diff --git a/plain b/plain
-3 hunks, 7 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -1,2 +1,5 @@
-+1
-+2
-+3
- 4
- 5
-record change 1/3 to 'plain'? [Ynsfdaq?]
-@@ -1,6 +4,8 @@
- 4
- 5
-+5.new
-+5.reallynew
- 6
- 7
- 8
- 9
-record change 2/3 to 'plain'? [Ynsfdaq?]
-@@ -3,4 +8,6 @@
- 6
- 7
- 8
- 9
-+10
-+11
-record change 3/3 to 'plain'? [Ynsfdaq?]
-
-changeset: 15:7d137997f3a6
-tag: tip
-user: test
-date: Thu Jan 01 00:00:14 1970 +0000
-summary: middle-only
-
-diff -r c0b8e5fb0be6 -r 7d137997f3a6 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
-diff --git a/plain b/plain
-1 hunks, 2 lines changed
-examine changes to 'plain'? [Ynsfdaq?]
-@@ -9,3 +9,5 @@
- 7
- 8
- 9
-+10
-+11
-record this change to 'plain'? [Ynsfdaq?]
-
-changeset: 16:4959e3ff13eb
-tag: tip
-user: test
-date: Thu Jan 01 00:00:15 1970 +0000
-summary: end-only
-
-diff -r 7d137997f3a6 -r 4959e3ff13eb 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
-
-adding subdir/a
-diff --git a/subdir/a b/subdir/a
-1 hunks, 1 lines changed
-examine changes to 'subdir/a'? [Ynsfdaq?]
-@@ -1,1 +1,2 @@
- a
-+a
-record this change to 'subdir/a'? [Ynsfdaq?]
-
-changeset: 18:40698cd490b2
-tag: tip
-user: test
-date: Thu Jan 01 00:00:16 1970 +0000
-summary: subdir-change
-
-diff -r 661eacdc08b9 -r 40698cd490b2 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
-
-% help, quit
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-y - record this change
-n - skip this change
-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'? [Ynsfdaq?]
-abort: user quit
-% skip
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
-% no
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
-% f, quit
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?]
-abort: user quit
-% s, all
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-diff --git a/subdir/f2 b/subdir/f2
-1 hunks, 1 lines changed
-examine changes to 'subdir/f2'? [Ynsfdaq?]
-
-changeset: 20:d2d8c25276a8
-tag: tip
-user: test
-date: Thu Jan 01 00:00:18 1970 +0000
-summary: x
-
-diff -r 25eb2a7694fb -r d2d8c25276a8 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
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-
-changeset: 21:1013f51ce32f
-tag: tip
-user: test
-date: Thu Jan 01 00:00:19 1970 +0000
-summary: y
-
-diff -r d2d8c25276a8 -r 1013f51ce32f 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
-
-% preserve chmod +x
-diff --git a/subdir/f1 b/subdir/f1
-old mode 100644
-new mode 100755
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-@@ -1,2 +1,3 @@
- a
- a
-+a
-record this change to 'subdir/f1'? [Ynsfdaq?]
-
-changeset: 22:5df857735621
-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
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-@@ -1,3 +1,4 @@
- a
- a
- a
-+b
-record this change to 'subdir/f1'? [Ynsfdaq?]
-
-changeset: 23:a4ae36a78715
-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
-diff --git a/subdir/f1 b/subdir/f1
-old mode 100755
-new mode 100644
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-@@ -2,3 +2,4 @@
- a
- a
- b
-+c
-record this change to 'subdir/f1'? [Ynsfdaq?]
-
-changeset: 24:1460f6e47966
-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
-
-% abort early when a merge is in progress
-1 files updated, 0 files merged, 5 files removed, 0 files unresolved
-marked working directory as branch thatbranch
-5 files updated, 0 files merged, 2 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-
-abort: cannot partially commit a merge (use hg commit instead)
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-% with win32ext
-diff --git a/subdir/f1 b/subdir/f1
-1 hunks, 1 lines changed
-examine changes to 'subdir/f1'? [Ynsfdaq?]
-@@ -3,3 +3,4 @@
- a
- b
- c
-+d
-record this change to 'subdir/f1'? [Ynsfdaq?]
-
-changeset: 26:5bacc1f6e9cf
-tag: tip
-parent: 24:1460f6e47966
-user: test
-date: Thu Jan 01 00:00:23 1970 +0000
-summary: w1
-
-diff -r 1460f6e47966 -r 5bacc1f6e9cf subdir/f1
---- a/subdir/f1 Thu Jan 01 00:00:22 1970 +0000
-+++ b/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
-@@ -3,3 +3,4 @@
- a
- b
- c
-+d
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-record.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,975 @@
+#!/bin/sh
+
+ $ echo "[ui]" >> $HGRCPATH
+ $ echo "interactive=true" >> $HGRCPATH
+ $ echo "[extensions]" >> $HGRCPATH
+ $ echo "record=" >> $HGRCPATH
+
+Help
+
+ $ hg help record
+ 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
+
+ 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:
+
+ -A --addremove mark new/missing files as added/removed before
+ committing
+ --close-branch mark a branch as closed, hiding it from the branch
+ list
+ -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 datecode as commit date
+ -u --user USER record the specified user as committer
+
+ [+] marked option can be specified multiple times
+
+ use "hg -v help record" to show global options
+
+ $ hg init a
+ $ cd a
+
+Select no files
+
+ $ touch empty-rw
+ $ hg add empty-rw
+
+ $ hg record empty-rw<<EOF
+ > n
+ > EOF
+ diff --git a/empty-rw b/empty-rw
+ new file mode 100644
+ examine changes to 'empty-rw'? [Ynsfdaq?]
+ no changes to record
+
+ $ hg tip -p
+ changeset: -1:000000000000
+ tag: tip
+ user:
+ date: Thu Jan 01 00:00:00 1970 +0000
+
+
+
+Select files but no hunks
+
+ $ hg record empty-rw<<EOF
+ > y
+ > n
+ > EOF
+ diff --git a/empty-rw b/empty-rw
+ new file mode 100644
+ examine changes to 'empty-rw'? [Ynsfdaq?]
+ abort: empty commit message
+
+ $ 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<<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/empty-rw b/empty-rw
+ new file mode 100644
+ examine changes to 'empty-rw'? [Ynsfdaq?]
+
+ $ 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<<EOF
+ > 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'? [Ynsfdaq?]
+
+ $ 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<<EOF
+ > 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'? [Ynsfdaq?]
+
+ $ 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<<EOF
+ > y
+ > EOF
+ diff --git a/empty-copy b/empty-copy
+ deleted file mode 100644
+ examine changes to 'empty-copy'? [Ynsfdaq?]
+
+ $ 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<<EOF
+ > y
+ > EOF
+ diff --git a/tip.bundle b/tip.bundle
+ new file mode 100644
+ this is a binary file
+ examine changes to 'tip.bundle'? [Ynsfdaq?]
+
+ $ 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<<EOF
+ > y
+ > EOF
+ diff --git a/tip.bundle b/tip.bundle
+ this modifies a binary file (all or nothing)
+ examine changes to 'tip.bundle'? [Ynsfdaq?]
+
+ $ 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<<EOF
+ > 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'? [Ynsfdaq?]
+
+ $ 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<<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ new file mode 100644
+ examine changes to 'plain'? [Ynsfdaq?]
+
+ $ 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
+
+ $ echo 11 >> plain
+ $ hg record -d '8 0' -m end plain <<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 1 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -8,3 +8,4 @@
+ 8
+ 9
+ 10
+ +11
+ record this change to 'plain'? [Ynsfdaq?]
+
+Modify end of plain file, no EOL
+
+ $ hg tip --template '{node}' >> plain
+ $ hg record -d '9 0' -m noeol plain <<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 1 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -9,3 +9,4 @@
+ 9
+ 10
+ 11
+ +7264f99c5f5ff3261504828afa4fb4d406c3af54
+ \ No newline at end of file
+ record this change to 'plain'? [Ynsfdaq?]
+
+Modify end of plain file, add EOL
+
+ $ echo >> plain
+ $ hg record -d '10 0' -m eol plain <<EOF
+ > y
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 1 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -9,4 +9,4 @@
+ 9
+ 10
+ 11
+ -7264f99c5f5ff3261504828afa4fb4d406c3af54
+ \ No newline at end of file
+ +7264f99c5f5ff3261504828afa4fb4d406c3af54
+ record this change to 'plain'? [Ynsfdaq?]
+
+Modify beginning, trim end, record both
+
+ $ rm plain
+ $ for i in 2 2 3 4 5 6 7 8 9 10; do
+ > echo $i >> plain
+ > done
+
+ $ hg record -d '10 0' -m begin-and-end plain <<EOF
+ > y
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 2 hunks, 3 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -1,4 +1,4 @@
+ -1
+ +2
+ 2
+ 3
+ 4
+ record change 1/2 to 'plain'? [Ynsfdaq?]
+ @@ -8,5 +8,3 @@
+ 8
+ 9
+ 10
+ -11
+ -7264f99c5f5ff3261504828afa4fb4d406c3af54
+ record change 2/2 to 'plain'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 11:efca65c9b09e
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:10 1970 +0000
+ summary: begin-and-end
+
+ diff -r cd07d48e8cbe -r efca65c9b09e 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
+
+
+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 <<EOF
+ > y
+ > n
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 2 hunks, 4 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -1,9 +1,6 @@
+ -2
+ -2
+ -3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ record change 1/2 to 'plain'? [Ynsfdaq?]
+ @@ -4,7 +1,7 @@
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ -10
+ +10.new
+ record change 2/2 to 'plain'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 12:7d1e66983c15
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:11 1970 +0000
+ summary: end-only
+
+ diff -r efca65c9b09e -r 7d1e66983c15 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 <<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 3 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -1,6 +1,3 @@
+ -2
+ -2
+ -3
+ 4
+ 5
+ 6
+ record this change to 'plain'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 13:a09fc62a0e61
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:12 1970 +0000
+ summary: begin-only
+
+ diff -r 7d1e66983c15 -r a09fc62a0e61 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<<EOF
+ > y
+ > n
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 2 hunks, 4 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -1,6 +1,9 @@
+ +1
+ +2
+ +3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ record change 1/2 to 'plain'? [Ynsfdaq?]
+ @@ -1,7 +4,6 @@
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ -10.new
+ record change 2/2 to 'plain'? [Ynsfdaq?]
+
+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
+
+ $ hg record -d '14 0' -m middle-only plain <<EOF
+ > y
+ > y
+ > y
+ > n
+ > EOF
+ diff --git a/plain b/plain
+ 3 hunks, 7 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -1,2 +1,5 @@
+ +1
+ +2
+ +3
+ 4
+ 5
+ record change 1/3 to 'plain'? [Ynsfdaq?]
+ @@ -1,6 +4,8 @@
+ 4
+ 5
+ +5.new
+ +5.reallynew
+ 6
+ 7
+ 8
+ 9
+ record change 2/3 to 'plain'? [Ynsfdaq?]
+ @@ -3,4 +8,6 @@
+ 6
+ 7
+ 8
+ 9
+ +10
+ +11
+ record change 3/3 to 'plain'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 15:7d137997f3a6
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:14 1970 +0000
+ summary: middle-only
+
+ diff -r c0b8e5fb0be6 -r 7d137997f3a6 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 <<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/plain b/plain
+ 1 hunks, 2 lines changed
+ examine changes to 'plain'? [Ynsfdaq?]
+ @@ -9,3 +9,5 @@
+ 7
+ 8
+ 9
+ +10
+ +11
+ record this change to 'plain'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 16:4959e3ff13eb
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:15 1970 +0000
+ summary: end-only
+
+ diff -r 7d137997f3a6 -r 4959e3ff13eb 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 <<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/a b/subdir/a
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/a'? [Ynsfdaq?]
+ @@ -1,1 +1,2 @@
+ a
+ +a
+ record this change to 'subdir/a'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 18:40698cd490b2
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:16 1970 +0000
+ summary: subdir-change
+
+ diff -r 661eacdc08b9 -r 40698cd490b2 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 <<EOF
+ > ?
+ > q
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+ y - record this change
+ n - skip this change
+ 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'? [Ynsfdaq?]
+ abort: user quit
+
+Skip
+
+ $ hg record <<EOF
+ > s
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
+
+No
+
+ $ hg record <<EOF
+ > n
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
+
+f, quit
+
+ $ hg record <<EOF
+ > f
+ > q
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynsfdaq?]
+ abort: user quit
+
+s, all
+
+ $ hg record -d '18 0' -mx <<EOF
+ > s
+ > a
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+ diff --git a/subdir/f2 b/subdir/f2
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f2'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 20:d2d8c25276a8
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:18 1970 +0000
+ summary: x
+
+ diff -r 25eb2a7694fb -r d2d8c25276a8 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 <<EOF
+ > f
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 21:1013f51ce32f
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:19 1970 +0000
+ summary: y
+
+ diff -r d2d8c25276a8 -r 1013f51ce32f 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
+
+
+Preserve chmod +x
+
+ $ chmod +x f1
+ $ echo a >> f1
+ $ hg record -d '20 0' -mz <<EOF
+ > 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'? [Ynsfdaq?]
+ @@ -1,2 +1,3 @@
+ a
+ a
+ +a
+ record this change to 'subdir/f1'? [Ynsfdaq?]
+
+ $ hg tip --config diff.git=True -p
+ changeset: 22:5df857735621
+ 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 <<EOF
+ > y
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+ @@ -1,3 +1,4 @@
+ a
+ a
+ a
+ +b
+ record this change to 'subdir/f1'? [Ynsfdaq?]
+
+ $ hg tip --config diff.git=True -p
+ changeset: 23:a4ae36a78715
+ 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 <<EOF
+ > 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'? [Ynsfdaq?]
+ @@ -2,3 +2,4 @@
+ a
+ a
+ b
+ +c
+ record this change to 'subdir/f1'? [Ynsfdaq?]
+
+ $ hg tip --config diff.git=True -p
+ changeset: 24:1460f6e47966
+ 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
+
+
+ $ cd ..
+
+Abort early when a merge is in progress
+
+ $ hg up 4
+ 1 files updated, 0 files merged, 5 files removed, 0 files unresolved
+
+ $ touch iwillmergethat
+ $ hg add iwillmergethat
+
+ $ hg branch thatbranch
+ marked working directory as branch thatbranch
+
+ $ hg ci -m'new head'
+
+ $ hg up default
+ 5 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)
+
+ $ hg up -C
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+With win32text
+
+ $ echo '[extensions]' >> .hg/hgrc
+ $ echo 'win32text = ' >> .hg/hgrc
+ $ echo '[decode]' >> .hg/hgrc
+ $ echo '** = cleverdecode:' >> .hg/hgrc
+ $ echo '[encode]' >> .hg/hgrc
+ $ echo '** = cleverencode:' >> .hg/hgrc
+ $ echo '[patch]' >> .hg/hgrc
+ $ echo 'eol = crlf' >> .hg/hgrc
+
+ $ echo d >> subdir/f1
+ $ hg record -d '23 0' -mw1 <<EOF
+ > y
+ > y
+ > EOF
+ diff --git a/subdir/f1 b/subdir/f1
+ 1 hunks, 1 lines changed
+ examine changes to 'subdir/f1'? [Ynsfdaq?]
+ @@ -3,3 +3,4 @@
+ a
+ b
+ c
+ +d
+ record this change to 'subdir/f1'? [Ynsfdaq?]
+
+ $ hg tip -p
+ changeset: 26:5bacc1f6e9cf
+ tag: tip
+ parent: 24:1460f6e47966
+ user: test
+ date: Thu Jan 01 00:00:23 1970 +0000
+ summary: w1
+
+ diff -r 1460f6e47966 -r 5bacc1f6e9cf subdir/f1
+ --- a/subdir/f1 Thu Jan 01 00:00:22 1970 +0000
+ +++ b/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
+ @@ -3,3 +3,4 @@
+ a
+ b
+ c
+ +d
+
--- a/tests/test-relink Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "relink=" >> $HGRCPATH
-
-fix_path()
-{
- tr '\\' /
-}
-
-cat > arelinked.py <<EOF
-import sys, os
-from mercurial import util
-path1, path2 = sys.argv[1:3]
-if util.samefile(path1, path2):
- print '%s == %s' % (path1, path2)
-else:
- print '%s != %s' % (path1, path2)
-EOF
-
-echo '% create source repository'
-hg init repo
-cd repo
-echo '[ui]' > .hg/hgrc
-echo 'username= A. Foo <a.foo@bar.com>' >> .hg/hgrc
-echo a > a
-echo b > b
-hg ci -Am addfile
-echo a >> a
-echo a >> b
-hg ci -Am changefiles
-# Test files are read in binary mode
-python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
-cd ..
-
-echo '% clone and pull to break links'
-hg clone --pull -r0 repo clone
-cd clone
-echo '[ui]' >> .hg/hgrc
-echo 'username= A. Baz <a.baz@bar.com>' >> .hg/hgrc
-hg pull -q
-echo b >> b
-hg ci -m changeb
-python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
-
-echo '% relink'
-hg relink --debug | sed 's:relinking.*store:relinking .hg/store:g' \
- | fix_path
-cd ..
-
-echo '% check hardlinks'
-python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
-python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
-
--- a/tests/test-relink.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-% create source repository
-adding a
-adding b
-% clone and pull to break links
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% relink
-relinking .hg/store
-tip has 2 files, estimated total number of files: 3
-collecting: 00changelog.i 1/3 files (33.33%)
-collecting: 00manifest.i 2/3 files (66.67%)
-collecting: a.i 3/3 files (100.00%)
-collecting: b.i 4/3 files (133.33%)
-collecting: dummy.i 5/3 files (166.67%)
-collected 5 candidate storage files
-not linkable: 00changelog.i
-not linkable: 00manifest.i
-pruning: data/a.i 3/5 files (60.00%)
-not linkable: data/b.i
-pruning: data/dummy.i 5/5 files (100.00%)
-pruned down to 2 probably relinkable files
-relinking: data/a.i 1/2 files (50.00%)
-not linkable: data/dummy.i
-relinked 1 files (136 bytes reclaimed)
-% check hardlinks
-repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
-repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-relink.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,89 @@
+ $ echo "[extensions]" >> $HGRCPATH
+ $ echo "relink=" >> $HGRCPATH
+
+ $ fix_path() {
+ > tr '\\' /
+ > }
+
+ $ cat > arelinked.py <<EOF
+ > import sys, os
+ > from mercurial import util
+ > path1, path2 = sys.argv[1:3]
+ > if util.samefile(path1, path2):
+ > print '%s == %s' % (path1, path2)
+ > else:
+ > print '%s != %s' % (path1, path2)
+ > EOF
+
+
+create source repository
+
+ $ hg init repo
+ $ cd repo
+ $ echo '[ui]' > .hg/hgrc
+ $ echo 'username= A. Foo <a.foo@bar.com>' >> .hg/hgrc
+ $ echo a > a
+ $ echo b > b
+ $ hg ci -Am addfile
+ adding a
+ adding b
+ $ echo a >> a
+ $ echo a >> b
+ $ hg ci -Am changefiles
+
+Test files are read in binary mode
+
+ $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
+ $ cd ..
+
+
+clone and pull to break links
+
+ $ hg clone --pull -r0 repo clone
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 2 changes to 2 files
+ updating to branch default
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cd clone
+ $ echo '[ui]' >> .hg/hgrc
+ $ echo 'username= A. Baz <a.baz@bar.com>' >> .hg/hgrc
+ $ hg pull -q
+ $ echo b >> b
+ $ hg ci -m changeb
+ created new head
+ $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
+
+
+relink
+
+ $ hg relink --debug | fix_path
+ relinking .*/.hg/store
+ tip has 2 files, estimated total number of files: 3
+ collecting: 00changelog.i 1/3 files (33.33%)
+ collecting: 00manifest.i 2/3 files (66.67%)
+ collecting: a.i 3/3 files (100.00%)
+ collecting: b.i 4/3 files (133.33%)
+ collecting: dummy.i 5/3 files (166.67%)
+ collected 5 candidate storage files
+ not linkable: 00changelog.i
+ not linkable: 00manifest.i
+ pruning: data/a.i 3/5 files (60.00%)
+ not linkable: data/b.i
+ pruning: data/dummy.i 5/5 files (100.00%)
+ pruned down to 2 probably relinkable files
+ relinking: data/a.i 1/2 files (50.00%)
+ not linkable: data/dummy.i
+ relinked 1 files (136 bytes reclaimed)
+ $ cd ..
+
+
+check hardlinks
+
+ $ python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
+ repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
+ $ python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
+ repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
+
--- a/tests/test-remove Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-#!/bin/sh
-
-remove() {
- hg rm $@
- hg st
- # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
- find . -name .hg -prune -o -type f -print | sort
- hg up -C
-}
-
-hg init a
-cd a
-echo a > foo
-
-echo % file not managed
-remove foo
-
-hg add foo
-hg commit -m1
-
-# the table cases
-
-echo % 00 state added, options none
-echo b > bar
-hg add bar
-remove bar
-
-echo % 01 state clean, options none
-remove foo
-
-echo % 02 state modified, options none
-echo b >> foo
-remove foo
-
-echo % 03 state missing, options none
-rm foo
-remove foo
-
-echo % 10 state added, options -f
-echo b > bar
-hg add bar
-remove -f bar
-rm bar
-
-echo % 11 state clean, options -f
-remove -f foo
-
-echo % 12 state modified, options -f
-echo b >> foo
-remove -f foo
-
-echo % 13 state missing, options -f
-rm foo
-remove -f foo
-
-echo % 20 state added, options -A
-echo b > bar
-hg add bar
-remove -A bar
-
-echo % 21 state clean, options -A
-remove -A foo
-
-echo % 22 state modified, options -A
-echo b >> foo
-remove -A foo
-
-echo % 23 state missing, options -A
-rm foo
-remove -A foo
-
-echo % 30 state added, options -Af
-echo b > bar
-hg add bar
-remove -Af bar
-rm bar
-
-echo % 31 state clean, options -Af
-remove -Af foo
-
-echo % 32 state modified, options -Af
-echo b >> foo
-remove -Af foo
-
-echo % 33 state missing, options -Af
-rm foo
-remove -Af foo
-
-# test some directory stuff
-
-mkdir test
-echo a > test/foo
-echo b > test/bar
-hg ci -Am2
-
-echo % dir, options none
-rm test/bar
-remove test
-
-echo % dir, options -f
-rm test/bar
-remove -f test
-
-echo % dir, options -A
-rm test/bar
-remove -A test
-
-echo % dir, options -Af
-rm test/bar
-remove -Af test
-
-echo 'test remove dropping empty trees (issue1861)'
-mkdir -p issue1861/b/c
-echo x > issue1861/x
-echo y > issue1861/b/c/y
-hg ci -Am add
-hg rm issue1861/b
-hg ci -m remove
-ls issue1861
--- a/tests/test-remove-new Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-# test that 'hg commit' does not crash if the user removes a
-# newly added file
-
-hg init
-echo This is file a1 > a
-hg add a
-hg commit -m "commit #0" -d "1000000 0"
-touch b
-hg add b
-rm b
-hg commit -A -m"comment #1" -d "1000000 0"
-exit 0
--- a/tests/test-remove-new.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-removing b
-nothing changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-remove-new.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,13 @@
+test that 'hg commit' does not crash if the user removes a newly added file
+
+ $ hg init
+ $ echo This is file a1 > a
+ $ hg add a
+ $ hg commit -m "commit #0"
+ $ touch b
+ $ hg add b
+ $ rm b
+ $ hg commit -A -m"comment #1"
+ removing b
+ nothing changed
+ $ exit 0
--- a/tests/test-remove.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-% file not managed
-not removing foo: file is untracked
-? foo
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 00 state added, options none
-not removing bar: file has been marked for add (use -f to force removal)
-A bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 01 state clean, options none
-R foo
-? bar
-./bar
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 02 state modified, options none
-not removing foo: file is modified (use -f to force removal)
-M foo
-? bar
-./bar
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 03 state missing, options none
-R foo
-? bar
-./bar
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 10 state added, options -f
-? bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 11 state clean, options -f
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 12 state modified, options -f
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 13 state missing, options -f
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 20 state added, options -A
-not removing bar: file still exists (use -f to force removal)
-A bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 21 state clean, options -A
-not removing foo: file still exists (use -f to force removal)
-? bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 22 state modified, options -A
-not removing foo: file still exists (use -f to force removal)
-M foo
-? bar
-./bar
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 23 state missing, options -A
-R foo
-? bar
-./bar
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 30 state added, options -Af
-? bar
-./bar
-./foo
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 31 state clean, options -Af
-R foo
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 32 state modified, options -Af
-R foo
-./foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% 33 state missing, options -Af
-R foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding test/bar
-adding test/foo
-% dir, options none
-removing test/bar
-removing test/foo
-R test/bar
-R test/foo
-./foo
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% dir, options -f
-removing test/bar
-removing test/foo
-R test/bar
-R test/foo
-./foo
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% dir, options -A
-not removing test/foo: file still exists (use -f to force removal)
-removing test/bar
-R test/bar
-./foo
-./test/foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% dir, options -Af
-removing test/bar
-removing test/foo
-R test/bar
-R test/foo
-./foo
-./test/foo
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-test remove dropping empty trees (issue1861)
-adding issue1861/b/c/y
-adding issue1861/x
-removing issue1861/b/c/y
-x
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-remove.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,256 @@
+ $ remove() {
+ > hg rm $@
+ > echo "exit code: $?"
+ > hg st
+ > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
+ > find . -name .hg -prune -o -type f -print | sort
+ > hg up -C
+ > }
+
+ $ hg init a
+ $ cd a
+ $ echo a > foo
+
+file not managed
+
+ $ remove foo
+ not removing foo: file is untracked
+ exit code: 1
+ ? foo
+ ./foo
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ hg add foo
+ $ hg commit -m1
+
+the table cases
+00 state added, options none
+
+ $ echo b > bar
+ $ hg add bar
+ $ remove bar
+ not removing bar: file has been marked for add (use -f to force removal)
+ exit code: 1
+ A bar
+ ./bar
+ ./foo
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+01 state clean, options none
+
+ $ remove foo
+ exit code: 0
+ R foo
+ ? bar
+ ./bar
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+02 state modified, options none
+
+ $ echo b >> foo
+ $ remove foo
+ not removing foo: file is modified (use -f to force removal)
+ exit code: 1
+ M foo
+ ? bar
+ ./bar
+ ./foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+03 state missing, options none
+
+ $ rm foo
+ $ remove foo
+ exit code: 0
+ R foo
+ ? bar
+ ./bar
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+10 state added, options -f
+
+ $ echo b > bar
+ $ hg add bar
+ $ remove -f bar
+ exit code: 0
+ ? bar
+ ./bar
+ ./foo
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm bar
+
+11 state clean, options -f
+
+ $ remove -f foo
+ exit code: 0
+ R foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+12 state modified, options -f
+
+ $ echo b >> foo
+ $ remove -f foo
+ exit code: 0
+ R foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+13 state missing, options -f
+
+ $ rm foo
+ $ remove -f foo
+ exit code: 0
+ R foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+20 state added, options -A
+
+ $ echo b > bar
+ $ hg add bar
+ $ remove -A bar
+ not removing bar: file still exists (use -f to force removal)
+ exit code: 1
+ A bar
+ ./bar
+ ./foo
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+21 state clean, options -A
+
+ $ remove -A foo
+ not removing foo: file still exists (use -f to force removal)
+ exit code: 1
+ ? bar
+ ./bar
+ ./foo
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+22 state modified, options -A
+
+ $ echo b >> foo
+ $ remove -A foo
+ not removing foo: file still exists (use -f to force removal)
+ exit code: 1
+ M foo
+ ? bar
+ ./bar
+ ./foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+23 state missing, options -A
+
+ $ rm foo
+ $ remove -A foo
+ exit code: 0
+ R foo
+ ? bar
+ ./bar
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+30 state added, options -Af
+
+ $ echo b > bar
+ $ hg add bar
+ $ remove -Af bar
+ exit code: 0
+ ? bar
+ ./bar
+ ./foo
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm bar
+
+31 state clean, options -Af
+
+ $ remove -Af foo
+ exit code: 0
+ R foo
+ ./foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+32 state modified, options -Af
+
+ $ echo b >> foo
+ $ remove -Af foo
+ exit code: 0
+ R foo
+ ./foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+33 state missing, options -Af
+
+ $ rm foo
+ $ remove -Af foo
+ exit code: 0
+ R foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+test some directory stuff
+
+ $ mkdir test
+ $ echo a > test/foo
+ $ echo b > test/bar
+ $ hg ci -Am2
+ adding test/bar
+ adding test/foo
+
+dir, options none
+
+ $ rm test/bar
+ $ remove test
+ removing test/bar
+ removing test/foo
+ exit code: 0
+ R test/bar
+ R test/foo
+ ./foo
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+dir, options -f
+
+ $ rm test/bar
+ $ remove -f test
+ removing test/bar
+ removing test/foo
+ exit code: 0
+ R test/bar
+ R test/foo
+ ./foo
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+dir, options -A
+
+ $ rm test/bar
+ $ remove -A test
+ not removing test/foo: file still exists (use -f to force removal)
+ removing test/bar
+ exit code: 1
+ R test/bar
+ ./foo
+ ./test/foo
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+dir, options -Af
+
+ $ rm test/bar
+ $ remove -Af test
+ removing test/bar
+ removing test/foo
+ exit code: 0
+ R test/bar
+ R test/foo
+ ./foo
+ ./test/foo
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+test remove dropping empty trees (issue1861)
+
+ $ mkdir -p issue1861/b/c
+ $ echo x > issue1861/x
+ $ echo y > issue1861/b/c/y
+ $ hg ci -Am add
+ adding issue1861/b/c/y
+ adding issue1861/x
+ $ hg rm issue1861/b
+ removing issue1861/b/c/y
+ $ hg ci -m remove
+ $ ls issue1861
+ x
--- a/tests/test-rename Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-#!/bin/sh
-
-hg init
-mkdir d1 d1/d11 d2
-echo d1/a > d1/a
-echo d1/ba > d1/ba
-echo d1/a1 > d1/d11/a1
-echo d1/b > d1/b
-echo d2/b > d2/b
-hg add d1/a d1/b d1/ba d1/d11/a1 d2/b
-hg commit -m "1" -d "1000000 0"
-
-echo "# rename a single file"
-hg rename d1/d11/a1 d2/c
-hg sum
-hg status -C
-hg update -C
-rm d2/c
-
-echo "# rename --after a single file"
-mv d1/d11/a1 d2/c
-hg rename --after d1/d11/a1 d2/c
-hg status -C
-hg update -C
-rm d2/c
-
-echo '# rename --after a single file when src and tgt already tracked'
-mv d1/d11/a1 d2/c
-hg addrem -s 0
-hg rename --after d1/d11/a1 d2/c
-hg status -C
-hg update -C
-rm d2/c
-
-echo "# rename --after a single file to a nonexistant target filename"
-hg rename --after d1/a dummy
-
-echo "# move a single file to an existing directory"
-hg rename d1/d11/a1 d2
-hg status -C
-hg update -C
-rm d2/a1
-
-echo "# move --after a single file to an existing directory"
-mv d1/d11/a1 d2
-hg rename --after d1/d11/a1 d2
-hg status -C
-hg update -C
-rm d2/a1
-
-echo "# rename a file using a relative path"
-(cd d1/d11; hg rename ../../d2/b e)
-hg status -C
-hg update -C
-rm d1/d11/e
-
-echo "# rename --after a file using a relative path"
-(cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e)
-hg status -C
-hg update -C
-rm d1/d11/e
-
-echo "# rename directory d1 as d3"
-hg rename d1/ d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# rename --after directory d1 as d3"
-mv d1 d3
-hg rename --after d1 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move a directory using a relative path"
-(cd d2; mkdir d3; hg rename ../d1/d11 d3)
-hg status -C
-hg update -C
-rm -rf d2/d3
-
-echo "# move --after a directory using a relative path"
-(cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3)
-hg status -C
-hg update -C
-rm -rf d2/d3
-
-echo "# move directory d1/d11 to an existing directory d2 (removes empty d1)"
-hg rename d1/d11/ d2
-hg status -C
-hg update -C
-rm -rf d2/d11
-
-echo "# move directories d1 and d2 to a new directory d3"
-mkdir d3
-hg rename d1 d2 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move --after directories d1 and d2 to a new directory d3"
-mkdir d3
-mv d1 d2 d3
-hg rename --after d1 d2 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move everything under directory d1 to existing directory d2, do not"
-echo "# overwrite existing files (d2/b)"
-hg rename d1/* d2
-hg status -C
-diff d1/b d2/b
-hg update -C
-rm d2/a d2/ba d2/d11/a1
-
-echo "# attempt to move one file into a non-existent directory"
-hg rename d1/a dx/
-hg status -C
-hg update -C
-
-echo "# attempt to move potentially more than one file into a non-existent"
-echo "# directory"
-hg rename 'glob:d1/**' dx
-
-echo "# move every file under d1 to d2/d21 (glob)"
-mkdir d2/d21
-hg rename 'glob:d1/**' d2/d21
-hg status -C
-hg update -C
-rm -rf d2/d21
-
-echo "# move --after some files under d1 to d2/d21 (glob)"
-mkdir d2/d21
-mv d1/a d1/d11/a1 d2/d21
-hg rename --after 'glob:d1/**' d2/d21
-hg status -C
-hg update -C
-rm -rf d2/d21
-
-echo "# move every file under d1 starting with an 'a' to d2/d21 (regexp)"
-mkdir d2/d21
-hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21
-hg status -C
-hg update -C
-rm -rf d2/d21
-
-echo "# attempt to overwrite an existing file"
-echo "ca" > d1/ca
-hg rename d1/ba d1/ca
-hg status -C
-hg update -C
-
-echo "# forced overwrite of an existing file"
-echo "ca" > d1/ca
-hg rename --force d1/ba d1/ca
-hg status -C
-hg update -C
-rm d1/ca
-
-echo "# replace a symlink with a file"
-ln -s ba d1/ca
-hg rename --force d1/ba d1/ca
-hg status -C
-hg update -C
-rm d1/ca
-
-echo "# do not copy more than one source file to the same destination file"
-mkdir d3
-hg rename d1/* d2/* d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move a whole subtree with \"hg rename .\""
-mkdir d3
-(cd d1; hg rename . ../d3)
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move a whole subtree with \"hg rename --after .\""
-mkdir d3
-mv d1/* d3
-(cd d1; hg rename --after . ../d3)
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# move the parent tree with \"hg rename ..\""
-(cd d1/d11; hg rename .. ../../d3)
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# skip removed files"
-hg remove d1/b
-hg rename d1 d3
-hg status -C
-hg update -C
-rm -rf d3
-
-echo "# transitive rename"
-hg rename d1/b d1/bb
-hg rename d1/bb d1/bc
-hg status -C
-hg update -C
-rm d1/bc
-
-echo "# transitive rename --after"
-hg rename d1/b d1/bb
-mv d1/bb d1/bc
-hg rename --after d1/bb d1/bc
-hg status -C
-hg update -C
-rm d1/bc
-
-echo "# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)"
-hg rename d1/b d1/bb
-echo "some stuff added to d1/bb" >> d1/bb
-hg rename d1/bb d1/b
-hg status -C
-hg update -C
-
-echo '# overwriting with renames (issue1959)'
-hg rename d1/a d1/c
-hg rename d1/b d1/a
-hg status -C
-hg diff --git
-hg update -C
-
-echo "# check illegal path components"
-
-hg rename d1/d11/a1 .hg/foo
-hg status -C
-hg rename d1/d11/a1 ../foo
-hg status -C
-
-mv d1/d11/a1 .hg/foo
-hg rename --after d1/d11/a1 .hg/foo
-hg status -C
-hg update -C
-rm .hg/foo
-
-hg rename d1/d11/a1 .hg
-hg status -C
-hg rename d1/d11/a1 ..
-hg status -C
-
-mv d1/d11/a1 .hg
-hg rename --after d1/d11/a1 .hg
-hg status -C
-hg update -C
-rm .hg/a1
-
-(cd d1/d11; hg rename ../../d2/b ../../.hg/foo)
-hg status -C
-(cd d1/d11; hg rename ../../d2/b ../../../foo)
-hg status -C
-
--- a/tests/test-rename-dir-merge Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-
-mkdir a
-echo foo > a/a
-echo bar > a/b
-hg ci -Am "0"
-
-hg co -C 0
-hg mv a b
-hg ci -m "1 mv a/ b/"
-
-hg co -C 0
-echo baz > a/c
-echo quux > a/d
-hg add a/c
-hg ci -m "2 add a/c"
-
-hg merge --debug 1
-echo a/* b/*
-hg st -C
-hg ci -m "3 merge 2+1"
-hg debugrename b/c
-
-hg co -C 1
-hg merge --debug 2
-echo a/* b/*
-hg st -C
-hg ci -m "4 merge 1+2"
-hg debugrename b/c
--- a/tests/test-rename-dir-merge.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-adding a/a
-adding a/b
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-moving a/a to b/a
-moving a/b to b/b
-2 files updated, 0 files merged, 2 files removed, 0 files unresolved
-created new head
- searching for copies back to rev 1
- unmatched files in local:
- a/c
- a/d
- unmatched files in other:
- b/a
- b/b
- all copies found (* = to merge, ! = divergent):
- b/a -> a/a
- b/b -> a/b
- checking for directory renames
- dir a/ -> b/
- file a/c -> b/c
- file a/d -> b/d
-resolving manifests
- overwrite None partial False
- ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
- a/d: remote renamed directory to b/d -> d
- a/c: remote renamed directory to b/c -> d
- a/b: other deleted -> r
- a/a: other deleted -> r
- b/a: remote created -> g
- b/b: remote created -> g
-updating: a/a 1/6 files (16.67%)
-removing a/a
-updating: a/b 2/6 files (33.33%)
-removing a/b
-updating: a/c 3/6 files (50.00%)
-moving a/c to b/c
-updating: a/d 4/6 files (66.67%)
-moving a/d to b/d
-updating: b/a 5/6 files (83.33%)
-getting b/a
-updating: b/b 6/6 files (100.00%)
-getting b/b
-4 files updated, 0 files merged, 2 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-a/* b/a b/b b/c b/d
-M b/a
-M b/b
-A b/c
- a/c
-R a/a
-R a/b
-R a/c
-? b/d
-b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
- searching for copies back to rev 1
- unmatched files in local:
- b/a
- b/b
- b/d
- unmatched files in other:
- a/c
- all copies found (* = to merge, ! = divergent):
- b/a -> a/a
- b/b -> a/b
- checking for directory renames
- dir a/ -> b/
- file a/c -> b/c
-resolving manifests
- overwrite None partial False
- ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
- None: local renamed directory to b/c -> d
-updating:None 1/1 files (100.00%)
-getting a/c to b/c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-a/* b/a b/b b/c b/d
-A b/c
- a/c
-? b/d
-created new head
-b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-dir-merge.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,165 @@
+ $ mkdir t
+ $ cd t
+ $ hg init
+
+ $ mkdir a
+ $ echo foo > a/a
+ $ echo bar > a/b
+ $ hg ci -Am "0"
+ adding a/a
+ adding a/b
+
+ $ hg co -C 0
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg mv a b
+ moving a/a to b/a
+ moving a/b to b/b
+ $ hg ci -m "1 mv a/ b/"
+
+ $ hg co -C 0
+ 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ $ echo baz > a/c
+ $ echo quux > a/d
+ $ hg add a/c
+ $ hg ci -m "2 add a/c"
+ created new head
+
+ $ hg merge --debug 1
+ searching for copies back to rev 1
+ unmatched files in local:
+ a/c
+ a/d
+ unmatched files in other:
+ b/a
+ b/b
+ all copies found (* = to merge, ! = divergent):
+ b/a -> a/a
+ b/b -> a/b
+ checking for directory renames
+ dir a/ -> b/
+ file a/c -> b/c
+ file a/d -> b/d
+ resolving manifests
+ overwrite None partial False
+ ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
+ a/d: remote renamed directory to b/d -> d
+ a/c: remote renamed directory to b/c -> d
+ a/b: other deleted -> r
+ a/a: other deleted -> r
+ b/a: remote created -> g
+ b/b: remote created -> g
+ updating: a/a 1/6 files (16.67%)
+ removing a/a
+ updating: a/b 2/6 files (33.33%)
+ removing a/b
+ updating: a/c 3/6 files (50.00%)
+ moving a/c to b/c
+ updating: a/d 4/6 files (66.67%)
+ moving a/d to b/d
+ updating: b/a 5/6 files (83.33%)
+ getting b/a
+ updating: b/b 6/6 files (100.00%)
+ getting b/b
+ 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ echo a/* b/*
+ a/* b/a b/b b/c b/d
+ $ hg st -C
+ M b/a
+ M b/b
+ A b/c
+ a/c
+ R a/a
+ R a/b
+ R a/c
+ ? b/d
+ $ hg ci -m "3 merge 2+1"
+ $ hg debugrename b/c
+ b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
+
+ $ hg co -C 1
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ hg merge --debug 2
+ searching for copies back to rev 1
+ unmatched files in local:
+ b/a
+ b/b
+ b/d
+ unmatched files in other:
+ a/c
+ all copies found (* = to merge, ! = divergent):
+ b/a -> a/a
+ b/b -> a/b
+ checking for directory renames
+ dir a/ -> b/
+ file a/c -> b/c
+ resolving manifests
+ overwrite None partial False
+ ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
+ None: local renamed directory to b/c -> d
+ updating:None 1/1 files (100.00%)
+ getting a/c to b/c
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ echo a/* b/*
+ a/* b/a b/b b/c b/d
+ $ hg st -C
+ A b/c
+ a/c
+ ? b/d
+ $ hg ci -m "4 merge 1+2"
+ created new head
+ $ hg debugrename b/c
+ b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
+
+
+Second scenario with two repos:
+
+ $ cd ..
+ $ mkdir r1
+ $ cd r1
+ $ hg init
+ $ mkdir a
+ $ echo foo > a/f
+ $ hg add a
+ adding a/f
+ $ hg ci -m "a/f == foo"
+ $ cd ..
+
+ $ hg clone r1 r2
+ updating to branch default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cd r2
+ $ hg mv a b
+ moving a/f to b/f
+ $ echo foo1 > b/f
+ $ hg ci -m" a -> b, b/f == foo1"
+ $ cd ..
+
+ $ cd r1
+ $ mkdir a/aa
+ $ echo bar > a/aa/g
+ $ hg add a/aa
+ adding a/aa/g
+ $ hg ci -m "a/aa/g"
+ $ hg pull ../r2
+ pulling from ../r2
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files (+1 heads)
+ (run 'hg heads' to see heads, 'hg merge' to merge)
+
+ $ hg merge
+ 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+
+ $ hg st -C
+ M b/f
+ A b/aa/g
+ a/aa/g
+ R a/aa/g
+ R a/f
--- a/tests/test-rename-dir-merge2 Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-mkdir r1
-cd r1
-hg init
-mkdir a
-echo foo > a/f
-hg add a
-hg ci -m "a/f == foo"
-cd ..
-
-hg clone r1 r2
-cd r2
-hg mv a b
-echo foo1 > b/f
-hg ci -m" a -> b, b/f == foo1"
-cd ..
-
-cd r1
-mkdir a/aa
-echo bar > a/aa/g
-hg add a/aa
-hg ci -m "a/aa/g"
-hg pull ../r2
-
-hg merge
-
-hg st -C
--- a/tests/test-rename-dir-merge2.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-adding a/f
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-moving a/f to b/f
-adding a/aa/g
-pulling from ../r2
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-M b/f
-A b/aa/g
- a/aa/g
-R a/aa/g
-R a/f
--- a/tests/test-rename.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,344 +0,0 @@
-# rename a single file
-parent: 0:6f9914c7a010 tip
- 1
-branch: default
-commit: 1 renamed
-update: (current)
-A d2/c
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a single file
-A d2/c
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a single file when src and tgt already tracked
-removing d1/d11/a1
-adding d2/c
-A d2/c
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a single file to a nonexistant target filename
-d1/a: not recording move - dummy does not exist
-# move a single file to an existing directory
-A d2/a1
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after a single file to an existing directory
-A d2/a1
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename a file using a relative path
-A d1/d11/e
- d2/b
-R d2/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after a file using a relative path
-A d1/d11/e
- d2/b
-R d2/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename directory d1 as d3
-moving d1/a to d3/a
-moving d1/b to d3/b
-moving d1/ba to d3/ba
-moving d1/d11/a1 to d3/d11/a1
-A d3/a
- d1/a
-A d3/b
- d1/b
-A d3/ba
- d1/ba
-A d3/d11/a1
- d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# rename --after directory d1 as d3
-moving d1/a to d3/a
-moving d1/b to d3/b
-moving d1/ba to d3/ba
-moving d1/d11/a1 to d3/d11/a1
-A d3/a
- d1/a
-A d3/b
- d1/b
-A d3/ba
- d1/ba
-A d3/d11/a1
- d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move a directory using a relative path
-moving ../d1/d11/a1 to d3/d11/a1
-A d2/d3/d11/a1
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after a directory using a relative path
-moving ../d1/d11/a1 to d3/d11/a1
-A d2/d3/d11/a1
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move directory d1/d11 to an existing directory d2 (removes empty d1)
-moving d1/d11/a1 to d2/d11/a1
-A d2/d11/a1
- d1/d11/a1
-R d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move directories d1 and d2 to a new directory d3
-moving d1/a to d3/d1/a
-moving d1/b to d3/d1/b
-moving d1/ba to d3/d1/ba
-moving d1/d11/a1 to d3/d1/d11/a1
-moving d2/b to d3/d2/b
-A d3/d1/a
- d1/a
-A d3/d1/b
- d1/b
-A d3/d1/ba
- d1/ba
-A d3/d1/d11/a1
- d1/d11/a1
-A d3/d2/b
- d2/b
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-R d2/b
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after directories d1 and d2 to a new directory d3
-moving d1/a to d3/d1/a
-moving d1/b to d3/d1/b
-moving d1/ba to d3/d1/ba
-moving d1/d11/a1 to d3/d1/d11/a1
-moving d2/b to d3/d2/b
-A d3/d1/a
- d1/a
-A d3/d1/b
- d1/b
-A d3/d1/ba
- d1/ba
-A d3/d1/d11/a1
- d1/d11/a1
-A d3/d2/b
- d2/b
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-R d2/b
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move everything under directory d1 to existing directory d2, do not
-# overwrite existing files (d2/b)
-d2/b: not overwriting - file exists
-moving d1/d11/a1 to d2/d11/a1
-A d2/a
- d1/a
-A d2/ba
- d1/ba
-A d2/d11/a1
- d1/d11/a1
-R d1/a
-R d1/ba
-R d1/d11/a1
-1c1
-< d1/b
----
-> d2/b
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# attempt to move one file into a non-existent directory
-abort: destination dx/ is not a directory
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# attempt to move potentially more than one file into a non-existent
-# directory
-abort: with multiple sources, destination must be an existing directory
-# move every file under d1 to d2/d21 (glob)
-moving d1/a to d2/d21/a
-moving d1/b to d2/d21/b
-moving d1/ba to d2/d21/ba
-moving d1/d11/a1 to d2/d21/a1
-A d2/d21/a
- d1/a
-A d2/d21/a1
- d1/d11/a1
-A d2/d21/b
- d1/b
-A d2/d21/ba
- d1/ba
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move --after some files under d1 to d2/d21 (glob)
-moving d1/a to d2/d21/a
-d1/b: not recording move - d2/d21/b does not exist
-d1/ba: not recording move - d2/d21/ba does not exist
-moving d1/d11/a1 to d2/d21/a1
-A d2/d21/a
- d1/a
-A d2/d21/a1
- d1/d11/a1
-R d1/a
-R d1/d11/a1
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move every file under d1 starting with an 'a' to d2/d21 (regexp)
-moving d1/a to d2/d21/a
-moving d1/d11/a1 to d2/d21/a1
-A d2/d21/a
- d1/a
-A d2/d21/a1
- d1/d11/a1
-R d1/a
-R d1/d11/a1
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# attempt to overwrite an existing file
-d1/ca: not overwriting - file exists
-? d1/ca
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# forced overwrite of an existing file
-A d1/ca
- d1/ba
-R d1/ba
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# replace a symlink with a file
-A d1/ca
- d1/ba
-R d1/ba
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# do not copy more than one source file to the same destination file
-moving d1/d11/a1 to d3/d11/a1
-d3/b: not overwriting - d2/b collides with d1/b
-A d3/a
- d1/a
-A d3/b
- d1/b
-A d3/ba
- d1/ba
-A d3/d11/a1
- d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move a whole subtree with "hg rename ."
-moving a to ../d3/d1/a
-moving b to ../d3/d1/b
-moving ba to ../d3/d1/ba
-moving d11/a1 to ../d3/d1/d11/a1
-A d3/d1/a
- d1/a
-A d3/d1/b
- d1/b
-A d3/d1/ba
- d1/ba
-A d3/d1/d11/a1
- d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move a whole subtree with "hg rename --after ."
-moving a to ../d3/a
-moving b to ../d3/b
-moving ba to ../d3/ba
-moving d11/a1 to ../d3/d11/a1
-A d3/a
- d1/a
-A d3/b
- d1/b
-A d3/ba
- d1/ba
-A d3/d11/a1
- d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# move the parent tree with "hg rename .."
-moving ../a to ../../d3/a
-moving ../b to ../../d3/b
-moving ../ba to ../../d3/ba
-moving a1 to ../../d3/d11/a1
-A d3/a
- d1/a
-A d3/b
- d1/b
-A d3/ba
- d1/ba
-A d3/d11/a1
- d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# skip removed files
-moving d1/a to d3/a
-moving d1/ba to d3/ba
-moving d1/d11/a1 to d3/d11/a1
-A d3/a
- d1/a
-A d3/ba
- d1/ba
-A d3/d11/a1
- d1/d11/a1
-R d1/a
-R d1/b
-R d1/ba
-R d1/d11/a1
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# transitive rename
-A d1/bc
- d1/b
-R d1/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# transitive rename --after
-A d1/bc
- d1/b
-R d1/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)
-M d1/b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# overwriting with renames (issue1959)
-A d1/a
- d1/b
-A d1/c
- d1/a
-R d1/b
-diff --git a/d1/b b/d1/a
-rename from d1/b
-rename to d1/a
-diff --git a/d1/a b/d1/c
-copy from d1/a
-copy to d1/c
-2 files updated, 0 files merged, 1 files removed, 0 files unresolved
-# check illegal path components
-abort: path contains illegal component: .hg/foo
-abort: ../foo not under root
-abort: path contains illegal component: .hg/foo
-! d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: path contains illegal component: .hg/a1
-abort: ../a1 not under root
-abort: path contains illegal component: .hg/a1
-! d1/d11/a1
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: path contains illegal component: .hg/foo
-abort: ../../../foo not under root
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,599 @@
+ $ hg init
+ $ mkdir d1 d1/d11 d2
+ $ echo d1/a > d1/a
+ $ echo d1/ba > d1/ba
+ $ echo d1/a1 > d1/d11/a1
+ $ echo d1/b > d1/b
+ $ echo d2/b > d2/b
+ $ hg add d1/a d1/b d1/ba d1/d11/a1 d2/b
+ $ hg commit -m "1"
+
+rename a single file
+
+ $ hg rename d1/d11/a1 d2/c
+ $ hg sum
+ parent: 0:9b4b6e7b2c26 tip
+ 1
+ branch: default
+ commit: 1 renamed
+ update: (current)
+ $ hg status -C
+ A d2/c
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d2/c
+
+rename --after a single file
+
+ $ mv d1/d11/a1 d2/c
+ $ hg rename --after d1/d11/a1 d2/c
+ $ hg status -C
+ A d2/c
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d2/c
+
+rename --after a single file when src and tgt already tracked
+
+ $ mv d1/d11/a1 d2/c
+ $ hg addrem -s 0
+ removing d1/d11/a1
+ adding d2/c
+ $ hg rename --after d1/d11/a1 d2/c
+ $ hg status -C
+ A d2/c
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d2/c
+
+rename --after a single file to a nonexistant target filename
+
+ $ hg rename --after d1/a dummy
+ d1/a: not recording move - dummy does not exist
+
+move a single file to an existing directory
+
+ $ hg rename d1/d11/a1 d2
+ $ hg status -C
+ A d2/a1
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d2/a1
+
+move --after a single file to an existing directory
+
+ $ mv d1/d11/a1 d2
+ $ hg rename --after d1/d11/a1 d2
+ $ hg status -C
+ A d2/a1
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d2/a1
+
+rename a file using a relative path
+
+ $ (cd d1/d11; hg rename ../../d2/b e)
+ $ hg status -C
+ A d1/d11/e
+ d2/b
+ R d2/b
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d1/d11/e
+
+rename --after a file using a relative path
+
+ $ (cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e)
+ $ hg status -C
+ A d1/d11/e
+ d2/b
+ R d2/b
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d1/d11/e
+
+rename directory d1 as d3
+
+ $ hg rename d1/ d3
+ moving d1/a to d3/a
+ moving d1/b to d3/b
+ moving d1/ba to d3/ba
+ moving d1/d11/a1 to d3/d11/a1
+ $ hg status -C
+ A d3/a
+ d1/a
+ A d3/b
+ d1/b
+ A d3/ba
+ d1/ba
+ A d3/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+rename --after directory d1 as d3
+
+ $ mv d1 d3
+ $ hg rename --after d1 d3
+ moving d1/a to d3/a
+ moving d1/b to d3/b
+ moving d1/ba to d3/ba
+ moving d1/d11/a1 to d3/d11/a1
+ $ hg status -C
+ A d3/a
+ d1/a
+ A d3/b
+ d1/b
+ A d3/ba
+ d1/ba
+ A d3/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+move a directory using a relative path
+
+ $ (cd d2; mkdir d3; hg rename ../d1/d11 d3)
+ moving ../d1/d11/a1 to d3/d11/a1
+ $ hg status -C
+ A d2/d3/d11/a1
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d2/d3
+
+move --after a directory using a relative path
+
+ $ (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3)
+ moving ../d1/d11/a1 to d3/d11/a1
+ $ hg status -C
+ A d2/d3/d11/a1
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d2/d3
+
+move directory d1/d11 to an existing directory d2 (removes empty d1)
+
+ $ hg rename d1/d11/ d2
+ moving d1/d11/a1 to d2/d11/a1
+ $ hg status -C
+ A d2/d11/a1
+ d1/d11/a1
+ R d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d2/d11
+
+move directories d1 and d2 to a new directory d3
+
+ $ mkdir d3
+ $ hg rename d1 d2 d3
+ moving d1/a to d3/d1/a
+ moving d1/b to d3/d1/b
+ moving d1/ba to d3/d1/ba
+ moving d1/d11/a1 to d3/d1/d11/a1
+ moving d2/b to d3/d2/b
+ $ hg status -C
+ A d3/d1/a
+ d1/a
+ A d3/d1/b
+ d1/b
+ A d3/d1/ba
+ d1/ba
+ A d3/d1/d11/a1
+ d1/d11/a1
+ A d3/d2/b
+ d2/b
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ R d2/b
+ $ hg update -C
+ 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+move --after directories d1 and d2 to a new directory d3
+
+ $ mkdir d3
+ $ mv d1 d2 d3
+ $ hg rename --after d1 d2 d3
+ moving d1/a to d3/d1/a
+ moving d1/b to d3/d1/b
+ moving d1/ba to d3/d1/ba
+ moving d1/d11/a1 to d3/d1/d11/a1
+ moving d2/b to d3/d2/b
+ $ hg status -C
+ A d3/d1/a
+ d1/a
+ A d3/d1/b
+ d1/b
+ A d3/d1/ba
+ d1/ba
+ A d3/d1/d11/a1
+ d1/d11/a1
+ A d3/d2/b
+ d2/b
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ R d2/b
+ $ hg update -C
+ 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+move everything under directory d1 to existing directory d2, do not
+overwrite existing files (d2/b)
+
+ $ hg rename d1/* d2
+ d2/b: not overwriting - file exists
+ moving d1/d11/a1 to d2/d11/a1
+ $ hg status -C
+ A d2/a
+ d1/a
+ A d2/ba
+ d1/ba
+ A d2/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/ba
+ R d1/d11/a1
+ $ diff -u d1/b d2/b
+ --- d1/b .*
+ \+\+\+ d2/b .*
+ @@ -1 +1 @@
+ -d1/b
+ +d2/b
+ $ hg update -C
+ 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d2/a d2/ba d2/d11/a1
+
+attempt to move one file into a non-existent directory
+
+ $ hg rename d1/a dx/
+ abort: destination dx/ is not a directory
+ $ hg status -C
+ $ hg update -C
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+attempt to move potentially more than one file into a non-existent directory
+
+ $ hg rename 'glob:d1/**' dx
+ abort: with multiple sources, destination must be an existing directory
+
+move every file under d1 to d2/d21 (glob)
+
+ $ mkdir d2/d21
+ $ hg rename 'glob:d1/**' d2/d21
+ moving d1/a to d2/d21/a
+ moving d1/b to d2/d21/b
+ moving d1/ba to d2/d21/ba
+ moving d1/d11/a1 to d2/d21/a1
+ $ hg status -C
+ A d2/d21/a
+ d1/a
+ A d2/d21/a1
+ d1/d11/a1
+ A d2/d21/b
+ d1/b
+ A d2/d21/ba
+ d1/ba
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d2/d21
+
+move --after some files under d1 to d2/d21 (glob)
+
+ $ mkdir d2/d21
+ $ mv d1/a d1/d11/a1 d2/d21
+ $ hg rename --after 'glob:d1/**' d2/d21
+ moving d1/a to d2/d21/a
+ d1/b: not recording move - d2/d21/b does not exist
+ d1/ba: not recording move - d2/d21/ba does not exist
+ moving d1/d11/a1 to d2/d21/a1
+ $ hg status -C
+ A d2/d21/a
+ d1/a
+ A d2/d21/a1
+ d1/d11/a1
+ R d1/a
+ R d1/d11/a1
+ $ hg update -C
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d2/d21
+
+move every file under d1 starting with an 'a' to d2/d21 (regexp)
+
+ $ mkdir d2/d21
+ $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21
+ moving d1/a to d2/d21/a
+ moving d1/d11/a1 to d2/d21/a1
+ $ hg status -C
+ A d2/d21/a
+ d1/a
+ A d2/d21/a1
+ d1/d11/a1
+ R d1/a
+ R d1/d11/a1
+ $ hg update -C
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d2/d21
+
+attempt to overwrite an existing file
+
+ $ echo "ca" > d1/ca
+ $ hg rename d1/ba d1/ca
+ d1/ca: not overwriting - file exists
+ $ hg status -C
+ ? d1/ca
+ $ hg update -C
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+forced overwrite of an existing file
+
+ $ echo "ca" > d1/ca
+ $ hg rename --force d1/ba d1/ca
+ $ hg status -C
+ A d1/ca
+ d1/ba
+ R d1/ba
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d1/ca
+
+replace a symlink with a file
+
+ $ ln -s ba d1/ca
+ $ hg rename --force d1/ba d1/ca
+ $ hg status -C
+ A d1/ca
+ d1/ba
+ R d1/ba
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d1/ca
+
+do not copy more than one source file to the same destination file
+
+ $ mkdir d3
+ $ hg rename d1/* d2/* d3
+ moving d1/d11/a1 to d3/d11/a1
+ d3/b: not overwriting - d2/b collides with d1/b
+ $ hg status -C
+ A d3/a
+ d1/a
+ A d3/b
+ d1/b
+ A d3/ba
+ d1/ba
+ A d3/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+move a whole subtree with \"hg rename .\"
+
+ $ mkdir d3
+ $ (cd d1; hg rename . ../d3)
+ moving a to ../d3/d1/a
+ moving b to ../d3/d1/b
+ moving ba to ../d3/d1/ba
+ moving d11/a1 to ../d3/d1/d11/a1
+ $ hg status -C
+ A d3/d1/a
+ d1/a
+ A d3/d1/b
+ d1/b
+ A d3/d1/ba
+ d1/ba
+ A d3/d1/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+move a whole subtree with \"hg rename --after .\"
+
+ $ mkdir d3
+ $ mv d1/* d3
+ $ (cd d1; hg rename --after . ../d3)
+ moving a to ../d3/a
+ moving b to ../d3/b
+ moving ba to ../d3/ba
+ moving d11/a1 to ../d3/d11/a1
+ $ hg status -C
+ A d3/a
+ d1/a
+ A d3/b
+ d1/b
+ A d3/ba
+ d1/ba
+ A d3/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+move the parent tree with \"hg rename ..\"
+
+ $ (cd d1/d11; hg rename .. ../../d3)
+ moving ../a to ../../d3/a
+ moving ../b to ../../d3/b
+ moving ../ba to ../../d3/ba
+ moving a1 to ../../d3/d11/a1
+ $ hg status -C
+ A d3/a
+ d1/a
+ A d3/b
+ d1/b
+ A d3/ba
+ d1/ba
+ A d3/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+skip removed files
+
+ $ hg remove d1/b
+ $ hg rename d1 d3
+ moving d1/a to d3/a
+ moving d1/ba to d3/ba
+ moving d1/d11/a1 to d3/d11/a1
+ $ hg status -C
+ A d3/a
+ d1/a
+ A d3/ba
+ d1/ba
+ A d3/d11/a1
+ d1/d11/a1
+ R d1/a
+ R d1/b
+ R d1/ba
+ R d1/d11/a1
+ $ hg update -C
+ 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm -rf d3
+
+transitive rename
+
+ $ hg rename d1/b d1/bb
+ $ hg rename d1/bb d1/bc
+ $ hg status -C
+ A d1/bc
+ d1/b
+ R d1/b
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d1/bc
+
+transitive rename --after
+
+ $ hg rename d1/b d1/bb
+ $ mv d1/bb d1/bc
+ $ hg rename --after d1/bb d1/bc
+ $ hg status -C
+ A d1/bc
+ d1/b
+ R d1/b
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm d1/bc
+
+ $ echo "# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)"
+ # idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)
+ $ hg rename d1/b d1/bb
+ $ echo "some stuff added to d1/bb" >> d1/bb
+ $ hg rename d1/bb d1/b
+ $ hg status -C
+ M d1/b
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+overwriting with renames (issue1959)
+
+ $ hg rename d1/a d1/c
+ $ hg rename d1/b d1/a
+ $ hg status -C
+ A d1/a
+ d1/b
+ A d1/c
+ d1/a
+ R d1/b
+ $ hg diff --git
+ diff --git a/d1/b b/d1/a
+ rename from d1/b
+ rename to d1/a
+ diff --git a/d1/a b/d1/c
+ copy from d1/a
+ copy to d1/c
+ $ hg update -C
+ 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+check illegal path components
+
+ $ hg rename d1/d11/a1 .hg/foo
+ abort: path contains illegal component: .hg/foo
+ $ hg status -C
+ $ hg rename d1/d11/a1 ../foo
+ abort: ../foo not under root
+ $ hg status -C
+
+ $ mv d1/d11/a1 .hg/foo
+ $ hg rename --after d1/d11/a1 .hg/foo
+ abort: path contains illegal component: .hg/foo
+ $ hg status -C
+ ! d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm .hg/foo
+
+ $ hg rename d1/d11/a1 .hg
+ abort: path contains illegal component: .hg/a1
+ $ hg status -C
+ $ hg rename d1/d11/a1 ..
+ abort: ../a1 not under root
+ $ hg status -C
+
+ $ mv d1/d11/a1 .hg
+ $ hg rename --after d1/d11/a1 .hg
+ abort: path contains illegal component: .hg/a1
+ $ hg status -C
+ ! d1/d11/a1
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ rm .hg/a1
+
+ $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo)
+ abort: path contains illegal component: .hg/foo
+ $ hg status -C
+ $ (cd d1/d11; hg rename ../../d2/b ../../../foo)
+ abort: ../../../foo not under root
+ $ hg status -C
+
--- a/tests/test-requires Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg add a
-hg commit -m test -d "1000000 0"
-rm .hg/requires
-hg tip
-echo indoor-pool > .hg/requires
-hg tip
-
-true
--- a/tests/test-requires.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-abort: index 00changelog.i unknown format 2!
-abort: requirement 'indoor-pool' not supported!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-requires.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,14 @@
+ $ mkdir t
+ $ cd t
+ $ hg init
+ $ echo a > a
+ $ hg add a
+ $ hg commit -m test
+ $ rm .hg/requires
+ $ hg tip
+ abort: index 00changelog.i unknown format 2!
+ $ echo indoor-pool > .hg/requires
+ $ hg tip
+ abort: requirement 'indoor-pool' not supported!
+
+ $ true
--- a/tests/test-resolve Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-# test that a commit clears the merge state.
-
-hg init repo
-cd repo
-
-echo foo > file
-hg commit -Am 'add file'
-
-echo bar >> file
-hg commit -Am 'append bar'
-
-echo % create a second head
-hg up -C 0
-echo baz >> file
-hg commit -Am 'append baz'
-
-echo % failing merge
-HGMERGE=internal:fail hg merge
-
-echo resolved > file
-hg resolve -m file
-hg commit -m 'resolved'
-
-echo % resolve -l, should be empty
-hg resolve -l
-
-# test crashed merge with empty mergestate
-mkdir .hg/merge
-touch .hg/merge/state
-echo % resolve -l, should be empty
-hg resolve -l
--- a/tests/test-resolve.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-adding file
-% create a second head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-% failing merge
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
-% resolve -l, should be empty
-% resolve -l, should be empty
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-resolve.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,43 @@
+test that a commit clears the merge state.
+
+ $ hg init repo
+ $ cd repo
+
+ $ echo foo > file
+ $ hg commit -Am 'add file'
+ adding file
+
+ $ echo bar >> file
+ $ hg commit -Am 'append bar'
+
+
+create a second head
+
+ $ hg up -C 0
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo baz >> file
+ $ hg commit -Am 'append baz'
+ created new head
+
+failing merge
+
+ $ HGMERGE=internal:fail hg merge
+ 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+ use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
+
+ $ echo resolved > file
+ $ hg resolve -m file
+ $ hg commit -m 'resolved'
+
+resolve -l, should be empty
+
+ $ hg resolve -l
+
+test crashed merge with empty mergestate
+
+ $ mkdir .hg/merge
+ $ touch .hg/merge/state
+
+resolve -l, should be empty
+
+ $ hg resolve -l
--- a/tests/test-revert Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-#!/bin/sh
-
-hg init repo
-cd repo
-echo 123 > a
-echo 123 > c
-echo 123 > e
-hg add a c e
-hg commit -m "first" -d "1000000 0" a c e
-echo 123 > b
-echo %% should show b unknown
-hg status
-echo 12 > c
-echo %% should show b unknown and c modified
-hg status
-hg add b
-echo %% should show b added and c modified
-hg status
-hg rm a
-echo %% should show a removed, b added and c modified
-hg status
-hg revert a
-echo %% should show b added, copy saved, and c modified
-hg status
-hg revert b
-echo %% should show b unknown, and c modified
-hg status
-hg revert --no-backup c
-echo %% should show unknown: b
-hg status
-hg add b
-echo %% should show b added
-hg status b
-rm b
-echo %% should show b deleted
-hg status b
-hg revert -v b
-echo %% should not find b
-hg status b
-echo %% should show a c e
-ls
-echo %% should verbosely save backup to e.orig
-echo z > e
-hg revert --all -v
-echo %% should say no changes needed
-hg revert a
-echo %% should say file not managed
-echo q > q
-hg revert q
-rm q
-echo %% should say file not found
-hg revert notfound
-touch d
-hg add d
-hg rm a
-hg commit -m "second" -d "1000000 0"
-echo z > z
-hg add z
-hg st
-echo %% should add a, remove d, forget z
-hg revert --all -r0
-echo %% should forget a, undelete d
-hg revert --all -rtip
-rm a *.orig
-echo %% should silently add a
-hg revert -r0 a
-hg st a
-hg rm d
-hg st d
-echo %% should silently keep d removed
-hg revert -r0 d
-hg st d
-
-hg update -C
-chmod +x c
-hg revert --all
-echo %% should print non-executable
-test -x c || echo non-executable
-
-chmod +x c
-hg commit -d '1000001 0' -m exe
-
-chmod -x c
-hg revert --all
-echo %% should print executable
-test -x c && echo executable
-
-cd ..
-
-echo %% issue 241
-hg init a
-cd a
-echo a >> a
-hg commit -A -d '1 0' -m a
-echo a >> a
-hg commit -d '2 0' -m a
-hg update 0
-mkdir b
-echo b > b/b
-
-echo % should fail - no arguments
-hg revert -rtip
-
-echo % should succeed
-hg revert --all -rtip
-
-echo %% issue332
-hg ci -A -m b -d '1000001 0'
-echo foobar > b/b
-mkdir newdir
-echo foo > newdir/newfile
-hg add newdir/newfile
-hg revert b newdir
-echo foobar > b/b
-hg revert .
-
-echo % reverting a rename target should revert the source
-hg mv a newa
-hg revert newa
-hg st a newa
-
-cd ..
-
-hg init ignored
-cd ignored
-echo '^ignored$' > .hgignore
-echo '^ignoreddir$' >> .hgignore
-echo '^removed$' >> .hgignore
-
-mkdir ignoreddir
-touch ignoreddir/file
-touch ignoreddir/removed
-touch ignored
-touch removed
-echo '%% 4 ignored files (we will add/commit everything)'
-hg st -A -X .hgignore
-hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
-
-echo >> ignored
-echo >> ignoreddir/file
-hg rm removed ignoreddir/removed
-echo '%% should revert ignored* and undelete *removed'
-hg revert -a --no-backup
-hg st -mardi
-
-hg up -qC
-echo >> ignored
-hg rm removed
-echo %% should silently revert the named files
-hg revert --no-backup ignored removed
-hg st -mardi
--- a/tests/test-revert-flags Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" execbit || exit 80
-
-hg init repo
-cd repo
-echo foo > foo
-chmod 644 foo
-hg ci -qAm '644'
-
-chmod 755 foo
-hg ci -qAm '755'
-
-echo '% reverting to rev 0'
-hg revert -a -r 0
-hg st
-hg diff --git
--- a/tests/test-revert-flags.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-% reverting to rev 0
-reverting foo
-M foo
-diff --git a/foo b/foo
-old mode 100755
-new mode 100644
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revert-flags.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,21 @@
+ $ "$TESTDIR/hghave" execbit || exit 80
+
+ $ hg init repo
+ $ cd repo
+ $ echo foo > foo
+ $ chmod 644 foo
+ $ hg ci -qAm '644'
+
+ $ chmod 755 foo
+ $ hg ci -qAm '755'
+
+reverting to rev 0
+
+ $ hg revert -a -r 0
+ reverting foo
+ $ hg st
+ M foo
+ $ hg diff --git
+ diff --git a/foo b/foo
+ old mode 100755
+ new mode 100644
--- a/tests/test-revert-unknown Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-hg init
-touch unknown
-
-touch a
-hg add a
-hg ci -m "1" -d "1000000 0"
-
-touch b
-hg add b
-hg ci -m "2" -d "1000000 0"
-
-echo %% Should show unknown
-hg status
-hg revert -r 0 --all
-echo %% Should show unknown and b removed
-hg status
-echo %% Should show a and unknown
-ls
--- a/tests/test-revert-unknown.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-%% Should show unknown
-? unknown
-removing b
-%% Should show unknown and b removed
-R b
-? unknown
-%% Should show a and unknown
-a
-unknown
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revert-unknown.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,29 @@
+ $ hg init
+ $ touch unknown
+
+ $ touch a
+ $ hg add a
+ $ hg ci -m "1"
+
+ $ touch b
+ $ hg add b
+ $ hg ci -m "2"
+
+Should show unknown
+
+ $ hg status
+ ? unknown
+ $ hg revert -r 0 --all
+ removing b
+
+Should show unknown and b removed
+
+ $ hg status
+ R b
+ ? unknown
+
+Should show a and unknown
+
+ $ ls
+ a
+ unknown
--- a/tests/test-revert.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-%% should show b unknown
-? b
-%% should show b unknown and c modified
-M c
-? b
-%% should show b added and c modified
-M c
-A b
-%% should show a removed, b added and c modified
-M c
-A b
-R a
-%% should show b added, copy saved, and c modified
-M c
-A b
-%% should show b unknown, and c modified
-M c
-? b
-%% should show unknown: b
-? b
-%% should show b added
-A b
-%% should show b deleted
-! b
-forgetting b
-%% should not find b
-b: No such file or directory
-%% should show a c e
-a
-c
-e
-%% should verbosely save backup to e.orig
-saving current version of e as e.orig
-reverting e
-%% should say no changes needed
-no changes needed to a
-%% should say file not managed
-file not managed: q
-%% should say file not found
-notfound: No such file in rev 095eacd0c0d7
-A z
-? e.orig
-%% should add a, remove d, forget z
-adding a
-removing d
-forgetting z
-%% should forget a, undelete d
-forgetting a
-undeleting d
-%% should silently add a
-A a
-R d
-%% should silently keep d removed
-R d
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-reverting c
-%% should print non-executable
-non-executable
-reverting c
-%% should print executable
-executable
-%% issue 241
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail - no arguments
-abort: no files or directories specified; use --all to revert the whole repo
-% should succeed
-reverting a
-%% issue332
-adding b/b
-created new head
-reverting b/b
-forgetting newdir/newfile
-reverting b/b
-% reverting a rename target should revert the source
-? newa
-%% 4 ignored files (we will add/commit everything)
-I ignored
-I ignoreddir/file
-I ignoreddir/removed
-I removed
-%% should revert ignored* and undelete *removed
-reverting ignored
-reverting ignoreddir/file
-undeleting ignoreddir/removed
-undeleting removed
-%% should silently revert the named files
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revert.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,263 @@
+ $ hg init repo
+ $ cd repo
+ $ echo 123 > a
+ $ echo 123 > c
+ $ echo 123 > e
+ $ hg add a c e
+ $ hg commit -m "first" a c e
+ $ echo 123 > b
+
+should show b unknown
+
+ $ hg status
+ ? b
+ $ echo 12 > c
+
+should show b unknown and c modified
+
+ $ hg status
+ M c
+ ? b
+ $ hg add b
+
+should show b added and c modified
+
+ $ hg status
+ M c
+ A b
+ $ hg rm a
+
+should show a removed, b added and c modified
+
+ $ hg status
+ M c
+ A b
+ R a
+ $ hg revert a
+
+should show b added, copy saved, and c modified
+
+ $ hg status
+ M c
+ A b
+ $ hg revert b
+
+should show b unknown, and c modified
+
+ $ hg status
+ M c
+ ? b
+ $ hg revert --no-backup c
+
+should show unknown: b
+
+ $ hg status
+ ? b
+ $ hg add b
+
+should show b added
+
+ $ hg status b
+ A b
+ $ rm b
+
+should show b deleted
+
+ $ hg status b
+ ! b
+ $ hg revert -v b
+ forgetting b
+
+should not find b
+
+ $ hg status b
+ b: No such file or directory
+
+should show a c e
+
+ $ ls
+ a
+ c
+ e
+
+should verbosely save backup to e.orig
+
+ $ echo z > e
+ $ hg revert --all -v
+ saving current version of e as e.orig
+ reverting e
+
+should say no changes needed
+
+ $ hg revert a
+ no changes needed to a
+
+should say file not managed
+
+ $ echo q > q
+ $ hg revert q
+ file not managed: q
+ $ rm q
+
+should say file not found
+
+ $ hg revert notfound
+ notfound: no such file in rev 334a9e57682c
+ $ touch d
+ $ hg add d
+ $ hg rm a
+ $ hg commit -m "second"
+ $ echo z > z
+ $ hg add z
+ $ hg st
+ A z
+ ? e.orig
+
+should add a, remove d, forget z
+
+ $ hg revert --all -r0
+ adding a
+ removing d
+ forgetting z
+
+should forget a, undelete d
+
+ $ hg revert --all -rtip
+ forgetting a
+ undeleting d
+ $ rm a *.orig
+
+should silently add a
+
+ $ hg revert -r0 a
+ $ hg st a
+ A a
+ $ hg rm d
+ $ hg st d
+ R d
+
+should silently keep d removed
+
+ $ hg revert -r0 d
+ $ hg st d
+ R d
+
+ $ hg update -C
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ chmod +x c
+ $ hg revert --all
+ reverting c
+
+should print non-executable
+
+ $ test -x c || echo non-executable
+ non-executable
+
+ $ chmod +x c
+ $ hg commit -m exe
+
+ $ chmod -x c
+ $ hg revert --all
+ reverting c
+
+should print executable
+
+ $ test -x c && echo executable
+ executable
+
+ $ cd ..
+
+
+issue 241
+
+ $ hg init a
+ $ cd a
+ $ echo a >> a
+ $ hg commit -A -d '1 0' -m a
+ adding a
+ $ echo a >> a
+ $ hg commit -d '2 0' -m a
+ $ hg update 0
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ mkdir b
+ $ echo b > b/b
+
+should fail - no arguments
+
+ $ hg revert -rtip
+ abort: no files or directories specified; use --all to revert the whole repo
+
+should succeed
+
+ $ hg revert --all -rtip
+ reverting a
+
+
+issue332
+
+ $ hg ci -A -m b
+ adding b/b
+ created new head
+ $ echo foobar > b/b
+ $ mkdir newdir
+ $ echo foo > newdir/newfile
+ $ hg add newdir/newfile
+ $ hg revert b newdir
+ reverting b/b
+ forgetting newdir/newfile
+ $ echo foobar > b/b
+ $ hg revert .
+ reverting b/b
+
+
+reverting a rename target should revert the source
+
+ $ hg mv a newa
+ $ hg revert newa
+ $ hg st a newa
+ ? newa
+
+ $ cd ..
+
+ $ hg init ignored
+ $ cd ignored
+ $ echo '^ignored$' > .hgignore
+ $ echo '^ignoreddir$' >> .hgignore
+ $ echo '^removed$' >> .hgignore
+
+ $ mkdir ignoreddir
+ $ touch ignoreddir/file
+ $ touch ignoreddir/removed
+ $ touch ignored
+ $ touch removed
+
+4 ignored files (we will add/commit everything)
+
+ $ hg st -A -X .hgignore
+ I ignored
+ I ignoreddir/file
+ I ignoreddir/removed
+ I removed
+ $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
+
+ $ echo >> ignored
+ $ echo >> ignoreddir/file
+ $ hg rm removed ignoreddir/removed
+
+should revert ignored* and undelete *removed
+
+ $ hg revert -a --no-backup
+ reverting ignored
+ reverting ignoreddir/file
+ undeleting ignoreddir/removed
+ undeleting removed
+ $ hg st -mardi
+
+ $ hg up -qC
+ $ echo >> ignored
+ $ hg rm removed
+
+should silently revert the named files
+
+ $ hg revert --no-backup ignored removed
+ $ hg st -mardi
--- a/tests/test-revset Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-#!/bin/sh
-
-HGENCODING=utf-8
-export HGENCODING
-
-try() {
- echo '% hg debugrevspec' $@
- hg debugrevspec --debug $@
-}
-
-log() {
- echo "% log '$1'"
- hg log --template '{rev}\n' -r "$1"
-}
-
-hg init repo
-cd repo
-
-echo a > a
-hg branch a
-hg ci -Aqm0
-
-echo b > b
-hg branch b
-hg ci -Aqm1
-
-rm a
-hg branch a-b-c-
-hg ci -Aqm2 -u Bob
-
-hg co 1
-hg branch +a+b+c+
-hg ci -Aqm3
-
-hg co 2 # interleave
-echo bb > b
-hg branch -- -a-b-c-
-hg ci -Aqm4 -d "May 12 2005"
-
-hg co 3
-hg branch /a/b/c/
-hg ci -Aqm"5 bug"
-
-hg merge 4
-hg branch _a_b_c_
-hg ci -Aqm"6 issue619"
-
-hg branch .a.b.c.
-hg ci -Aqm7
-
-hg branch all
-hg ci --close-branch -Aqm8
-
-hg co 4
-hg branch é
-hg ci -Aqm9
-
-hg tag -r6 1.0
-
-hg clone --quiet -U -r 7 . ../remote1
-hg clone --quiet -U -r 8 . ../remote2
-echo "[paths]" >> .hg/hgrc
-echo "default = ../remote1" >> .hg/hgrc
-
-# names that should work without quoting
-try a
-try b-a
-try _a_b_c_
-try _a_b_c_-a
-try .a.b.c.
-try .a.b.c.-a
-try -- '-a-b-c-' # complains
-log -a-b-c- # succeeds with fallback
-try -- -a-b-c--a # complains
-try é
-
-# quoting needed
-try '"-a-b-c-"-a'
-
-log '1 or 2'
-log '1|2'
-log '1 and 2'
-log '1&2'
-try '1&2|3' # precedence - and is higher
-try '1|2&3'
-try '1&2&3' # associativity
-try '1|(2|3)'
-log '1.0' # tag
-log 'a' # branch
-log '2785f51ee'
-log 'date(2005)'
-log 'date(this is a test)'
-log 'date()'
-log 'date'
-log 'date('
-log 'date(tip)'
-log '"date"'
-log 'date(2005) and 1::'
-
-log 'ancestor(1)'
-log 'ancestor(4,5)'
-log 'ancestor(4,5) and 4'
-log 'ancestors(5)'
-log 'author(bob)'
-log 'branch(é)'
-log 'children(ancestor(4,5))'
-log 'closed()'
-log 'contains(a)'
-log 'descendants(2 or 3)'
-log 'file(b)'
-log 'follow()'
-log 'grep("issue\d+")'
-log 'head()'
-log 'heads(6::)'
-log 'keyword(issue)'
-log 'limit(head(), 1)'
-log 'max(contains(a))'
-log 'min(contains(a))'
-log 'merge()'
-log 'modifies(b)'
-log 'outgoing()'
-log 'outgoing("../remote1")'
-log 'outgoing("../remote2")'
-log 'p1(merge())'
-log 'p2(merge())'
-log 'parents(merge())'
-log 'removes(a)'
-log 'roots(all())'
-log 'reverse(2 or 3 or 4 or 5)'
-log 'sort(limit(reverse(all()), 3))'
-log 'sort(2 or 3 or 4 or 5, date)'
-log 'tagged()'
-log 'user(bob)'
-
-log '4::8'
-log '4:8'
-
-log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
-
-log 'not 0 and 0:2'
-log 'not 1 and 0:2'
-log 'not 2 and 0:2'
-log '(1 and 2)::'
-log '(1 and 2):'
-log '(1 and 2):3'
-log 'sort(head(), -rev)'
--- a/tests/test-revset.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,237 +0,0 @@
-marked working directory as branch a
-marked working directory as branch b
-marked working directory as branch a-b-c-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch +a+b+c+
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch -a-b-c-
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch /a/b/c/
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-marked working directory as branch _a_b_c_
-marked working directory as branch .a.b.c.
-marked working directory as branch all
-abort: can only close branch heads
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch é
-% hg debugrevspec a
-('symbol', 'a')
-0
-% hg debugrevspec b-a
-('minus', ('symbol', 'b'), ('symbol', 'a'))
-1
-% hg debugrevspec _a_b_c_
-('symbol', '_a_b_c_')
-6
-% hg debugrevspec _a_b_c_-a
-('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
-6
-% hg debugrevspec .a.b.c.
-('symbol', '.a.b.c.')
-7
-% hg debugrevspec .a.b.c.-a
-('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
-7
-% hg debugrevspec -- -a-b-c-
-hg: parse error at 7: not a prefix: end
-% log '-a-b-c-'
-4
-% hg debugrevspec -- -a-b-c--a
-('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
-abort: unknown revision '-a'!
-% hg debugrevspec é
-('symbol', '\xc3\xa9')
-9
-% hg debugrevspec "-a-b-c-"-a
-('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
-4
-% log '1 or 2'
-1
-2
-% log '1|2'
-1
-2
-% log '1 and 2'
-% log '1&2'
-% hg debugrevspec 1&2|3
-('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
-3
-% hg debugrevspec 1|2&3
-('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
-1
-% hg debugrevspec 1&2&3
-('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
-% hg debugrevspec 1|(2|3)
-('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
-1
-2
-3
-% log '1.0'
-6
-% log 'a'
-0
-% log '2785f51ee'
-0
-% log 'date(2005)'
-4
-% log 'date(this is a test)'
-hg: parse error at 10: unexpected token: symbol
-% log 'date()'
-hg: parse error: date wants a string
-% log 'date'
-hg: parse error: can't use date here
-% log 'date('
-hg: parse error at 5: not a prefix: end
-% log 'date(tip)'
-abort: invalid date: 'tip'
-% log '"date"'
-abort: unknown revision 'date'!
-% log 'date(2005) and 1::'
-4
-% log 'ancestor(1)'
-hg: parse error: ancestor wants two arguments
-% log 'ancestor(4,5)'
-1
-% log 'ancestor(4,5) and 4'
-% log 'ancestors(5)'
-0
-1
-3
-5
-% log 'author(bob)'
-2
-% log 'branch(é)'
-8
-9
-% log 'children(ancestor(4,5))'
-2
-3
-% log 'closed()'
-% log 'contains(a)'
-0
-1
-3
-5
-% log 'descendants(2 or 3)'
-2
-3
-4
-5
-6
-7
-8
-9
-% log 'file(b)'
-1
-4
-% log 'follow()'
-0
-1
-2
-4
-8
-9
-% log 'grep("issue\d+")'
-6
-% log 'head()'
-0
-1
-2
-3
-4
-5
-6
-7
-9
-% log 'heads(6::)'
-7
-% log 'keyword(issue)'
-6
-% log 'limit(head(), 1)'
-0
-% log 'max(contains(a))'
-5
-% log 'min(contains(a))'
-0
-% log 'merge()'
-6
-% log 'modifies(b)'
-4
-% log 'outgoing()'
-8
-9
-% log 'outgoing("../remote1")'
-8
-9
-% log 'outgoing("../remote2")'
-3
-5
-6
-7
-9
-% log 'p1(merge())'
-5
-% log 'p2(merge())'
-4
-% log 'parents(merge())'
-4
-5
-% log 'removes(a)'
-2
-6
-% log 'roots(all())'
-0
-% log 'reverse(2 or 3 or 4 or 5)'
-5
-4
-3
-2
-% log 'sort(limit(reverse(all()), 3))'
-7
-8
-9
-% log 'sort(2 or 3 or 4 or 5, date)'
-2
-3
-5
-4
-% log 'tagged()'
-6
-% log 'user(bob)'
-2
-% log '4::8'
-4
-8
-% log '4:8'
-4
-5
-6
-7
-8
-% log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
-4
-2
-5
-% log 'not 0 and 0:2'
-1
-2
-% log 'not 1 and 0:2'
-0
-2
-% log 'not 2 and 0:2'
-0
-1
-% log '(1 and 2)::'
-% log '(1 and 2):'
-% log '(1 and 2):3'
-% log 'sort(head(), -rev)'
-9
-7
-6
-5
-4
-3
-2
-1
-0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revset.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,307 @@
+ $ HGENCODING=utf-8
+ $ export HGENCODING
+
+ $ try() {
+ > hg debugrevspec --debug $@
+ > }
+
+ $ log() {
+ > hg log --template '{rev}\n' -r "$1"
+ > }
+
+ $ hg init repo
+ $ cd repo
+
+ $ echo a > a
+ $ hg branch a
+ marked working directory as branch a
+ $ hg ci -Aqm0
+
+ $ echo b > b
+ $ hg branch b
+ marked working directory as branch b
+ $ hg ci -Aqm1
+
+ $ rm a
+ $ hg branch a-b-c-
+ marked working directory as branch a-b-c-
+ $ hg ci -Aqm2 -u Bob
+
+ $ hg co 1
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg branch +a+b+c+
+ marked working directory as branch +a+b+c+
+ $ hg ci -Aqm3
+
+ $ hg co 2 # interleave
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ echo bb > b
+ $ hg branch -- -a-b-c-
+ marked working directory as branch -a-b-c-
+ $ hg ci -Aqm4 -d "May 12 2005"
+
+ $ hg co 3
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg branch /a/b/c/
+ marked working directory as branch /a/b/c/
+ $ hg ci -Aqm"5 bug"
+
+ $ hg merge 4
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg branch _a_b_c_
+ marked working directory as branch _a_b_c_
+ $ hg ci -Aqm"6 issue619"
+
+ $ hg branch .a.b.c.
+ marked working directory as branch .a.b.c.
+ $ hg ci -Aqm7
+
+ $ hg branch all
+ marked working directory as branch all
+ $ hg ci --close-branch -Aqm8
+ abort: can only close branch heads
+
+ $ hg co 4
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg branch é
+ marked working directory as branch é
+ $ hg ci -Aqm9
+
+ $ hg tag -r6 1.0
+
+ $ hg clone --quiet -U -r 7 . ../remote1
+ $ hg clone --quiet -U -r 8 . ../remote2
+ $ echo "[paths]" >> .hg/hgrc
+ $ echo "default = ../remote1" >> .hg/hgrc
+
+names that should work without quoting
+
+ $ try a
+ ('symbol', 'a')
+ 0
+ $ try b-a
+ ('minus', ('symbol', 'b'), ('symbol', 'a'))
+ 1
+ $ try _a_b_c_
+ ('symbol', '_a_b_c_')
+ 6
+ $ try _a_b_c_-a
+ ('minus', ('symbol', '_a_b_c_'), ('symbol', 'a'))
+ 6
+ $ try .a.b.c.
+ ('symbol', '.a.b.c.')
+ 7
+ $ try .a.b.c.-a
+ ('minus', ('symbol', '.a.b.c.'), ('symbol', 'a'))
+ 7
+ $ try -- '-a-b-c-' # complains
+ hg: parse error at 7: not a prefix: end
+ $ log -a-b-c- # succeeds with fallback
+ 4
+ $ try -- -a-b-c--a # complains
+ ('minus', ('minus', ('minus', ('negate', ('symbol', 'a')), ('symbol', 'b')), ('symbol', 'c')), ('negate', ('symbol', 'a')))
+ abort: unknown revision '-a'!
+ $ try é
+ ('symbol', '\xc3\xa9')
+ 9
+
+quoting needed
+
+ $ try '"-a-b-c-"-a'
+ ('minus', ('string', '-a-b-c-'), ('symbol', 'a'))
+ 4
+
+ $ log '1 or 2'
+ 1
+ 2
+ $ log '1|2'
+ 1
+ 2
+ $ log '1 and 2'
+ $ log '1&2'
+ $ try '1&2|3' # precedence - and is higher
+ ('or', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
+ 3
+ $ try '1|2&3'
+ ('or', ('symbol', '1'), ('and', ('symbol', '2'), ('symbol', '3')))
+ 1
+ $ try '1&2&3' # associativity
+ ('and', ('and', ('symbol', '1'), ('symbol', '2')), ('symbol', '3'))
+ $ try '1|(2|3)'
+ ('or', ('symbol', '1'), ('group', ('or', ('symbol', '2'), ('symbol', '3'))))
+ 1
+ 2
+ 3
+ $ log '1.0' # tag
+ 6
+ $ log 'a' # branch
+ 0
+ $ log '2785f51ee'
+ 0
+ $ log 'date(2005)'
+ 4
+ $ log 'date(this is a test)'
+ hg: parse error at 10: unexpected token: symbol
+ $ log 'date()'
+ hg: parse error: date wants a string
+ $ log 'date'
+ hg: parse error: can't use date here
+ $ log 'date('
+ hg: parse error at 5: not a prefix: end
+ $ log 'date(tip)'
+ abort: invalid date: 'tip'
+ $ log '"date"'
+ abort: unknown revision 'date'!
+ $ log 'date(2005) and 1::'
+ 4
+
+ $ log 'ancestor(1)'
+ hg: parse error: ancestor wants two arguments
+ $ log 'ancestor(4,5)'
+ 1
+ $ log 'ancestor(4,5) and 4'
+ $ log 'ancestors(5)'
+ 0
+ 1
+ 3
+ 5
+ $ log 'author(bob)'
+ 2
+ $ log 'branch(é)'
+ 8
+ 9
+ $ log 'children(ancestor(4,5))'
+ 2
+ 3
+ $ log 'closed()'
+ $ log 'contains(a)'
+ 0
+ 1
+ 3
+ 5
+ $ log 'descendants(2 or 3)'
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ $ log 'file(b)'
+ 1
+ 4
+ $ log 'follow()'
+ 0
+ 1
+ 2
+ 4
+ 8
+ 9
+ $ log 'grep("issue\d+")'
+ 6
+ $ log 'head()'
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 9
+ $ log 'heads(6::)'
+ 7
+ $ log 'keyword(issue)'
+ 6
+ $ log 'limit(head(), 1)'
+ 0
+ $ log 'max(contains(a))'
+ 5
+ $ log 'min(contains(a))'
+ 0
+ $ log 'merge()'
+ 6
+ $ log 'modifies(b)'
+ 4
+ $ log 'outgoing()'
+ 8
+ 9
+ $ log 'outgoing("../remote1")'
+ 8
+ 9
+ $ log 'outgoing("../remote2")'
+ 3
+ 5
+ 6
+ 7
+ 9
+ $ log 'p1(merge())'
+ 5
+ $ log 'p2(merge())'
+ 4
+ $ log 'parents(merge())'
+ 4
+ 5
+ $ log 'removes(a)'
+ 2
+ 6
+ $ log 'roots(all())'
+ 0
+ $ log 'reverse(2 or 3 or 4 or 5)'
+ 5
+ 4
+ 3
+ 2
+ $ log 'sort(limit(reverse(all()), 3))'
+ 7
+ 8
+ 9
+ $ log 'sort(2 or 3 or 4 or 5, date)'
+ 2
+ 3
+ 5
+ 4
+ $ log 'tagged()'
+ 6
+ $ log 'user(bob)'
+ 2
+
+ $ log '4::8'
+ 4
+ 8
+ $ log '4:8'
+ 4
+ 5
+ 6
+ 7
+ 8
+
+ $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
+ 4
+ 2
+ 5
+
+ $ log 'not 0 and 0:2'
+ 1
+ 2
+ $ log 'not 1 and 0:2'
+ 0
+ 2
+ $ log 'not 2 and 0:2'
+ 0
+ 1
+ $ log '(1 and 2)::'
+ $ log '(1 and 2):'
+ $ log '(1 and 2):3'
+ $ log 'sort(head(), -rev)'
+ 9
+ 7
+ 6
+ 5
+ 4
+ 3
+ 2
+ 1
+ 0
--- a/tests/test-rollback Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-rollback Sat Sep 11 00:40:19 2010 +0200
@@ -5,7 +5,7 @@
hg init
echo a > a
hg add a
-hg commit -m "test" -d "1000000 0"
+hg commit -m "test"
hg verify
hg parents
hg status
--- a/tests/test-rollback.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-rollback.out Sat Sep 11 00:40:19 2010 +0200
@@ -3,10 +3,10 @@
crosschecking files in changesets and manifests
checking files
1 files, 1 changesets, 1 total revisions
-changeset: 0:0acdaf898367
+changeset: 0:acb14030fe0a
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: test
rolling back to revision -1 (undo commit)
--- a/tests/test-serve Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-serve Sat Sep 11 00:40:19 2010 +0200
@@ -10,7 +10,11 @@
echo % errors
cat errors.log
sleep 1
- kill `cat hg.pid`
+ if [ "$KILLQUIETLY" = "Y" ]; then
+ kill `cat hg.pid` 2>/dev/null
+ else
+ kill `cat hg.pid`
+ fi
sleep 1
}
@@ -36,6 +40,9 @@
echo % With -v and -p HGPORT2
hgserve -p "$HGPORT2"
+echo '% With -v and -p http (should fail)'
+KILLQUIETLY=Y hgserve -p http; KILLQUIETLY=N
+
echo % With --prefix foo
hgserve --prefix foo
--- a/tests/test-serve.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-serve.out Sat Sep 11 00:40:19 2010 +0200
@@ -7,6 +7,10 @@
% With -v and -p HGPORT2
listening at http://localhost/ (bound to 127.0.0.1:HGPORT2)
% errors
+% With -v and -p http (should fail)
+abort: cannot start server at 'localhost:80': Permission denied
+abort: child process failed to start
+% errors
% With --prefix foo
listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
% errors
--- a/tests/test-ssh Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-ssh Sat Sep 11 00:40:19 2010 +0200
@@ -37,7 +37,7 @@
cd remote
echo this > foo
echo this > fooO
-hg ci -A -m "init" -d "1000000 0" foo fooO
+hg ci -A -m "init" foo fooO
echo '[server]' > .hg/hgrc
echo 'uncompressed = True' >> .hg/hgrc
echo '[hooks]' >> .hg/hgrc
@@ -71,7 +71,7 @@
echo "# local change"
echo bleah > foo
-hg ci -m "add" -d "1000000 0"
+hg ci -m "add"
echo "# updating rc"
echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
@@ -95,13 +95,13 @@
hg cat -r tip foo
echo z > z
-hg ci -A -m z -d '1000001 0' z
+hg ci -A -m z z
# a bad, evil hook that prints to stdout
echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc
cd ../local
echo r > r
-hg ci -A -m z -d '1000002 0' r
+hg ci -A -m z r
echo "# push should succeed even though it has an unexpected response"
hg push
--- a/tests/test-ssh.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-ssh.out Sat Sep 11 00:40:19 2010 +0200
@@ -37,19 +37,19 @@
# find outgoing
comparing with ssh://user@dummy/remote
searching for changes
-changeset: 1:572896fe480d
+changeset: 1:a28a9d1a809c
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: add
# find incoming on the remote side
comparing with ssh://user@dummy/local
searching for changes
-changeset: 1:572896fe480d
+changeset: 1:a28a9d1a809c
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: add
# push
@@ -60,10 +60,10 @@
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
# check remote tip
-changeset: 1:572896fe480d
+changeset: 1:a28a9d1a809c
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: add
checking changesets
@@ -82,17 +82,17 @@
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
remote: KABOOM
-changeset: 3:ac7448082955
+changeset: 3:1383141674ec
tag: tip
-parent: 1:572896fe480d
+parent: 1:a28a9d1a809c
user: test
-date: Mon Jan 12 13:46:42 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: z
-changeset: 2:187c6caa0d1e
-parent: 0:e34318c26897
+changeset: 2:6c0482d977a3
+parent: 0:1160648e36ce
user: test
-date: Mon Jan 12 13:46:41 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: z
Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
@@ -102,6 +102,6 @@
Got arguments 1:user@dummy 2:hg -R remote serve --stdio
Got arguments 1:user@dummy 2:hg -R local serve --stdio
Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-changegroup-in-remote hook: HG_NODE=572896fe480d7581849806ee402175c49cb20037 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
+changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-changegroup-in-remote hook: HG_NODE=ac7448082955a0b2ff5cb4512c1e061c779bbc79 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
+changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
--- a/tests/test-static-http Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-static-http Sat Sep 11 00:40:19 2010 +0200
@@ -29,7 +29,7 @@
hg init
echo foo > bar
hg add bar
-hg commit -m"test" -d "1000000 0"
+hg commit -m"test"
hg tip
cd ..
@@ -42,7 +42,7 @@
cd ../remote
echo baz > quux
-hg commit -A -mtest2 -d '100000000 0'
+hg commit -A -mtest2
# check for HTTP opener failures when cachefile does not exist
rm .hg/*.cache
@@ -54,7 +54,7 @@
echo '% trying to push'
hg update
echo more foo >> bar
-hg commit -m"test" -d "100000000 0"
+hg commit -m"test"
hg push | sed -e "s,:$HGPORT/,:\$HGPORT/,"
echo '% trying clone -r'
--- a/tests/test-static-http.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-static-http.out Sat Sep 11 00:40:19 2010 +0200
@@ -1,10 +1,10 @@
abort: error: Connection refused
255
copy: No such file or directory
-changeset: 0:53e17d176ae6
+changeset: 0:61c9426e69fe
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: test
requesting all changes
@@ -21,7 +21,7 @@
1 files, 1 changesets, 1 total revisions
foo
adding quux
-changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
+changegroup hook: HG_NODE=822d6e31f08b9d6e3b898ce5e52efc0a4bf4905a HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
pulling from static-http://localhost:$HGPORT/remote
searching for changes
adding changesets
--- a/tests/test-status-color.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-status-color.t Sat Sep 11 00:40:19 2010 +0200
@@ -111,7 +111,7 @@
$ cd repo2
$ touch modified removed deleted ignored
$ echo "^ignored$" > .hgignore
- $ hg ci -A -m 'initial checkin' -d "1000000 0"
+ $ hg ci -A -m 'initial checkin'
adding .hgignore
adding deleted
adding modified
--- a/tests/test-status.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-status.t Sat Sep 11 00:40:19 2010 +0200
@@ -106,7 +106,7 @@
$ cd repo2
$ touch modified removed deleted ignored
$ echo "^ignored$" > .hgignore
- $ hg ci -A -m 'initial checkin' -d "1000000 0"
+ $ hg ci -A -m 'initial checkin'
adding .hgignore
adding deleted
adding modified
@@ -231,7 +231,7 @@
$ hg init repo4
$ cd repo4
$ touch modified removed deleted
- $ hg ci -q -A -m 'initial checkin' -d "1000000 0"
+ $ hg ci -q -A -m 'initial checkin'
$ touch added unknown
$ hg add added
$ hg remove removed
--- a/tests/test-strict Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-hg init
-
-echo a > a
-hg ci -Ama
-
-hg an a
-
-echo "[ui]" >> $HGRCPATH
-echo "strict=True" >> $HGRCPATH
-
-hg an a
-hg annotate a
-
-echo % should succeed - up is an alias, not an abbreviation
-
-hg up
--- a/tests/test-strict.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-adding a
-0: a
-hg: unknown command 'an'
-Mercurial Distributed SCM
-
-basic commands:
-
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
-
-use "hg help" for the full list of commands or "hg -v" for details
-0: a
-% should succeed - up is an alias, not an abbreviation
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-strict.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,44 @@
+ $ hg init
+
+ $ echo a > a
+ $ hg ci -Ama
+ adding a
+
+ $ hg an a
+ 0: a
+
+ $ echo "[ui]" >> $HGRCPATH
+ $ echo "strict=True" >> $HGRCPATH
+
+ $ hg an a
+ hg: unknown command 'an'
+ Mercurial Distributed SCM
+
+ basic commands:
+
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
+
+ use "hg help" for the full list of commands or "hg -v" for details
+ $ hg annotate a
+ 0: a
+
+should succeed - up is an alias, not an abbreviation
+
+ $ hg up
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-subrepo-deep-nested-change.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-subrepo-deep-nested-change.t Sat Sep 11 00:40:19 2010 +0200
@@ -11,7 +11,7 @@
$ hg init sub1
$ echo sub1 > sub1/sub1
$ echo "sub2 = ../sub2" > sub1/.hgsub
- $ hg clone sub2 sub1/sub2 | sed 's/ .*sub/ ...sub/g'
+ $ hg clone sub2 sub1/sub2
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg add -R sub1
@@ -25,9 +25,9 @@
$ hg init main
$ echo main > main/main
$ echo "sub1 = ../sub1" > main/.hgsub
- $ hg clone sub1 main/sub1 | sed 's/ .*sub/ ...sub/g'
+ $ hg clone sub1 main/sub1
updating to branch default
- pulling ...sub2
+ pulling subrepo sub2 from .*/sub2
requesting all changes
adding changesets
adding manifests
@@ -53,15 +53,15 @@
Clone main
- $ hg clone main cloned | sed 's/ .*sub/ ...sub/g'
+ $ hg clone main cloned
updating to branch default
- pulling ...sub1
+ pulling subrepo sub1 from .*/sub1
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 3 changes to 3 files
- pulling ...sub2
+ pulling subrepo sub1/sub2 from .*/sub2
requesting all changes
adding changesets
adding manifests
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-subrepo-recursion.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,222 @@
+Make status look into subrepositories by default:
+
+ $ echo '[defaults]' >> $HGRCPATH
+ $ echo 'status = -S' >> $HGRCPATH
+ $ echo 'diff = --nodates -S' >> $HGRCPATH
+
+Create test repository:
+
+ $ hg init
+ $ echo x1 > x.txt
+ $ hg add x.txt
+
+ $ hg init foo
+ $ cd foo
+ $ echo y1 > y.txt
+ $ hg add y.txt
+
+ $ hg init bar
+ $ cd bar
+ $ echo z1 > z.txt
+ $ hg add z.txt
+
+ $ cd ..
+ $ echo 'bar = bar' > .hgsub
+ $ hg add .hgsub
+
+ $ cd ..
+ $ echo 'foo = foo' > .hgsub
+ $ hg add .hgsub
+
+Test recursive status without committing anything:
+
+ $ hg status
+ A .hgsub
+ A foo/.hgsub
+ A foo/bar/z.txt
+ A foo/y.txt
+ A x.txt
+
+Test recursive diff without committing anything:
+
+ $ hg diff foo
+ diff -r 000000000000 foo/.hgsub
+ --- /dev/null
+ +++ b/foo/.hgsub
+ @@ -0,0 +1,1 @@
+ +bar = bar
+ diff -r 000000000000 foo/y.txt
+ --- /dev/null
+ +++ b/foo/y.txt
+ @@ -0,0 +1,1 @@
+ +y1
+ diff -r 000000000000 foo/bar/z.txt
+ --- /dev/null
+ +++ b/foo/bar/z.txt
+ @@ -0,0 +1,1 @@
+ +z1
+
+Commits:
+
+ $ hg commit -m 0-0-0
+ committing subrepository foo
+ committing subrepository foo/bar
+
+ $ cd foo
+ $ echo y2 >> y.txt
+ $ hg commit -m 0-1-0
+
+ $ cd bar
+ $ echo z2 >> z.txt
+ $ hg commit -m 0-1-1
+
+ $ cd ..
+ $ hg commit -m 0-2-1
+ committing subrepository bar
+
+ $ cd ..
+ $ hg commit -m 1-2-1
+ committing subrepository foo
+
+Change working directory:
+
+ $ echo y3 >> foo/y.txt
+ $ echo z3 >> foo/bar/z.txt
+ $ hg status
+ M foo/bar/z.txt
+ M foo/y.txt
+ $ hg diff
+ diff -r d254738c5f5e foo/y.txt
+ --- a/foo/y.txt
+ +++ b/foo/y.txt
+ @@ -1,2 +1,3 @@
+ y1
+ y2
+ +y3
+ diff -r 9647f22de499 foo/bar/z.txt
+ --- a/foo/bar/z.txt
+ +++ b/foo/bar/z.txt
+ @@ -1,2 +1,3 @@
+ z1
+ z2
+ +z3
+
+Status call crossing repository boundaries:
+
+ $ hg status foo/bar/z.txt
+ M foo/bar/z.txt
+ $ hg status -I 'foo/?.txt'
+ M foo/y.txt
+ $ hg status -I '**/?.txt'
+ M foo/bar/z.txt
+ M foo/y.txt
+ $ hg diff -I '**/?.txt'
+ diff -r d254738c5f5e foo/y.txt
+ --- a/foo/y.txt
+ +++ b/foo/y.txt
+ @@ -1,2 +1,3 @@
+ y1
+ y2
+ +y3
+ diff -r 9647f22de499 foo/bar/z.txt
+ --- a/foo/bar/z.txt
+ +++ b/foo/bar/z.txt
+ @@ -1,2 +1,3 @@
+ z1
+ z2
+ +z3
+
+Status from within a subdirectory:
+
+ $ mkdir dir
+ $ cd dir
+ $ echo a1 > a.txt
+ $ hg status
+ M foo/bar/z.txt
+ M foo/y.txt
+ ? dir/a.txt
+ $ hg diff
+ diff -r d254738c5f5e foo/y.txt
+ --- a/foo/y.txt
+ +++ b/foo/y.txt
+ @@ -1,2 +1,3 @@
+ y1
+ y2
+ +y3
+ diff -r 9647f22de499 foo/bar/z.txt
+ --- a/foo/bar/z.txt
+ +++ b/foo/bar/z.txt
+ @@ -1,2 +1,3 @@
+ z1
+ z2
+ +z3
+
+Status with relative path:
+
+ $ hg status ..
+ M ../foo/bar/z.txt
+ M ../foo/y.txt
+ ? a.txt
+ $ hg diff ..
+ diff -r d254738c5f5e foo/y.txt
+ --- a/foo/y.txt
+ +++ b/foo/y.txt
+ @@ -1,2 +1,3 @@
+ y1
+ y2
+ +y3
+ diff -r 9647f22de499 foo/bar/z.txt
+ --- a/foo/bar/z.txt
+ +++ b/foo/bar/z.txt
+ @@ -1,2 +1,3 @@
+ z1
+ z2
+ +z3
+ $ cd ..
+
+Cleanup and final commit:
+
+ $ rm -r dir
+ $ hg commit -m 2-3-2
+ committing subrepository foo
+ committing subrepository foo/bar
+
+Log with the relationships between repo and its subrepo:
+
+ $ hg log --template '{rev}:{node|short} {desc}\n'
+ 2:1326fa26d0c0 2-3-2
+ 1:4b3c9ff4f66b 1-2-1
+ 0:23376cbba0d8 0-0-0
+
+ $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
+ 3:65903cebad86 2-3-2
+ 2:d254738c5f5e 0-2-1
+ 1:8629ce7dcc39 0-1-0
+ 0:af048e97ade2 0-0-0
+
+ $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
+ 2:31ecbdafd357 2-3-2
+ 1:9647f22de499 0-1-1
+ 0:4904098473f9 0-0-0
+
+Status between revisions:
+
+ $ hg status
+ $ hg status --rev 0:1
+ M .hgsubstate
+ M foo/.hgsubstate
+ M foo/bar/z.txt
+ M foo/y.txt
+ $ hg diff -I '**/?.txt' --rev 0:1
+ diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
+ --- a/foo/y.txt
+ +++ b/foo/y.txt
+ @@ -1,1 +1,2 @@
+ y1
+ +y2
+ diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
+ --- a/foo/bar/z.txt
+ +++ b/foo/bar/z.txt
+ @@ -1,1 +1,2 @@
+ z1
+ +z2
--- a/tests/test-subrepo-svn.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-subrepo-svn.t Sat Sep 11 00:40:19 2010 +0200
@@ -153,6 +153,17 @@
$ hg ci -m 'amend externals from hg'
committing subrepository s
abort: cannot commit svn externals
+ $ hg diff --subrepos -r 1:2 | grep -v diff
+ --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
+ +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +1,1 @@
+ -2 s
+ +3 s
+ --- a/a Thu Jan 01 00:00:00 1970 +0000
+ +++ b/a Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +1,2 @@
+ a
+ +a
$ svn revert -q s/externals/other
this commit fails because of externals meta changes
--- a/tests/test-subrepo.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-subrepo.t Sat Sep 11 00:40:19 2010 +0200
@@ -499,8 +499,8 @@
$ hg -R testdelete add
adding testdelete/.hgsub
$ hg -R testdelete ci -m "nested 1 & 2 added"
+ committing subrepository nested
committing subrepository nested2
- committing subrepository nested
$ echo nested = nested > testdelete/.hgsub
$ hg -R testdelete ci -m "nested 2 deleted"
$ cat testdelete/.hgsubstate
@@ -529,8 +529,8 @@
$ hg -R main add
adding main/.hgsub
$ hg -R main ci -m "add subrepos"
+ committing subrepository nested_absolute
committing subrepository nested_relative
- committing subrepository nested_absolute
$ cd ..
$ hg clone mercurial/main mercurial2/main
updating to branch default
--- a/tests/test-tag.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-tag.t Sat Sep 11 00:40:19 2010 +0200
@@ -3,87 +3,87 @@
$ echo a > a
$ hg add a
- $ hg commit -m "test" -d "1000000 0"
+ $ hg commit -m "test"
$ hg history
- changeset: 0:0acdaf898367
+ changeset: 0:acb14030fe0a
tag: tip
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: test
$ hg tag ' '
abort: tag names cannot consist entirely of whitespace
- $ hg tag -d "1000000 0" "bleah"
+ $ hg tag "bleah"
$ hg history
- changeset: 1:3ecf002a1c57
+ changeset: 1:d4f0d2909abc
tag: tip
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
- summary: Added tag bleah for changeset 0acdaf898367
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: Added tag bleah for changeset acb14030fe0a
- changeset: 0:0acdaf898367
+ changeset: 0:acb14030fe0a
tag: bleah
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: test
$ echo foo >> .hgtags
- $ hg tag -d "1000000 0" "bleah2" || echo "failed"
+ $ hg tag "bleah2" || echo "failed"
abort: working copy of .hgtags is changed (please commit .hgtags manually)
failed
$ hg revert .hgtags
- $ hg tag -d "1000000 0" -r 0 x y z y y z || echo "failed"
+ $ hg tag -r 0 x y z y y z || echo "failed"
abort: tag names must be unique
failed
- $ hg tag -d "1000000 0" tap nada dot tip null . || echo "failed"
+ $ hg tag tap nada dot tip null . || echo "failed"
abort: the name 'tip' is reserved
failed
- $ hg tag -d "1000000 0" "bleah" || echo "failed"
+ $ hg tag "bleah" || echo "failed"
abort: tag 'bleah' already exists (use -f to force)
failed
- $ hg tag -d "1000000 0" "blecch" "bleah" || echo "failed"
+ $ hg tag "blecch" "bleah" || echo "failed"
abort: tag 'bleah' already exists (use -f to force)
failed
- $ hg tag -d "1000000 0" --remove "blecch" || echo "failed"
+ $ hg tag --remove "blecch" || echo "failed"
abort: tag 'blecch' does not exist
failed
- $ hg tag -d "1000000 0" --remove "bleah" "blecch" "blough" || echo "failed"
+ $ hg tag --remove "bleah" "blecch" "blough" || echo "failed"
abort: tag 'blecch' does not exist
failed
- $ hg tag -d "1000000 0" -r 0 "bleah0"
- $ hg tag -l -d "1000000 0" -r 1 "bleah1"
- $ hg tag -d "1000000 0" gack gawk gorp
- $ hg tag -d "1000000 0" -f gack
- $ hg tag -d "1000000 0" --remove gack gorp
+ $ hg tag -r 0 "bleah0"
+ $ hg tag -l -r 1 "bleah1"
+ $ hg tag gack gawk gorp
+ $ hg tag -f gack
+ $ hg tag --remove gack gorp
$ cat .hgtags
- 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah
- 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 bleah0
- 868cc8fbb43b754ad09fa109885d243fc49adae7 gack
- 868cc8fbb43b754ad09fa109885d243fc49adae7 gawk
- 868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
- 868cc8fbb43b754ad09fa109885d243fc49adae7 gack
- 3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
- 3807bcf62c5614cb6c16436b514d7764ca5f1631 gack
+ acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
+ acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
+ 336fccc858a4eb69609a291105009e484a6b6b8d gack
+ 336fccc858a4eb69609a291105009e484a6b6b8d gawk
+ 336fccc858a4eb69609a291105009e484a6b6b8d gorp
+ 336fccc858a4eb69609a291105009e484a6b6b8d gack
+ 799667b6f2d9b957f73fa644a918c2df22bab58f gack
+ 799667b6f2d9b957f73fa644a918c2df22bab58f gack
0000000000000000000000000000000000000000 gack
- 868cc8fbb43b754ad09fa109885d243fc49adae7 gorp
+ 336fccc858a4eb69609a291105009e484a6b6b8d gorp
0000000000000000000000000000000000000000 gorp
$ cat .hg/localtags
- 3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
+ d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
$ hg update 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
- $ hg tag -d "1000000 0" "foobar"
+ $ hg tag "foobar"
$ cat .hgtags
- 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
+ acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
$ cat .hg/localtags
- 3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
+ d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
$ hg tag -l 'xx
> newline'
@@ -95,49 +95,49 @@
$ cd ..
$ hg -R test log -r0:5
- changeset: 0:0acdaf898367
+ changeset: 0:acb14030fe0a
tag: bleah
tag: bleah0
tag: foobar
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: test
- changeset: 1:3ecf002a1c57
+ changeset: 1:d4f0d2909abc
tag: bleah1
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
- summary: Added tag bleah for changeset 0acdaf898367
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: Added tag bleah for changeset acb14030fe0a
- changeset: 2:868cc8fbb43b
+ changeset: 2:336fccc858a4
tag: gawk
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
- summary: Added tag bleah0 for changeset 0acdaf898367
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: Added tag bleah0 for changeset acb14030fe0a
- changeset: 3:3807bcf62c56
+ changeset: 3:799667b6f2d9
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
- summary: Added tag gack, gawk, gorp for changeset 868cc8fbb43b
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: Added tag gack, gawk, gorp for changeset 336fccc858a4
- changeset: 4:140c6e8597b4
+ changeset: 4:154eeb7c0138
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
- summary: Added tag gack for changeset 3807bcf62c56
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: Added tag gack for changeset 799667b6f2d9
- changeset: 5:470a65fa7cc9
+ changeset: 5:b4bb47aaff09
user: test
- date: Mon Jan 12 13:46:40 1970 +0000
+ date: Thu Jan 01 00:00:00 1970 +0000
summary: Removed tag gack, gorp
$ hg clone -q -rbleah1 test test1
$ hg -R test1 parents --style=compact
- 1[tip] 3ecf002a1c57 1970-01-12 13:46 +0000 test
- Added tag bleah for changeset 0acdaf898367
+ 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test
+ Added tag bleah for changeset acb14030fe0a
$ hg clone -q -r5 test#bleah1 test2
$ hg -R test2 parents --style=compact
- 5[tip] 470a65fa7cc9 1970-01-12 13:46 +0000 test
+ 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test
Removed tag gack, gorp
$ hg clone -q -U test#bleah1 test3
@@ -152,24 +152,24 @@
> f = file('.hg/localtags', 'w'); f.write(last); f.close()
> EOF
$ cat .hg/localtags; echo
- 3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
+ d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
$ hg tag -l localnewline
$ cat .hg/localtags; echo
- 3ecf002a1c572a2f3bb4e665417e60fca65bbd42 bleah1
- f68b039e72eacbb2e68b0543e1f6e50990aa2bb5 localnewline
+ d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
+ c2899151f4e76890c602a2597a650a72666681bf localnewline
$ python << EOF
> f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
> f = file('.hgtags', 'w'); f.write(last); f.close()
> EOF
- $ hg ci -d '1000000 0' -m'broken manual edit of .hgtags'
+ $ hg ci -m'broken manual edit of .hgtags'
$ cat .hgtags; echo
- 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
- $ hg tag -d '1000000 0' newline
+ acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
+ $ hg tag newline
$ cat .hgtags; echo
- 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 foobar
- 6ae703d793c8b1f097116869275ecd97b2977a2b newline
+ acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
+ a0eea09de1eeec777b46f2085260a373b2fbc293 newline
tag and branch using same name
--- a/tests/test-transplant.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-transplant.t Sat Sep 11 00:40:19 2010 +0200
@@ -206,7 +206,7 @@
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file foo.rej
patch failed to apply
- abort: Fix up the merge and run hg transplant --continue
+ abort: fix up the merge and run hg transplant --continue
transplant -c shouldn't use an old changeset
@@ -219,7 +219,7 @@
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file foo.rej
patch failed to apply
- abort: Fix up the merge and run hg transplant --continue
+ abort: fix up the merge and run hg transplant --continue
$ hg transplant --continue
a1e30dd1b8e7 transplanted as f1563cf27039
$ hg transplant 1:3
@@ -309,7 +309,7 @@
$ hg up 0
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
$ echo foo > b1
- $ hg ci -d '0 0' -Am foo
+ $ hg ci -Am foo
adding b1
adding test-filter
created new head
@@ -319,7 +319,7 @@
file b1 already exists
1 out of 1 hunks FAILED -- saving rejects to file b1.rej
patch failed to apply
- abort: Fix up the merge and run hg transplant --continue
+ abort: fix up the merge and run hg transplant --continue
$ cd ..
--- a/tests/test-unrelated-pull Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-unrelated-pull Sat Sep 11 00:40:19 2010 +0200
@@ -5,7 +5,7 @@
hg init
echo 123 > a
hg add a
-hg commit -m "a" -u a -d "1000000 0"
+hg commit -m "a" -u a
cd ..
mkdir b
@@ -13,7 +13,7 @@
hg init
echo 321 > b
hg add b
-hg commit -m "b" -u b -d "1000000 0"
+hg commit -m "b" -u b
hg pull ../a
hg pull -f ../a
--- a/tests/test-unrelated-pull.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-unrelated-pull.out Sat Sep 11 00:40:19 2010 +0200
@@ -9,15 +9,15 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
-changeset: 1:bdcee5d51fa6
+changeset: 1:9a79c33a9db3
tag: tip
parent: -1:000000000000
user: a
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: a
-changeset: 0:f155ba1aa5ba
+changeset: 0:01f8062b2de5
user: b
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: b
--- a/tests/test-up-local-change Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-HGMERGE=true; export HGMERGE
-
-set -e
-mkdir r1
-cd r1
-hg init
-echo a > a
-hg addremove
-hg commit -m "1" -d "1000000 0"
-
-hg clone . ../r2
-cd ../r2
-hg up
-echo abc > a
-hg diff --nodates
-
-cd ../r1
-echo b > b
-echo a2 > a
-hg addremove
-hg commit -m "2" -d "1000000 0"
-
-cd ../r2
-hg -q pull ../r1
-hg status
-hg parents
-hg --debug up
-hg parents
-hg --debug up 0
-hg parents
-hg --debug merge || echo failed
-hg parents
-hg --debug up
-hg parents
-hg -v history
-hg diff --nodates
-
-# create a second head
-cd ../r1
-hg up 0
-echo b2 > b
-echo a3 > a
-hg addremove
-hg commit -m "3" -d "1000000 0"
-
-cd ../r2
-hg -q pull ../r1
-hg status
-hg parents
-hg --debug up || echo failed
-hg --debug merge || echo failed
-hg --debug merge -f
-hg parents
-hg diff --nodates
-
-# test a local add
-cd ..
-hg init a
-hg init b
-echo a > a/a
-echo a > b/a
-hg --cwd a commit -A -m a
-cd b
-hg add a
-hg pull -u ../a
-hg st
--- a/tests/test-up-local-change.out Wed Sep 01 10:13:55 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-diff -r 33aaa84a386b a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--a
-+abc
-adding b
-M a
-changeset: 0:33aaa84a386b
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
- searching for copies back to rev 1
- unmatched files in other:
- b
-resolving manifests
- overwrite False partial False
- ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299
- a: versions differ -> m
- b: remote created -> g
-preserving a for resolve of a
-updating: a 1/2 files (50.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b
-updating: b 2/2 files (100.00%)
-getting b
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-changeset: 1:802f095af299
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-resolving manifests
- overwrite False partial False
- ancestor 802f095af299 local 802f095af299+ remote 33aaa84a386b
- a: versions differ -> m
- b: other deleted -> r
-preserving a for resolve of a
-updating: b 1/2 files (50.00%)
-removing b
-updating: a 2/2 files (100.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@802f095af299+ other a@33aaa84a386b ancestor a@802f095af299
-0 files updated, 1 files merged, 1 files removed, 0 files unresolved
-changeset: 0:33aaa84a386b
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
-abort: there is nothing to merge - use "hg update" instead
-failed
-changeset: 0:33aaa84a386b
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 1
-
- searching for copies back to rev 1
- unmatched files in other:
- b
-resolving manifests
- overwrite False partial False
- ancestor 33aaa84a386b local 33aaa84a386b+ remote 802f095af299
- a: versions differ -> m
- b: remote created -> g
-preserving a for resolve of a
-updating: a 1/2 files (50.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@33aaa84a386b+ other a@802f095af299 ancestor a@33aaa84a386b
-updating: b 2/2 files (100.00%)
-getting b
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-changeset: 1:802f095af299
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 1:802f095af299
-tag: tip
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-files: a b
-description:
-2
-
-
-changeset: 0:33aaa84a386b
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-files: a
-description:
-1
-
-
-diff -r 802f095af299 a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--a2
-+abc
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding b
-created new head
-M a
-changeset: 1:802f095af299
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-failed
-abort: outstanding uncommitted changes (use 'hg status' to list changes)
-failed
- searching for copies back to rev 1
-resolving manifests
- overwrite False partial False
- ancestor 33aaa84a386b local 802f095af299+ remote 030602aee63d
- a: versions differ -> m
- b: versions differ -> m
-preserving a for resolve of a
-preserving b for resolve of b
-updating: a 1/2 files (50.00%)
-picked tool 'true' for a (binary False symlink False)
-merging a
-my a@802f095af299+ other a@030602aee63d ancestor a@33aaa84a386b
-updating: b 2/2 files (100.00%)
-picked tool 'true' for b (binary False symlink False)
-merging b
-my b@802f095af299+ other b@030602aee63d ancestor b@000000000000
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-changeset: 1:802f095af299
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 2
-
-changeset: 2:030602aee63d
-tag: tip
-parent: 0:33aaa84a386b
-user: test
-date: Mon Jan 12 13:46:40 1970 +0000
-summary: 3
-
-diff -r 802f095af299 a
---- a/a
-+++ b/a
-@@ -1,1 +1,1 @@
--a2
-+abc
-adding a
-pulling from ../a
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-up-local-change.t Sat Sep 11 00:40:19 2010 +0200
@@ -0,0 +1,235 @@
+ $ HGMERGE=true; export HGMERGE
+
+ $ mkdir r1
+ $ cd r1
+ $ hg init
+ $ echo a > a
+ $ hg addremove
+ adding a
+ $ hg commit -m "1"
+
+ $ hg clone . ../r2
+ updating to branch default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ cd ../r2
+ $ hg up
+ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo abc > a
+ $ hg diff --nodates
+ diff -r c19d34741b0a a
+ --- a/a
+ +++ b/a
+ @@ -1,1 +1,1 @@
+ -a
+ +abc
+
+ $ cd ../r1
+ $ echo b > b
+ $ echo a2 > a
+ $ hg addremove
+ adding b
+ $ hg commit -m "2"
+
+ $ cd ../r2
+ $ hg -q pull ../r1
+ $ hg status
+ M a
+ $ hg parents
+ changeset: 0:c19d34741b0a
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ $ hg --debug up
+ searching for copies back to rev 1
+ unmatched files in other:
+ b
+ resolving manifests
+ overwrite False partial False
+ ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
+ a: versions differ -> m
+ b: remote created -> g
+ preserving a for resolve of a
+ updating: a 1/2 files (50.00%)
+ picked tool 'true' for a (binary False symlink False)
+ merging a
+ my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
+ updating: b 2/2 files (100.00%)
+ getting b
+ 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ $ hg parents
+ changeset: 1:1e71731e6fbb
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ $ hg --debug up 0
+ resolving manifests
+ overwrite False partial False
+ ancestor 1e71731e6fbb local 1e71731e6fbb+ remote c19d34741b0a
+ a: versions differ -> m
+ b: other deleted -> r
+ preserving a for resolve of a
+ updating: b 1/2 files (50.00%)
+ removing b
+ updating: a 2/2 files (100.00%)
+ picked tool 'true' for a (binary False symlink False)
+ merging a
+ my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
+ 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
+ $ hg parents
+ changeset: 0:c19d34741b0a
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ $ hg --debug merge || echo failed
+ abort: there is nothing to merge - use "hg update" instead
+ failed
+ $ hg parents
+ changeset: 0:c19d34741b0a
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 1
+
+ $ hg --debug up
+ searching for copies back to rev 1
+ unmatched files in other:
+ b
+ resolving manifests
+ overwrite False partial False
+ ancestor c19d34741b0a local c19d34741b0a+ remote 1e71731e6fbb
+ a: versions differ -> m
+ b: remote created -> g
+ preserving a for resolve of a
+ updating: a 1/2 files (50.00%)
+ picked tool 'true' for a (binary False symlink False)
+ merging a
+ my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
+ updating: b 2/2 files (100.00%)
+ getting b
+ 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ $ hg parents
+ changeset: 1:1e71731e6fbb
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ $ hg -v history
+ changeset: 1:1e71731e6fbb
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ files: a b
+ description:
+ 2
+
+
+ changeset: 0:c19d34741b0a
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ files: a
+ description:
+ 1
+
+
+ $ hg diff --nodates
+ diff -r 1e71731e6fbb a
+ --- a/a
+ +++ b/a
+ @@ -1,1 +1,1 @@
+ -a2
+ +abc
+
+
+create a second head
+
+ $ cd ../r1
+ $ hg up 0
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ echo b2 > b
+ $ echo a3 > a
+ $ hg addremove
+ adding b
+ $ hg commit -m "3"
+ created new head
+
+ $ cd ../r2
+ $ hg -q pull ../r1
+ $ hg status
+ M a
+ $ hg parents
+ changeset: 1:1e71731e6fbb
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ $ hg --debug up || echo failed
+ abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+ failed
+ $ hg --debug merge || echo failed
+ abort: outstanding uncommitted changes (use 'hg status' to list changes)
+ failed
+ $ hg --debug merge -f
+ searching for copies back to rev 1
+ resolving manifests
+ overwrite False partial False
+ ancestor c19d34741b0a local 1e71731e6fbb+ remote 83c51d0caff4
+ a: versions differ -> m
+ b: versions differ -> m
+ preserving a for resolve of a
+ preserving b for resolve of b
+ updating: a 1/2 files (50.00%)
+ picked tool 'true' for a (binary False symlink False)
+ merging a
+ my a@1e71731e6fbb+ other a@83c51d0caff4 ancestor a@c19d34741b0a
+ updating: b 2/2 files (100.00%)
+ picked tool 'true' for b (binary False symlink False)
+ merging b
+ my b@1e71731e6fbb+ other b@83c51d0caff4 ancestor b@000000000000
+ 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg parents
+ changeset: 1:1e71731e6fbb
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 2
+
+ changeset: 2:83c51d0caff4
+ tag: tip
+ parent: 0:c19d34741b0a
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 3
+
+ $ hg diff --nodates
+ diff -r 1e71731e6fbb a
+ --- a/a
+ +++ b/a
+ @@ -1,1 +1,1 @@
+ -a2
+ +abc
+
+
+test a local add
+
+ $ cd ..
+ $ hg init a
+ $ hg init b
+ $ echo a > a/a
+ $ echo a > b/a
+ $ hg --cwd a commit -A -m a
+ adding a
+ $ cd b
+ $ hg add a
+ $ hg pull -u ../a
+ pulling from ../a
+ requesting all changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg st
--- a/tests/test-update-reverse Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-update-reverse Sat Sep 11 00:40:19 2010 +0200
@@ -3,11 +3,11 @@
hg init
touch a
hg add a
-hg commit -m "Added a" -d "1000000 0"
+hg commit -m "Added a"
touch main
hg add main
-hg commit -m "Added main" -d "1000000 0"
+hg commit -m "Added main"
hg checkout 0
echo Main should be gone
@@ -15,10 +15,10 @@
touch side1
hg add side1
-hg commit -m "Added side1" -d "1000000 0"
+hg commit -m "Added side1"
touch side2
hg add side2
-hg commit -m "Added side2" -d "1000000 0"
+hg commit -m "Added side2"
hg log
--- a/tests/test-update-reverse.out Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-update-reverse.out Sat Sep 11 00:40:19 2010 +0200
@@ -2,38 +2,38 @@
Main should be gone
a
created new head
-changeset: 3:ded32b0db104
+changeset: 3:91ebc10ed028
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: Added side2
-changeset: 2:92a816cea698
-parent: 0:537353581d3d
+changeset: 2:b932d7dbb1e1
+parent: 0:c2eda428b523
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: Added side1
-changeset: 1:221226fb2bd8
+changeset: 1:71a760306caf
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: Added main
-changeset: 0:537353581d3d
+changeset: 0:c2eda428b523
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: Added a
Should have two heads, side2 and main
-changeset: 3:ded32b0db104
+changeset: 3:91ebc10ed028
tag: tip
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: Added side2
-changeset: 1:221226fb2bd8
+changeset: 1:71a760306caf
user: test
-date: Mon Jan 12 13:46:40 1970 +0000
+date: Thu Jan 01 00:00:00 1970 +0000
summary: Added main
Should show a side1 side2
@@ -42,7 +42,7 @@
side2
resolving manifests
overwrite True partial False
- ancestor ded32b0db104+ local ded32b0db104+ remote 221226fb2bd8
+ ancestor 91ebc10ed028+ local 91ebc10ed028+ remote 71a760306caf
side2: other deleted -> r
side1: other deleted -> r
main: remote created -> g
--- a/tests/test-verify.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-verify.t Sat Sep 11 00:40:19 2010 +0200
@@ -84,4 +84,18 @@
1 integrity errors encountered!
(first damaged changeset appears to be 0)
+ $ cd ..
+
+test revlog format 0
+
+ $ "$TESTDIR/revlog-formatv0.py"
+ $ cd formatv0
+ $ hg verify
+ repository uses revlog format 0
+ checking changesets
+ checking manifests
+ crosschecking files in changesets and manifests
+ checking files
+ 1 files, 1 changesets, 1 total revisions
+
$ exit 0
--- a/tests/test-walk.t Wed Sep 01 10:13:55 2010 +0200
+++ b/tests/test-walk.t Sat Sep 11 00:40:19 2010 +0200
@@ -29,7 +29,7 @@
adding mammals/Procyonidae/coatimundi
adding mammals/Procyonidae/raccoon
adding mammals/skunk
- $ hg commit -m "commit #0" -d "1000000 0"
+ $ hg commit -m "commit #0"
$ hg debugwalk
f beans/black beans/black