changeset 17852:1f34b57ca319 stable

Merge repeated-slash fix
author Bryan O'Sullivan <bryano@fb.com>
date Mon, 22 Oct 2012 21:54:36 -0700
parents f42cf30873dc (diff) 7aa7380691b8 (current diff)
children 653d2afdaf88 afbc7714c323
files tests/test-convert-filemap.t
diffstat 49 files changed, 799 insertions(+), 309 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsigs	Mon Oct 22 18:05:40 2012 -0700
+++ b/.hgsigs	Mon Oct 22 21:54:36 2012 -0700
@@ -59,3 +59,4 @@
 7f5094bb3f423fc799e471aac2aee81a7ce57a0b 0 iD8DBQBQGiL8ywK+sNU5EO8RAq5oAJ4rMMCPx6O+OuzNXVOexogedWz/QgCeIiIxLd76I4pXO48tdXhr0hQcBuM=
 072209ae4ddb654eb2d5fd35bff358c738414432 0 iD8DBQBQQkq0ywK+sNU5EO8RArDTAJ9nk5CySnNAjAXYvqvx4uWCw9ThZwCgqmFRehH/l+oTwj3f8nw8u8qTCdc=
 b3f0f9a39c4e1d0250048cd803ab03542d6f140a 0 iD8DBQBQamltywK+sNU5EO8RAlsqAJ4qF/m6aFu4mJCOKTiAP5RvZFK02ACfawYShUZO6OXEFfveU0aAxDR0M1k=
+d118a4f4fd16d9b558ec3f3e87bfee772861d2b7 0 iD8DBQBQgPV5ywK+sNU5EO8RArylAJ0abcx5NlDjyv3ZDWpAfRIHyRsJtQCgn4TMuEayqgxzrvadQZHdTEU2g38=
--- a/.hgtags	Mon Oct 22 18:05:40 2012 -0700
+++ b/.hgtags	Mon Oct 22 21:54:36 2012 -0700
@@ -72,3 +72,4 @@
 7f5094bb3f423fc799e471aac2aee81a7ce57a0b 2.3
 072209ae4ddb654eb2d5fd35bff358c738414432 2.3.1
 b3f0f9a39c4e1d0250048cd803ab03542d6f140a 2.3.2
+d118a4f4fd16d9b558ec3f3e87bfee772861d2b7 2.4-rc
--- a/hgext/color.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/hgext/color.py	Mon Oct 22 21:54:36 2012 -0700
@@ -224,6 +224,13 @@
     _terminfo_params = False
 
 _styles = {'grep.match': 'red bold',
+           'grep.linenumber': 'green',
+           'grep.rev': 'green',
+           'grep.change': 'green',
+           'grep.sep': 'cyan',
+           'grep.filename': 'magenta',
+           'grep.user': 'magenta',
+           'grep.date': 'magenta',
            'bookmarks.current': 'green',
            'branches.active': 'none',
            'branches.closed': 'black bold',
--- a/hgext/convert/filemap.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/hgext/convert/filemap.py	Mon Oct 22 21:54:36 2012 -0700
@@ -4,6 +4,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
+import posixpath
 import shlex
 from mercurial.i18n import _
 from mercurial import util
@@ -16,6 +17,13 @@
         e = name.rfind('/', 0, e)
     yield '.', name
 
+def normalize(path):
+    ''' We use posixpath.normpath to support cross-platform path format.
+    However, it doesn't handle None input. So we wrap it up. '''
+    if path is None:
+        return None
+    return posixpath.normpath(path)
+
 class filemapper(object):
     '''Map and filter filenames when importing.
     A name can be mapped to itself, a new name, or None (omit from new
@@ -53,21 +61,21 @@
         cmd = lex.get_token()
         while cmd:
             if cmd == 'include':
-                name = lex.get_token()
+                name = normalize(lex.get_token())
                 errs += check(name, self.exclude, 'exclude')
                 self.include[name] = name
             elif cmd == 'exclude':
-                name = lex.get_token()
+                name = normalize(lex.get_token())
                 errs += check(name, self.include, 'include')
                 errs += check(name, self.rename, 'rename')
                 self.exclude[name] = name
             elif cmd == 'rename':
-                src = lex.get_token()
-                dest = lex.get_token()
+                src = normalize(lex.get_token())
+                dest = normalize(lex.get_token())
                 errs += check(src, self.exclude, 'exclude')
                 self.rename[src] = dest
             elif cmd == 'source':
-                errs += self.parse(lex.get_token())
+                errs += self.parse(normalize(lex.get_token()))
             else:
                 self.ui.warn(_('%s:%d: unknown directive %r\n') %
                              (lex.infile, lex.lineno, cmd))
@@ -76,6 +84,7 @@
         return errs
 
     def lookup(self, name, mapping):
+        name = normalize(name)
         for pre, suf in rpairs(name):
             try:
                 return mapping[pre], pre, suf
--- a/hgext/largefiles/lfcommands.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/hgext/largefiles/lfcommands.py	Mon Oct 22 21:54:36 2012 -0700
@@ -141,7 +141,17 @@
 
             hash = fctx.data().strip()
             path = lfutil.findfile(rsrc, hash)
-            ### TODO: What if the file is not cached?
+
+            # If one file is missing, likely all files from this rev are
+            if path is None:
+                cachelfiles(ui, rsrc, ctx.node())
+                path = lfutil.findfile(rsrc, hash)
+
+                if path is None:
+                    raise util.Abort(
+                        _("missing largefile \'%s\' from revision %s")
+                         % (f, node.hex(ctx.node())))
+
             data = ''
             fd = None
             try:
--- a/hgext/largefiles/overrides.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/hgext/largefiles/overrides.py	Mon Oct 22 21:54:36 2012 -0700
@@ -733,24 +733,29 @@
 def hgclone(orig, ui, opts, *args, **kwargs):
     result = orig(ui, opts, *args, **kwargs)
 
-    if result is not None and opts.get('all_largefiles'):
+    if result is not None:
         sourcerepo, destrepo = result
         repo = destrepo.local()
 
         # The .hglf directory must exist for the standin matcher to match
         # anything (which listlfiles uses for each rev), and .hg/largefiles is
         # assumed to exist by the code that caches the downloaded file.  These
-        # directories exist if clone updated to any rev.
-        if opts.get('noupdate'):
-            util.makedirs(repo.pathto(lfutil.shortname))
-            util.makedirs(repo.join(lfutil.longname))
+        # directories exist if clone updated to any rev.  (If the repo does not
+        # have largefiles, download never gets to the point of needing
+        # .hg/largefiles, and the standin matcher won't match anything anyway.)
+        if 'largefiles' in repo.requirements:
+            if opts.get('noupdate'):
+                util.makedirs(repo.pathto(lfutil.shortname))
+                util.makedirs(repo.join(lfutil.longname))
 
         # Caching is implicitly limited to 'rev' option, since the dest repo was
-        # truncated at that point.
-        success, missing = lfcommands.downloadlfiles(ui, repo, None)
+        # truncated at that point.  The user may expect a download count with
+        # this option, so attempt whether or not this is a largefile repo.
+        if opts.get('all_largefiles'):
+            success, missing = lfcommands.downloadlfiles(ui, repo, None)
 
-        if missing != 0:
-            return None
+            if missing != 0:
+                return None
 
     return result
 
@@ -963,7 +968,7 @@
         return None
     o = lfutil.findoutgoing(repo, remote, False)
     if not o:
-        return None
+        return o
     o = repo.changelog.nodesbetween(o, revs)[0]
     if opts.get('newest_first'):
         o.reverse()
@@ -997,6 +1002,8 @@
         toupload = getoutgoinglfiles(ui, repo, dest, **opts)
         if toupload is None:
             ui.status(_('largefiles: No remote repo\n'))
+        elif not toupload:
+            ui.status(_('largefiles: no files to upload\n'))
         else:
             ui.status(_('largefiles to upload:\n'))
             for file in toupload:
@@ -1016,6 +1023,8 @@
         toupload = getoutgoinglfiles(ui, repo, None, **opts)
         if toupload is None:
             ui.status(_('largefiles: No remote repo\n'))
+        elif not toupload:
+            ui.status(_('largefiles: (no files to upload)\n'))
         else:
             ui.status(_('largefiles: %d to upload\n') % len(toupload))
 
--- a/hgext/largefiles/reposetup.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/hgext/largefiles/reposetup.py	Mon Oct 22 21:54:36 2012 -0700
@@ -100,11 +100,11 @@
                 if isinstance(node1, context.changectx):
                     ctx1 = node1
                 else:
-                    ctx1 = repo[node1]
+                    ctx1 = self[node1]
                 if isinstance(node2, context.changectx):
                     ctx2 = node2
                 else:
-                    ctx2 = repo[node2]
+                    ctx2 = self[node2]
                 working = ctx2.rev() is None
                 parentworking = working and ctx1 == self['.']
 
@@ -140,7 +140,7 @@
                     if not working:
                         return files
                     newfiles = []
-                    dirstate = repo.dirstate
+                    dirstate = self.dirstate
                     for f in files:
                         sf = lfutil.standin(f)
                         if sf in dirstate:
@@ -181,7 +181,7 @@
 
                         def sfindirstate(f):
                             sf = lfutil.standin(f)
-                            dirstate = repo.dirstate
+                            dirstate = self.dirstate
                             return sf in dirstate or sf in dirstate.dirs()
                         match._files = [f for f in match._files
                                         if sfindirstate(f)]
@@ -244,13 +244,13 @@
                     # files are not really removed if it's still in
                     # lfdirstate. This happens in merges where files
                     # change type.
-                    removed = [f for f in removed if f not in repo.dirstate]
+                    removed = [f for f in removed if f not in self.dirstate]
                     result[2] = [f for f in result[2] if f not in lfdirstate]
 
                     # Unknown files
                     unknown = set(unknown).difference(ignored)
                     result[4] = [f for f in unknown
-                                 if (repo.dirstate[f] == '?' and
+                                 if (self.dirstate[f] == '?' and
                                      not lfutil.isstandin(f))]
                     # Ignored files were calculated earlier by the dirstate,
                     # and we already stripped out the largefiles from the list
@@ -292,7 +292,7 @@
                 force=False, editor=False, extra={}):
             orig = super(lfilesrepo, self).commit
 
-            wlock = repo.wlock()
+            wlock = self.wlock()
             try:
                 # Case 0: Rebase or Transplant
                 # We have to take the time to pull down the new largefiles now.
@@ -301,9 +301,9 @@
                 # or in the first commit after the rebase or transplant.
                 # updatelfiles will update the dirstate to mark any pulled
                 # largefiles as modified
-                if getattr(repo, "_isrebasing", False) or \
-                        getattr(repo, "_istransplanting", False):
-                    lfcommands.updatelfiles(repo.ui, repo, filelist=None,
+                if getattr(self, "_isrebasing", False) or \
+                        getattr(self, "_istransplanting", False):
+                    lfcommands.updatelfiles(self.ui, self, filelist=None,
                                             printmessage=False)
                     result = orig(text=text, user=user, date=date, match=match,
                                     force=force, editor=editor, extra=extra)
@@ -319,7 +319,7 @@
                     # otherwise to update all standins if the largefiles are
                     # large.
                     lfdirstate = lfutil.openlfdirstate(ui, self)
-                    dirtymatch = match_.always(repo.root, repo.getcwd())
+                    dirtymatch = match_.always(self.root, self.getcwd())
                     s = lfdirstate.status(dirtymatch, [], False, False, False)
                     modifiedfiles = []
                     for i in s:
@@ -345,9 +345,9 @@
                     if result is not None:
                         for lfile in lfdirstate:
                             if lfile in modifiedfiles:
-                                if (not os.path.exists(repo.wjoin(
+                                if (not os.path.exists(self.wjoin(
                                    lfutil.standin(lfile)))) or \
-                                   (not os.path.exists(repo.wjoin(lfile))):
+                                   (not os.path.exists(self.wjoin(lfile))):
                                     lfdirstate.drop(lfile)
 
                     # This needs to be after commit; otherwise precommit hooks
@@ -390,7 +390,7 @@
                 # standins corresponding to the big files requested by the
                 # user.  Have to modify _files to prevent commit() from
                 # complaining "not tracked" for big files.
-                lfiles = lfutil.listlfiles(repo)
+                lfiles = lfutil.listlfiles(self)
                 match = copy.copy(match)
                 origmatchfn = match.matchfn
 
@@ -431,14 +431,14 @@
                 wlock.release()
 
         def push(self, remote, force=False, revs=None, newbranch=False):
-            o = lfutil.findoutgoing(repo, remote, force)
+            o = lfutil.findoutgoing(self, remote, force)
             if o:
                 toupload = set()
-                o = repo.changelog.nodesbetween(o, revs)[0]
+                o = self.changelog.nodesbetween(o, revs)[0]
                 for n in o:
-                    parents = [p for p in repo.changelog.parents(n)
+                    parents = [p for p in self.changelog.parents(n)
                                if p != node_.nullid]
-                    ctx = repo[n]
+                    ctx = self[n]
                     files = set(ctx.files())
                     if len(parents) == 2:
                         mc = ctx.manifest()
--- a/hgext/win32mbcs.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/hgext/win32mbcs.py	Mon Oct 22 21:54:36 2012 -0700
@@ -89,19 +89,28 @@
         s += os.sep
     return s
 
-def wrapper(func, args, kwds):
-    # check argument is unicode, then call original
+
+def basewrapper(func, argtype, enc, dec, args, kwds):
+    # check check already converted, then call original
     for arg in args:
-        if isinstance(arg, unicode):
+        if isinstance(arg, argtype):
             return func(*args, **kwds)
 
     try:
-        # convert arguments to unicode, call func, then convert back
-        return encode(func(*decode(args), **decode(kwds)))
+        # convert string arguments, call func, then convert back the
+        # return value.
+        return enc(func(*dec(args), **dec(kwds)))
     except UnicodeError:
         raise util.Abort(_("[win32mbcs] filename conversion failed with"
                          " %s encoding\n") % (_encoding))
 
+def wrapper(func, args, kwds):
+    return basewrapper(func, unicode, encode, decode, args, kwds)
+
+
+def reversewrapper(func, args, kwds):
+    return basewrapper(func, str, decode, encode, args, kwds)
+
 def wrapperforlistdir(func, args, kwds):
     # Ensure 'path' argument ends with os.sep to avoids
     # misinterpreting last 0x5c of MBCS 2nd byte as path separator.
@@ -133,6 +142,11 @@
  mercurial.util.fspath mercurial.util.pconvert mercurial.util.normpath
  mercurial.util.checkwinfilename mercurial.util.checkosfilename'''
 
+# These functions are required to be called with local encoded string
+# because they expects argument is local encoded string and cause
+# problem with unicode string.
+rfuncs = '''mercurial.encoding.upper mercurial.encoding.lower'''
+
 # List of Windows specific functions to be wrapped.
 winfuncs = '''os.path.splitunc'''
 
@@ -159,6 +173,9 @@
             for f in winfuncs.split():
                 wrapname(f, wrapper)
         wrapname("mercurial.osutil.listdir", wrapperforlistdir)
+        # wrap functions to be called with local byte string arguments
+        for f in rfuncs.split():
+            wrapname(f, reversewrapper)
         # Check sys.args manually instead of using ui.debug() because
         # command line options is not yet applied when
         # extensions.loadall() is called.
--- a/mercurial/bookmarks.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/bookmarks.py	Mon Oct 22 21:54:36 2012 -0700
@@ -10,12 +10,6 @@
 from mercurial import encoding, error, util, obsolete, phases
 import errno, os
 
-def valid(mark):
-    for c in (':', '\0', '\n', '\r'):
-        if c in mark:
-            return False
-    return True
-
 def read(repo):
     '''Parse .hg/bookmarks file and return a dictionary
 
@@ -79,10 +73,6 @@
 
     if repo._bookmarkcurrent not in refs:
         setcurrent(repo, None)
-    for mark in refs.keys():
-        if not valid(mark):
-            raise util.Abort(_("bookmark '%s' contains illegal "
-                "character" % mark))
 
     wlock = repo.wlock()
     try:
@@ -113,9 +103,6 @@
 
     if mark not in repo._bookmarks:
         mark = ''
-    if not valid(mark):
-        raise util.Abort(_("bookmark '%s' contains illegal "
-            "character" % mark))
 
     wlock = repo.wlock()
     try:
@@ -279,8 +266,8 @@
             for c in validdests:
                 if c.phase() > phases.public:
                     # obsolescence marker does not apply to public changeset
-                    succs.update(obsolete.anysuccessors(repo.obsstore,
-                                                        c.node()))
+                    succs.update(obsolete.allsuccessors(repo.obsstore,
+                                                        [c.node()]))
             validdests = set(repo.set('%ln::', succs))
         validdests.remove(old)
         return new in validdests
--- a/mercurial/changelog.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/changelog.py	Mon Oct 22 21:54:36 2012 -0700
@@ -49,6 +49,10 @@
     items = [_string_escape('%s:%s' % (k, d[k])) for k in sorted(d)]
     return "\0".join(items)
 
+def stripdesc(desc):
+    """strip trailing whitespace and leading and trailing empty lines"""
+    return '\n'.join([l.rstrip() for l in desc.splitlines()]).strip('\n')
+
 class appender(object):
     '''the changelog index must be updated last on disk, so we use this class
     to delay writes to it'''
@@ -308,8 +312,7 @@
             raise error.RevlogError(_("username %s contains a newline")
                                     % repr(user))
 
-        # strip trailing whitespace and leading and trailing empty lines
-        desc = '\n'.join([l.rstrip() for l in desc.splitlines()]).strip('\n')
+        desc = stripdesc(desc)
 
         if date:
             parseddate = "%d %d" % util.parsedate(date)
--- a/mercurial/cmdutil.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/cmdutil.py	Mon Oct 22 21:54:36 2012 -0700
@@ -11,6 +11,7 @@
 import util, scmutil, templater, patch, error, templatekw, revlog, copies
 import match as matchmod
 import subrepo, context, repair, bookmarks, graphmod, revset, phases, obsolete
+import changelog
 import lock as lockmod
 
 def parsealiases(cmd):
@@ -1696,6 +1697,9 @@
             if not message:
                 message = old.description()
 
+            pureextra = extra.copy()
+            extra['amend_source'] = old.hex()
+
             new = context.memctx(repo,
                                  parents=[base.node(), nullid],
                                  text=message,
@@ -1705,6 +1709,19 @@
                                  date=date,
                                  extra=extra)
             new._text = commitforceeditor(repo, new, [])
+
+            newdesc =  changelog.stripdesc(new.description())
+            if ((not node)
+                and newdesc == old.description()
+                and user == old.user()
+                and date == old.date()
+                and pureextra == old.extra()):
+                # nothing changed. continuing here would create a new node
+                # anyway because of the amend_source noise.
+                #
+                # This not what we expect from amend.
+                return old.node()
+
             ph = repo.ui.config('phases', 'new-commit', phases.draft)
             try:
                 repo.ui.setconfig('phases', 'new-commit', old.phase())
@@ -1727,7 +1744,7 @@
                 new = repo[newid]
                 obs = [(old, (new,))]
                 if node:
-                    obs.append((ctx, (new,)))
+                    obs.append((ctx, ()))
 
                 obsolete.createmarkers(repo, obs)
             tr.close()
--- a/mercurial/commands.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/commands.py	Mon Oct 22 21:54:36 2012 -0700
@@ -790,12 +790,11 @@
     cur   = repo.changectx('.').node()
 
     def checkformat(mark):
-        if "\n" in mark:
-            raise util.Abort(_("bookmark name cannot contain newlines"))
         mark = mark.strip()
         if not mark:
             raise util.Abort(_("bookmark names cannot consist entirely of "
                                "whitespace"))
+        scmutil.checknewlabel(repo, mark, 'bookmark')
         return mark
 
     def checkconflict(repo, mark, force=False):
@@ -850,30 +849,32 @@
         if not inactive and cur == marks[mark]:
             bookmarks.setcurrent(repo, mark)
         bookmarks.write(repo)
-        return
-
-    else: # mark is None
-        if len(marks) == 0:
-            ui.status(_("no bookmarks set\n"))
-        elif inactive:
-            if not repo._bookmarkcurrent:
-                ui.status(_("no active bookmark\n"))
-            else:
-                bookmarks.setcurrent(repo, None)
+
+    # Same message whether trying to deactivate the current bookmark (-i
+    # with no NAME) or listing bookmarks
+    elif len(marks) == 0:
+        ui.status(_("no bookmarks set\n"))
+
+    elif inactive:
+        if not repo._bookmarkcurrent:
+            ui.status(_("no active bookmark\n"))
         else:
-            for bmark, n in sorted(marks.iteritems()):
-                current = repo._bookmarkcurrent
-                if bmark == current and n == cur:
-                    prefix, label = '*', 'bookmarks.current'
-                else:
-                    prefix, label = ' ', ''
-
-                if ui.quiet:
-                    ui.write("%s\n" % bmark, label=label)
-                else:
-                    ui.write(" %s %-25s %d:%s\n" % (
-                        prefix, bmark, repo.changelog.rev(n), hexfn(n)),
-                        label=label)
+            bookmarks.setcurrent(repo, None)
+
+    else: # show bookmarks
+        for bmark, n in sorted(marks.iteritems()):
+            current = repo._bookmarkcurrent
+            if bmark == current and n == cur:
+                prefix, label = '*', 'bookmarks.current'
+            else:
+                prefix, label = ' ', ''
+
+            if ui.quiet:
+                ui.write("%s\n" % bmark, label=label)
+            else:
+                ui.write(" %s %-25s %d:%s\n" % (
+                    prefix, bmark, repo.changelog.rev(n), hexfn(n)),
+                    label=label)
 
 @command('branch',
     [('f', 'force', None,
@@ -2083,7 +2084,9 @@
     flags = repo.known([bin(s) for s in ids])
     ui.write("%s\n" % ("".join([f and "1" or "0" for f in flags])))
 
-@command('debugobsolete', [] + commitopts2,
+@command('debugobsolete',
+        [('', 'flags', 0, _('markers flag')),
+        ] + commitopts2,
          _('[OBSOLETED [REPLACEMENT] [REPL... ]'))
 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
     """create arbitrary obsolete marker"""
@@ -2110,8 +2113,8 @@
         try:
             tr = repo.transaction('debugobsolete')
             try:
-                repo.obsstore.create(tr, parsenodeid(precursor), succs, 0,
-                                     metadata)
+                repo.obsstore.create(tr, parsenodeid(precursor), succs,
+                                     opts['flags'], metadata)
                 tr.close()
             finally:
                 tr.release()
@@ -2994,16 +2997,17 @@
         else:
             iter = [('', l) for l in states]
         for change, l in iter:
-            cols = [fn, str(rev)]
+            cols = [(fn, 'grep.filename'), (str(rev), 'grep.rev')]
             before, match, after = None, None, None
+
             if opts.get('line_number'):
-                cols.append(str(l.linenum))
+                cols.append((str(l.linenum), 'grep.linenumber'))
             if opts.get('all'):
-                cols.append(change)
+                cols.append((change, 'grep.change'))
             if opts.get('user'):
-                cols.append(ui.shortuser(ctx.user()))
+                cols.append((ui.shortuser(ctx.user()), 'grep.user'))
             if opts.get('date'):
-                cols.append(datefunc(ctx.date()))
+                cols.append((datefunc(ctx.date()), 'grep.date'))
             if opts.get('files_with_matches'):
                 c = (fn, rev)
                 if c in filerevmatches:
@@ -3013,12 +3017,16 @@
                 before = l.line[:l.colstart]
                 match = l.line[l.colstart:l.colend]
                 after = l.line[l.colend:]
-            ui.write(sep.join(cols))
+            for col, label in cols[:-1]:
+                ui.write(col, label=label)
+                ui.write(sep, label='grep.sep')
+            ui.write(cols[-1][0], label=cols[-1][1])
             if before is not None:
+                ui.write(sep, label='grep.sep')
                 if not opts.get('text') and binary():
-                    ui.write(sep + " Binary file matches")
+                    ui.write(" Binary file matches")
                 else:
-                    ui.write(sep + before)
+                    ui.write(before)
                     ui.write(match, label='grep.match')
                     ui.write(after)
             ui.write(eol)
@@ -3257,8 +3265,12 @@
                 rst.append(_('\nuse "hg help %s" to show the full help text\n')
                            % name)
             elif not ui.quiet:
-                rst.append(_('\nuse "hg -v help %s" to show more info\n')
-                           % name)
+                omitted = _('use "hg -v help %s" to show more complete'
+                            ' help and the global options') % name
+                notomitted = _('use "hg -v help %s" to show'
+                               ' the global options') % name
+                help.indicateomitted(rst, omitted, notomitted)
+
         return rst
 
 
@@ -3361,6 +3373,11 @@
         if util.safehasattr(doc, '__call__'):
             rst += ["    %s\n" % l for l in doc().splitlines()]
 
+        if not ui.verbose:
+            omitted = (_('use "hg help -v %s" to show more complete help') %
+                       name)
+            help.indicateomitted(rst, omitted)
+
         try:
             cmdutil.findcmd(name, table)
             rst.append(_('\nuse "hg help -c %s" to see help for '
@@ -3388,6 +3405,11 @@
             rst.extend(tail.splitlines(True))
             rst.append('\n')
 
+        if not ui.verbose:
+            omitted = (_('use "hg help -v %s" to show more complete help') %
+                       name)
+            help.indicateomitted(rst, omitted)
+
         if mod:
             try:
                 ct = mod.cmdtable
@@ -3451,7 +3473,13 @@
         rst.extend(helplist())
 
     keep = ui.verbose and ['verbose'] or []
-    formatted, pruned = minirst.format(''.join(rst), textwidth, keep=keep)
+    text = ''.join(rst)
+    formatted, pruned = minirst.format(text, textwidth, keep=keep)
+    if 'verbose' in pruned:
+        keep.append('omitted')
+    else:
+        keep.append('notomitted')
+    formatted, pruned = minirst.format(text, textwidth, keep=keep)
     ui.write(formatted)
 
 
@@ -5638,8 +5666,7 @@
         if len(names) != len(set(names)):
             raise util.Abort(_('tag names must be unique'))
         for n in names:
-            if n in ['tip', '.', 'null']:
-                raise util.Abort(_("the name '%s' is reserved") % n)
+            scmutil.checknewlabel(repo, n, 'tag')
             if not n:
                 raise util.Abort(_('tag names cannot consist entirely of '
                                    'whitespace'))
@@ -5843,7 +5870,7 @@
 
     # with no argument, we also move the current bookmark, if any
     movemarkfrom = None
-    if rev is None or node == '':
+    if rev is None:
         movemarkfrom = repo['.'].node()
 
     # if we defined a bookmark, we have to remember the original bookmark name
--- a/mercurial/context.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/context.py	Mon Oct 22 21:54:36 2012 -0700
@@ -233,15 +233,22 @@
 
     def obsolete(self):
         """True if the changeset is obsolete"""
-        return self.rev() in obsmod.getobscache(self._repo, 'obsolete')
+        return self.rev() in obsmod.getrevs(self._repo, 'obsolete')
 
     def extinct(self):
         """True if the changeset is extinct"""
-        return self.rev() in obsmod.getobscache(self._repo, 'extinct')
+        return self.rev() in obsmod.getrevs(self._repo, 'extinct')
 
     def unstable(self):
         """True if the changeset is not obsolete but it's ancestor are"""
-        return self.rev() in obsmod.getobscache(self._repo, 'unstable')
+        return self.rev() in obsmod.getrevs(self._repo, 'unstable')
+
+    def bumped(self):
+        """True if the changeset try to be a successor of a public changeset
+
+        Only non-public and non-obsolete changesets may be bumped.
+        """
+        return self.rev() in obsmod.getrevs(self._repo, 'bumped')
 
     def _fileinfo(self, path):
         if '_manifest' in self.__dict__:
--- a/mercurial/dirstate.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/dirstate.py	Mon Oct 22 21:54:36 2012 -0700
@@ -260,8 +260,8 @@
         return copies
 
     def setbranch(self, branch):
-        if branch in ['tip', '.', 'null']:
-            raise util.Abort(_('the name \'%s\' is reserved') % branch)
+        # no repo object here, just check for reserved names
+        scmutil.checknewlabel(None, branch, 'branch')
         self._branch = encoding.fromlocal(branch)
         f = self._opener('branch', 'w', atomictemp=True)
         try:
--- a/mercurial/discovery.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/discovery.py	Mon Oct 22 21:54:36 2012 -0700
@@ -298,7 +298,7 @@
                 if nh in repo and repo[nh].phase() <= phases.public:
                     newhs.add(nh)
                 else:
-                    for suc in obsolete.anysuccessors(repo.obsstore, nh):
+                    for suc in obsolete.allsuccessors(repo.obsstore, [nh]):
                         if suc != nh and suc in allfuturecommon:
                             discardedheads.add(nh)
                             break
--- a/mercurial/help.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/help.py	Mon Oct 22 21:54:36 2012 -0700
@@ -61,6 +61,11 @@
 
     return ''.join(rst)
 
+def indicateomitted(rst, omitted, notomitted=None):
+    rst.append('\n\n.. container:: omitted\n\n    %s\n\n' % omitted)
+    if notomitted:
+        rst.append('\n\n.. container:: notomitted\n\n    %s\n\n' % notomitted)
+
 def topicmatch(kw):
     """Return help topics matching kw.
 
--- a/mercurial/hg.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/hg.py	Mon Oct 22 21:54:36 2012 -0700
@@ -115,7 +115,7 @@
 
 def defaultdest(source):
     '''return default destination of clone if none is given'''
-    return os.path.basename(os.path.normpath(source))
+    return os.path.basename(os.path.normpath(util.url(source).path))
 
 def share(ui, source, dest=None, update=True):
     '''create a shared repository'''
--- a/mercurial/hgweb/hgwebdir_mod.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon Oct 22 21:54:36 2012 -0700
@@ -293,9 +293,11 @@
                     except OSError:
                         continue
 
+                    # add '/' to the name to make it obvious that
+                    # the entry is a directory, not a regular repository
                     row = dict(contact="",
                                contact_sort="",
-                               name=name,
+                               name=name + '/',
                                name_sort=name,
                                url=url,
                                description="",
--- a/mercurial/httpconnection.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/httpconnection.py	Mon Oct 22 21:54:36 2012 -0700
@@ -234,7 +234,9 @@
         if req.get_full_url().startswith('https'):
             return self.https_open(req)
         def makehttpcon(*args, **kwargs):
-            return HTTPConnection(*args, use_ssl=False, **kwargs)
+            k2 = dict(kwargs)
+            k2['use_ssl'] = False
+            return HTTPConnection(*args, **k2)
         return self.do_open(makehttpcon, req, False)
 
     def https_open(self, req):
--- a/mercurial/localrepo.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/localrepo.py	Mon Oct 22 21:54:36 2012 -0700
@@ -385,17 +385,9 @@
     def hook(self, name, throw=False, **args):
         return hook.hook(self.ui, self, name, throw, **args)
 
-    tag_disallowed = ':\r\n'
-
     def _tag(self, names, node, message, local, user, date, extra={}):
         if isinstance(names, str):
-            allchars = names
             names = (names,)
-        else:
-            allchars = ''.join(names)
-        for c in self.tag_disallowed:
-            if c in allchars:
-                raise util.Abort(_('%r cannot be used in a tag name') % c)
 
         branches = self.branchmap()
         for name in names:
@@ -1878,8 +1870,9 @@
                         # then, save the iteration
                         if self.obsstore:
                             # this message are here for 80 char limit reason
-                            mso = _("push includes an obsolete changeset: %s!")
-                            msu = _("push includes an unstable changeset: %s!")
+                            mso = _("push includes obsolete changeset: %s!")
+                            msu = _("push includes unstable changeset: %s!")
+                            msb = _("push includes bumped changeset: %s!")
                             # If we are to push if there is at least one
                             # obsolete or unstable changeset in missing, at
                             # least one of the missinghead will be obsolete or
@@ -1890,6 +1883,8 @@
                                     raise util.Abort(_(mso) % ctx)
                                 elif ctx.unstable():
                                     raise util.Abort(_(msu) % ctx)
+                                elif ctx.bumped():
+                                    raise util.Abort(_(msb) % ctx)
                         discovery.checkheads(self, remote, outgoing,
                                              remoteheads, newbranch,
                                              bool(inc))
--- a/mercurial/obsolete.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/obsolete.py	Mon Oct 22 21:54:36 2012 -0700
@@ -102,6 +102,37 @@
 _fmfsize = struct.calcsize(_fmfixed)
 _fnodesize = struct.calcsize(_fmnode)
 
+### obsolescence marker flag
+
+## bumpedfix flag
+#
+# When a changeset A' succeed to a changeset A which became public, we call A'
+# "bumped" because it's a successors of a public changesets
+#
+# o    A' (bumped)
+# |`:
+# | o  A
+# |/
+# o    Z
+#
+# The way to solve this situation is to create a new changeset Ad as children
+# of A. This changeset have the same content than A'. So the diff from A to A'
+# is the same than the diff from A to Ad. Ad is marked as a successors of A'
+#
+# o   Ad
+# |`:
+# | x A'
+# |'|
+# o | A
+# |/
+# o Z
+#
+# But by transitivity Ad is also a successors of A. To avoid having Ad marked
+# as bumped too, we add the `bumpedfix` flag to the marker. <A', (Ad,)>.
+# This flag mean that the successors are an interdiff that fix the bumped
+# situation, breaking the transitivity of "bumped" here.
+bumpedfix = 1
+
 def _readmarkers(data):
     """Read and enumerate markers from raw data"""
     off = 0
@@ -351,22 +382,37 @@
     for data in ctx._repo.obsstore.successors.get(ctx.node(), ()):
         yield marker(ctx._repo, data)
 
-def anysuccessors(obsstore, node):
-    """Yield every successor of <node>
+def allsuccessors(obsstore, nodes, ignoreflags=0):
+    """Yield node for every successor of <nodes>.
+
+    Some successors may be unknown locally.
 
     This is a linear yield unsuited to detecting split changesets."""
-    remaining = set([node])
+    remaining = set(nodes)
     seen = set(remaining)
     while remaining:
         current = remaining.pop()
         yield current
         for mark in obsstore.successors.get(current, ()):
+            # ignore marker flagged with with specified flag
+            if mark[2] & ignoreflags:
+                continue
             for suc in mark[1]:
                 if suc not in seen:
                     seen.add(suc)
                     remaining.add(suc)
 
-# mapping of 'set-name' -> <function to computer this set>
+def _knownrevs(repo, nodes):
+    """yield revision numbers of known nodes passed in parameters
+
+    Unknown revisions are silently ignored."""
+    torev = repo.changelog.nodemap.get
+    for n in nodes:
+        rev = torev(n)
+        if rev is not None:
+            yield rev
+
+# mapping of 'set-name' -> <function to compute this set>
 cachefuncs = {}
 def cachefor(name):
     """Decorator to register a function as computing the cache for a set"""
@@ -376,7 +422,7 @@
         return func
     return decorator
 
-def getobscache(repo, name):
+def getrevs(repo, name):
     """Return the set of revision that belong to the <name> set
 
     Such access may compute the set and cache it for future use"""
@@ -430,6 +476,19 @@
     """the set of obsolete parents without non obsolete descendants"""
     return set(repo.revs('obsolete() - obsolete()::unstable()'))
 
+
+@cachefor('bumped')
+def _computebumpedset(repo):
+    """the set of revs trying to obsolete public revisions"""
+    # get all possible bumped changesets
+    tonode = repo.changelog.node
+    publicnodes = (tonode(r) for r in repo.revs('public()'))
+    successors = allsuccessors(repo.obsstore, publicnodes,
+                               ignoreflags=bumpedfix)
+    # revision public or already obsolete don't count as bumped
+    query = '%ld - obsolete() - public()'
+    return set(repo.revs(query, _knownrevs(repo, successors)))
+
 def createmarkers(repo, relations, flag=0, metadata=None):
     """Add obsolete markers between changesets in a repo
 
--- a/mercurial/revset.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/revset.py	Mon Oct 22 21:54:36 2012 -0700
@@ -41,7 +41,7 @@
         return
 
     seen = set(revs)
-    for i in xrange(first + 1, len(cl)):
+    for i in cl.revs(first + 1):
         for x in cl.parentrevs(i)[:cut]:
             if x != nullrev and x in seen:
                 seen.add(i)
@@ -422,6 +422,17 @@
     s = set(s)
     return [r for r in subset if r in s or repo[r].branch() in b]
 
+def bumped(repo, subset, x):
+    """``bumped()``
+    Mutable changesets marked as successors of public changesets.
+
+    Only non-public and non-obsolete changesets can be `bumped`.
+    """
+    # i18n: "bumped" is a keyword
+    getargs(x, 0, 0, _("bumped takes no arguments"))
+    bumped = obsmod.getrevs(repo, 'bumped')
+    return [r for r in subset if r in bumped]
+
 def checkstatus(repo, subset, pat, field):
     m = None
     s = []
@@ -622,7 +633,7 @@
     """
     # i18n: "extinct" is a keyword
     getargs(x, 0, 0, _("extinct takes no arguments"))
-    extincts = obsmod.getobscache(repo, 'extinct')
+    extincts = obsmod.getrevs(repo, 'extinct')
     return [r for r in subset if r in extincts]
 
 def extra(repo, subset, x):
@@ -977,7 +988,7 @@
     Mutable changeset with a newer version."""
     # i18n: "obsolete" is a keyword
     getargs(x, 0, 0, _("obsolete takes no arguments"))
-    obsoletes = obsmod.getobscache(repo, 'obsolete')
+    obsoletes = obsmod.getrevs(repo, 'obsolete')
     return [r for r in subset if r in obsoletes]
 
 def origin(repo, subset, x):
@@ -1209,7 +1220,7 @@
     # i18n: "matching" is a keyword
     l = getargs(x, 1, 2, _("matching takes 1 or 2 arguments"))
 
-    revs = getset(repo, xrange(len(repo)), l[0])
+    revs = getset(repo, repo.changelog, l[0])
 
     fieldlist = ['metadata']
     if len(l) > 1:
@@ -1307,7 +1318,7 @@
     """``roots(set)``
     Changesets in set with no parent changeset in set.
     """
-    s = set(getset(repo, xrange(len(repo)), x))
+    s = set(getset(repo, repo.changelog, x))
     subset = [r for r in subset if r in s]
     cs = _children(repo, subset, s)
     return [r for r in subset if r not in cs]
@@ -1456,7 +1467,7 @@
     """
     # i18n: "unstable" is a keyword
     getargs(x, 0, 0, _("unstable takes no arguments"))
-    unstables = obsmod.getobscache(repo, 'unstable')
+    unstables = obsmod.getrevs(repo, 'unstable')
     return [r for r in subset if r in unstables]
 
 
@@ -1492,6 +1503,7 @@
     "bookmark": bookmark,
     "branch": branch,
     "branchpoint": branchpoint,
+    "bumped": bumped,
     "children": children,
     "closed": closed,
     "contains": contains,
--- a/mercurial/scmutil.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/scmutil.py	Mon Oct 22 21:54:36 2012 -0700
@@ -27,6 +27,14 @@
     else:
         ui.status(_("no changes found\n"))
 
+def checknewlabel(repo, lbl, kind):
+    if lbl in ['tip', '.', 'null']:
+        raise util.Abort(_("the name '%s' is reserved") % lbl)
+    for c in (':', '\0', '\n', '\r'):
+        if c in lbl:
+            raise util.Abort(_("%r cannot be used in a %s name") %
+                               (c, kind))
+
 def checkfilename(f):
     '''Check that the filename f is an acceptable filename for a tracked file'''
     if '\r' in f or '\n' in f:
@@ -340,21 +348,33 @@
 
 opener = vfs
 
-class filtervfs(abstractvfs):
+class auditvfs(object):
+    def __init__(self, vfs):
+        self.vfs = vfs
+
+    def _getmustaudit(self):
+        return self.vfs.mustaudit
+
+    def _setmustaudit(self, onoff):
+        self.vfs.mustaudit = onoff
+
+    mustaudit = property(_getmustaudit, _setmustaudit)
+
+class filtervfs(abstractvfs, auditvfs):
     '''Wrapper vfs for filtering filenames with a function.'''
 
-    def __init__(self, opener, filter):
+    def __init__(self, vfs, filter):
+        auditvfs.__init__(self, vfs)
         self._filter = filter
-        self._orig = opener
 
     def __call__(self, path, *args, **kwargs):
-        return self._orig(self._filter(path), *args, **kwargs)
+        return self.vfs(self._filter(path), *args, **kwargs)
 
     def join(self, path):
         if path:
-            return self._orig.join(self._filter(path))
+            return self.vfs.join(self._filter(path))
         else:
-            return self._orig.join(path)
+            return self.vfs.join(path)
 
 filteropener = filtervfs
 
--- a/mercurial/store.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/mercurial/store.py	Mon Oct 22 21:54:36 2012 -0700
@@ -436,20 +436,12 @@
             self._load()
         return iter(self.entries)
 
-class _fncachevfs(scmutil.abstractvfs):
+class _fncachevfs(scmutil.abstractvfs, scmutil.auditvfs):
     def __init__(self, vfs, fnc, encode):
-        self.vfs = vfs
+        scmutil.auditvfs.__init__(self, vfs)
         self.fncache = fnc
         self.encode = encode
 
-    def _getmustaudit(self):
-        return self.vfs.mustaudit
-
-    def _setmustaudit(self, onoff):
-        self.vfs.mustaudit = onoff
-
-    mustaudit = property(_getmustaudit, _setmustaudit)
-
     def __call__(self, path, mode='r', *args, **kw):
         if mode not in ('r', 'rb') and path.startswith('data/'):
             self.fncache.add(path)
--- a/tests/run-tests.py	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/run-tests.py	Mon Oct 22 21:54:36 2012 -0700
@@ -476,11 +476,8 @@
     py3kswitch = options.py3k_warnings and ' -3' or ''
     cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
     vlog("# Running", cmd)
-    return run(cmd, wd, options, replacements)
-
-def shtest(test, wd, options, replacements):
-    cmd = '%s "%s"' % (options.shell, test)
-    vlog("# Running", cmd)
+    if os.name == 'nt':
+        replacements.append((r'\r\n', '\n'))
     return run(cmd, wd, options, replacements)
 
 needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search
@@ -872,10 +869,7 @@
         runner = tsttest
         ref = testpath
     else:
-        # do not try to run non-executable programs
-        if not os.access(testpath, os.X_OK):
-            return skip("not executable")
-        runner = shtest
+        return skip("unknown test type")
 
     # Make a tmp subdirectory to work in
     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
--- a/tests/test-bookmarks.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-bookmarks.t	Mon Oct 22 21:54:36 2012 -0700
@@ -214,14 +214,29 @@
 
   $ hg bookmark '
   > '
-  abort: bookmark name cannot contain newlines
+  abort: bookmark names cannot consist entirely of whitespace
   [255]
 
   $ hg bookmark -m Z '
   > '
-  abort: bookmark name cannot contain newlines
+  abort: bookmark names cannot consist entirely of whitespace
+  [255]
+
+bookmark with reserved name
+
+  $ hg bookmark tip
+  abort: the name 'tip' is reserved
   [255]
 
+  $ hg bookmark .
+  abort: the name '.' is reserved
+  [255]
+
+  $ hg bookmark null
+  abort: the name 'null' is reserved
+  [255]
+
+
 bookmark with existing name
 
   $ hg bookmark Z
@@ -287,7 +302,12 @@
 invalid bookmark
 
   $ hg bookmark 'foo:bar'
-  abort: bookmark 'foo:bar' contains illegal character
+  abort: ':' cannot be used in a bookmark name
+  [255]
+
+  $ hg bookmark 'foo
+  > bar'
+  abort: '\n' cannot be used in a bookmark name
   [255]
 
 the bookmark extension should be ignored now that it is part of core
--- a/tests/test-branches.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-branches.t	Mon Oct 22 21:54:36 2012 -0700
@@ -45,6 +45,8 @@
   (branches are permanent and global, did you want a bookmark?)
   $ hg commit -d '5 0' -m "Adding c branch"
 
+reserved names
+
   $ hg branch tip
   abort: the name 'tip' is reserved
   [255]
@@ -55,6 +57,17 @@
   abort: the name '.' is reserved
   [255]
 
+invalid characters
+
+  $ hg branch 'foo:bar'
+  abort: ':' cannot be used in a branch name
+  [255]
+
+  $ hg branch 'foo
+  > bar'
+  abort: '\n' cannot be used in a branch name
+  [255]
+
   $ echo 'd' >d
   $ hg add d
   $ hg branch 'a branch name much longer than the default justification used by branches'
--- a/tests/test-commit-amend.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-commit-amend.t	Mon Oct 22 21:54:36 2012 -0700
@@ -32,12 +32,12 @@
 
   $ echo a >> a
   $ hg ci --amend -m 'amend base1'
-  pretxncommit 9cd25b479c51be2f4ed2c38e7abdf7ce67d8e0dc
-  9cd25b479c51 tip
+  pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
+  43f1ba15f28a tip
   saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg (glob)
   $ echo 'pretxncommit.foo = ' >> $HGRCPATH
   $ hg diff -c .
-  diff -r ad120869acf0 -r 9cd25b479c51 a
+  diff -r ad120869acf0 -r 43f1ba15f28a a
   --- a/a	Thu Jan 01 00:00:00 1970 +0000
   +++ b/a	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,3 @@
@@ -45,7 +45,7 @@
   +a
   +a
   $ hg log
-  changeset:   1:9cd25b479c51
+  changeset:   1:43f1ba15f28a
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -62,36 +62,36 @@
   $ echo b > b
   $ hg ci --amend -Am 'amend base1 new file'
   adding b
-  saved backup bundle to $TESTTMP/.hg/strip-backup/9cd25b479c51-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-amend-backup.hg (glob)
 
 Remove file that was added in amended commit:
 
   $ hg rm b
   $ hg ci --amend -m 'amend base1 remove new file'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/e2bb3ecffd2f-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/b8e3cb2b3882-amend-backup.hg (glob)
 
   $ hg cat b
-  b: no such file in rev 664a9b2d60cd
+  b: no such file in rev 74609c7f506e
   [1]
 
 No changes, just a different message:
 
   $ hg ci -v --amend -m 'no changes, new message'
-  amending changeset 664a9b2d60cd
-  copying changeset 664a9b2d60cd to ad120869acf0
+  amending changeset 74609c7f506e
+  copying changeset 74609c7f506e to ad120869acf0
   a
-  stripping amended changeset 664a9b2d60cd
+  stripping amended changeset 74609c7f506e
   1 changesets found
-  saved backup bundle to $TESTTMP/.hg/strip-backup/664a9b2d60cd-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/74609c7f506e-amend-backup.hg (glob)
   1 changesets found
   adding branch
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  committed changeset 1:ea6e356ff2ad
+  committed changeset 1:1cd866679df8
   $ hg diff -c .
-  diff -r ad120869acf0 -r ea6e356ff2ad a
+  diff -r ad120869acf0 -r 1cd866679df8 a
   --- a/a	Thu Jan 01 00:00:00 1970 +0000
   +++ b/a	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,3 @@
@@ -99,7 +99,7 @@
   +a
   +a
   $ hg log
-  changeset:   1:ea6e356ff2ad
+  changeset:   1:1cd866679df8
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -119,12 +119,12 @@
 Test -u/-d:
 
   $ hg ci --amend -u foo -d '1 0'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/ea6e356ff2ad-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/1cd866679df8-amend-backup.hg (glob)
   $ echo a >> a
   $ hg ci --amend -u foo -d '1 0'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/377b91ce8b56-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/780e6f23e03d-amend-backup.hg (glob)
   $ hg log -r .
-  changeset:   1:2c94e4a5756f
+  changeset:   1:5f357c7560ab
   tag:         tip
   user:        foo
   date:        Thu Jan 01 00:00:01 1970 +0000
@@ -139,8 +139,8 @@
   > echo "another precious commit message" > "$1"
   > __EOF__
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
-  amending changeset 2c94e4a5756f
-  copying changeset 2c94e4a5756f to ad120869acf0
+  amending changeset 5f357c7560ab
+  copying changeset 5f357c7560ab to ad120869acf0
   no changes, new message
   
   
@@ -151,24 +151,24 @@
   HG: branch 'default'
   HG: changed a
   a
-  stripping amended changeset 2c94e4a5756f
+  stripping amended changeset 5f357c7560ab
   1 changesets found
-  saved backup bundle to $TESTTMP/.hg/strip-backup/2c94e4a5756f-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/5f357c7560ab-amend-backup.hg (glob)
   1 changesets found
   adding branch
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  committed changeset 1:ffb49186f961
+  committed changeset 1:7ab3bf440b54
 
 Same, but with changes in working dir (different code path):
 
   $ echo a >> a
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
-  amending changeset ffb49186f961
+  amending changeset 7ab3bf440b54
   a
-  copying changeset a4f8a65b7c6a to ad120869acf0
+  copying changeset a0ea9b1a4c8c to ad120869acf0
   another precious commit message
   
   
@@ -179,21 +179,21 @@
   HG: branch 'default'
   HG: changed a
   a
-  stripping intermediate changeset a4f8a65b7c6a
-  stripping amended changeset ffb49186f961
+  stripping intermediate changeset a0ea9b1a4c8c
+  stripping amended changeset 7ab3bf440b54
   2 changesets found
-  saved backup bundle to $TESTTMP/.hg/strip-backup/ffb49186f961-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/7ab3bf440b54-amend-backup.hg (glob)
   1 changesets found
   adding branch
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  committed changeset 1:fb6cca43446f
+  committed changeset 1:ea22a388757c
 
   $ rm editor.sh
   $ hg log -r .
-  changeset:   1:fb6cca43446f
+  changeset:   1:ea22a388757c
   tag:         tip
   user:        foo
   date:        Thu Jan 01 00:00:01 1970 +0000
@@ -205,16 +205,16 @@
   $ hg book book1
   $ hg book book2
   $ hg ci --amend -m 'move bookmarks'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/fb6cca43446f-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/ea22a388757c-amend-backup.hg (glob)
   $ hg book
-     book1                     1:0cf1c7a51bcf
-   * book2                     1:0cf1c7a51bcf
+     book1                     1:6cec5aa930e2
+   * book2                     1:6cec5aa930e2
   $ echo a >> a
   $ hg ci --amend -m 'move bookmarks'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/0cf1c7a51bcf-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/6cec5aa930e2-amend-backup.hg (glob)
   $ hg book
-     book1                     1:7344472bd951
-   * book2                     1:7344472bd951
+     book1                     1:48bb6e53a15f
+   * book2                     1:48bb6e53a15f
 
   $ echo '[defaults]' >> $HGRCPATH
   $ echo "commit=-d '0 0'" >> $HGRCPATH
@@ -230,9 +230,9 @@
   marked working directory as branch default
   (branches are permanent and global, did you want a bookmark?)
   $ hg ci --amend -m 'back to default'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/1661ca36a2db-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/8ac881fbf49d-amend-backup.hg (glob)
   $ hg branches
-  default                        2:f24ee5961967
+  default                        2:ce12b0b57d46
 
 Close branch:
 
@@ -255,9 +255,9 @@
   reopening closed branch head 4
   $ echo b >> b
   $ hg ci --amend --close-branch
-  saved backup bundle to $TESTTMP/.hg/strip-backup/5e302dcc12b8-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-amend-backup.hg (glob)
   $ hg branches
-  default                        2:f24ee5961967
+  default                        2:ce12b0b57d46
 
 Refuse to amend merges:
 
@@ -279,7 +279,7 @@
   $ hg ci -m 'b -> c'
   $ hg mv c d
   $ hg ci --amend -m 'b -> d'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/9c207120aa98-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-amend-backup.hg (glob)
   $ hg st --rev '.^' --copies d
   A d
     b
@@ -287,7 +287,7 @@
   $ hg ci -m 'e = d'
   $ hg cp e f
   $ hg ci --amend -m 'f = d'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/fda2b3b27b22-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-amend-backup.hg (glob)
   $ hg st --rev '.^' --copies f
   A f
     d
@@ -298,7 +298,7 @@
   $ hg cp a f
   $ mv f.orig f
   $ hg ci --amend -m replacef
-  saved backup bundle to $TESTTMP/.hg/strip-backup/20a7413547f9-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-amend-backup.hg (glob)
   $ hg st --change . --copies
   $ hg log -r . --template "{file_copies}\n"
   
@@ -310,7 +310,7 @@
   adding g
   $ hg mv g h
   $ hg ci --amend
-  saved backup bundle to $TESTTMP/.hg/strip-backup/5daa77a5d616-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-amend-backup.hg (glob)
   $ hg st --change . --copies h
   A h
   $ hg log -r . --template "{file_copies}\n"
@@ -330,11 +330,11 @@
   $ echo a >> a
   $ hg ci -ma
   $ hg ci --amend -m "a'"
-  saved backup bundle to $TESTTMP/.hg/strip-backup/167f8e3031df-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-amend-backup.hg (glob)
   $ hg log -r . --template "{branch}\n"
   a
   $ hg ci --amend -m "a''"
-  saved backup bundle to $TESTTMP/.hg/strip-backup/ceac1a44c806-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-amend-backup.hg (glob)
   $ hg log -r . --template "{branch}\n"
   a
 
@@ -351,8 +351,9 @@
   $ hg graft 12
   grafting revision 12
   $ hg ci --amend -m 'graft amend'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/18a5124daf7a-amend-backup.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob)
   $ hg log -r . --debug | grep extra
+  extra:       amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e
   extra:       branch=a
   extra:       source=2647734878ef0236dda712fae9c1651cf694ea8a
 
@@ -391,26 +392,26 @@
   $ hg id -n
   14
   $ hg log -Gl 3 --style=compact
-  @  14[tip]:11   43df5a5434ad   1970-01-01 00:00 +0000   test
+  @  14[tip]:11   b650e6ee8614   1970-01-01 00:00 +0000   test
   |    babar
   |
   | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
   | |    fork
   | |
-  o |  11   7e09f708a0e9   1970-01-01 00:00 +0000   test
+  o |  11   3334b7925910   1970-01-01 00:00 +0000   test
   | |    a''
   | |
   $ hg log -Gl 4 --hidden --style=compact
-  @  14[tip]:11   43df5a5434ad   1970-01-01 00:00 +0000   test
+  @  14[tip]:11   b650e6ee8614   1970-01-01 00:00 +0000   test
   |    babar
   |
-  | x  13:11   175fafee6f44   1970-01-01 00:00 +0000   test
+  | x  13:11   68ff8ff97044   1970-01-01 00:00 +0000   test
   |/     amend for phase
   |
   | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
   | |    fork
   | |
-  o |  11   7e09f708a0e9   1970-01-01 00:00 +0000   test
+  o |  11   3334b7925910   1970-01-01 00:00 +0000   test
   | |    a''
   | |
 
@@ -422,23 +423,34 @@
   $ echo 'babar' >> a
   $ hg commit --amend
   $ hg log -Gl 6 --hidden --style=compact
-  @  16[tip]:11   31e0a4a1b04a   1970-01-01 00:00 +0000   test
+  @  16[tip]:11   9f9e9bccf56c   1970-01-01 00:00 +0000   test
   |    babar
   |
-  | x  15   053c696ada75   1970-01-01 00:00 +0000   test
-  | |    temporary amend commit for 43df5a5434ad
+  | x  15   90fef497c56f   1970-01-01 00:00 +0000   test
+  | |    temporary amend commit for b650e6ee8614
   | |
-  | x  14:11   43df5a5434ad   1970-01-01 00:00 +0000   test
+  | x  14:11   b650e6ee8614   1970-01-01 00:00 +0000   test
   |/     babar
   |
-  | x  13:11   175fafee6f44   1970-01-01 00:00 +0000   test
+  | x  13:11   68ff8ff97044   1970-01-01 00:00 +0000   test
   |/     amend for phase
   |
   | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
   | |    fork
   | |
-  o |  11   7e09f708a0e9   1970-01-01 00:00 +0000   test
+  o |  11   3334b7925910   1970-01-01 00:00 +0000   test
   | |    a''
   | |
 
 
+Test that amend does not make it easy to create obsoletescence cycle
+---------------------------------------------------------------------
+
+
+  $ hg id -r 14
+  b650e6ee8614 (a)
+  $ hg revert -ar 14
+  reverting a
+  $ hg commit --amend
+  $ hg id
+  b99e5df575f7 (a) tip
--- a/tests/test-convert-filemap.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-convert-filemap.t	Mon Oct 22 21:54:36 2012 -0700
@@ -235,8 +235,8 @@
   > rename dir dir2//dir3
   > include foo
   > include copied
-  > rename foo foo2
-  > rename copied copied2
+  > rename foo foo2/
+  > rename copied ./copied2
   > exclude dir/subdir
   > include dir/subdir/file3
   > EOF
@@ -258,7 +258,7 @@
   |
   o  1 "1: add bar quux; copy foo to copied" files: copied2
   |
-  o  0 "0: add foo baz dir/" files: dir2//dir3/file dir2//dir3/subdir/file3 foo2
+  o  0 "0: add foo baz dir/" files: dir2/dir3/file dir2/dir3/subdir/file3 foo2
   
   $ hg -R renames.repo verify
   checking changesets
@@ -269,8 +269,8 @@
 
   $ hg -R renames.repo manifest --debug
   d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644   copied2
-  3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2//dir3/file
-  5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2//dir3/subdir/file3
+  3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2/dir3/file
+  5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2/dir3/subdir/file3
   9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo2
   $ hg --cwd renames.repo debugrename copied2
   copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
@@ -294,10 +294,8 @@
   > include
   > EOF
   $ hg -q convert --filemap errors.fmap source errors.repo
-  errors.fmap:1: superfluous / in exclude 'dir/'
   errors.fmap:3: superfluous / in include '/dir'
   errors.fmap:3: superfluous / in rename '/dir'
-  errors.fmap:3: superfluous / in exclude 'dir//dir'
   errors.fmap:4: unknown directive 'out of sync'
   errors.fmap:5: path to exclude is missing
   abort: errors in filemap
--- a/tests/test-convert.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-convert.t	Mon Oct 22 21:54:36 2012 -0700
@@ -261,7 +261,7 @@
       --datesort         try to sort changesets by date
       --sourcesort       preserve source changesets order
   
-  use "hg -v help convert" to show more info
+  use "hg -v help convert" to show the global options
   $ hg init a
   $ cd a
   $ echo a > a
--- a/tests/test-debugcomplete.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-debugcomplete.t	Mon Oct 22 21:54:36 2012 -0700
@@ -237,7 +237,7 @@
   debugindexdot: 
   debuginstall: 
   debugknown: 
-  debugobsolete: date, user
+  debugobsolete: flags, date, user
   debugpushkey: 
   debugpvec: 
   debugrebuildstate: rev
--- a/tests/test-encoding-align.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-encoding-align.t	Mon Oct 22 21:54:36 2012 -0700
@@ -59,7 +59,7 @@
                           \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
                           \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
   
-  use "hg -v help showoptlist" to show more info
+  use "hg -v help showoptlist" to show the global options
 
 
   $ rm -f s; touch s
--- a/tests/test-encoding-textwrap.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-encoding-textwrap.t	Mon Oct 22 21:54:36 2012 -0700
@@ -67,7 +67,7 @@
       \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf\x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf\x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf (esc)
       \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf (esc)
   
-  use "hg -v help show_full_ja" to show more info
+  use "hg -v help show_full_ja" to show the global options
 
 (1-2) display Japanese full-width characters in utf-8
 
@@ -82,7 +82,7 @@
       \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 (esc)
       \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 (esc)
   
-  use "hg -v help show_full_ja" to show more info
+  use "hg -v help show_full_ja" to show the global options
 
 
 (1-3) display Japanese half-width characters in cp932
@@ -98,7 +98,7 @@
       \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 (esc)
       \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 (esc)
   
-  use "hg -v help show_half_ja" to show more info
+  use "hg -v help show_half_ja" to show the global options
 
 (1-4) display Japanese half-width characters in utf-8
 
@@ -113,7 +113,7 @@
       \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 (esc)
       \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 (esc)
   
-  use "hg -v help show_half_ja" to show more info
+  use "hg -v help show_half_ja" to show the global options
 
 
 
@@ -134,7 +134,7 @@
       \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
       \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
   
-  use "hg -v help show_ambig_ja" to show more info
+  use "hg -v help show_ambig_ja" to show the global options
 
 (2-1-2) display Japanese ambiguous-width characters in utf-8
 
@@ -149,7 +149,7 @@
       \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
       \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
   
-  use "hg -v help show_ambig_ja" to show more info
+  use "hg -v help show_ambig_ja" to show the global options
 
 (2-1-3) display Russian ambiguous-width characters in cp1251
 
@@ -164,7 +164,7 @@
       \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
       \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
   
-  use "hg -v help show_ambig_ru" to show more info
+  use "hg -v help show_ambig_ru" to show the global options
 
 (2-1-4) display Russian ambiguous-width characters in utf-8
 
@@ -179,7 +179,7 @@
       \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
       \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
   
-  use "hg -v help show_ambig_ru" to show more info
+  use "hg -v help show_ambig_ru" to show the global options
 
 
 (2-2) treat width of ambiguous characters as wide
@@ -200,7 +200,7 @@
       \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
       \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
   
-  use "hg -v help show_ambig_ja" to show more info
+  use "hg -v help show_ambig_ja" to show the global options
 
 (2-2-2) display Japanese ambiguous-width characters in utf-8
 
@@ -218,7 +218,7 @@
       \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
       \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
   
-  use "hg -v help show_ambig_ja" to show more info
+  use "hg -v help show_ambig_ja" to show the global options
 
 (2-2-3) display Russian ambiguous-width characters in cp1251
 
@@ -236,7 +236,7 @@
       \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
       \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
   
-  use "hg -v help show_ambig_ru" to show more info
+  use "hg -v help show_ambig_ru" to show the global options
 
 (2-2-4) display Russian ambiguous-width charactes in utf-8
 
@@ -254,6 +254,6 @@
       \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
       \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
   
-  use "hg -v help show_ambig_ru" to show more info
+  use "hg -v help show_ambig_ru" to show the global options
 
   $ cd ..
--- a/tests/test-extdiff.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-extdiff.t	Mon Oct 22 21:54:36 2012 -0700
@@ -47,7 +47,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help falabala" to show more info
+  use "hg -v help falabala" to show the global options
 
   $ hg ci -d '0 0' -mtest1
 
--- a/tests/test-extension.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-extension.t	Mon Oct 22 21:54:36 2012 -0700
@@ -269,7 +269,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help extdiff" to show more info
+  use "hg -v help extdiff" to show the global options
 
   $ hg help --extension extdiff
   extdiff extension - command to allow external programs to compare revisions
@@ -372,7 +372,7 @@
   
   multirevs command
   
-  use "hg -v help multirevs" to show more info
+  use "hg -v help multirevs" to show the global options
 
   $ hg multirevs
   hg multirevs: invalid arguments
--- a/tests/test-grep.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-grep.t	Mon Oct 22 21:54:36 2012 -0700
@@ -32,9 +32,9 @@
 
   $ hg --config extensions.color= grep --config color.mode=ansi \
   >     --color=always port port
-  port:4:ex\x1b[0;31;1mport\x1b[0m (esc)
-  port:4:va\x1b[0;31;1mport\x1b[0might (esc)
-  port:4:im\x1b[0;31;1mport\x1b[0m/export (esc)
+  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc)
+  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc)
+  \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/export (esc)
 
 all
 
@@ -51,6 +51,8 @@
 
 other
 
+  $ hg grep -l port port
+  port:4
   $ hg grep import port
   port:4:import/export
 
--- a/tests/test-help.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-help.t	Mon Oct 22 21:54:36 2012 -0700
@@ -279,7 +279,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help add" to show more info
+  use "hg -v help add" to show more complete help and the global options
 
 Verbose help for add
 
@@ -397,7 +397,7 @@
   
       Returns 0 on success, 1 if errors are encountered.
   
-  use "hg -v help verify" to show more info
+  use "hg -v help verify" to show the global options
 
   $ hg help diff
   hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
@@ -450,7 +450,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help diff" to show more info
+  use "hg -v help diff" to show more complete help and the global options
 
   $ hg help status
   hg status [OPTION]... [FILE]...
@@ -513,7 +513,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help status" to show more info
+  use "hg -v help status" to show more complete help and the global options
 
   $ hg -q help status
   hg status [OPTION]... [FILE]...
@@ -599,7 +599,7 @@
   
   (no help text available)
   
-  use "hg -v help nohelp" to show more info
+  use "hg -v help nohelp" to show the global options
 
   $ hg help -k nohelp
   Commands:
@@ -805,6 +805,75 @@
   
    qclone clone main and patch repository at same time
 
+Test omit indicating for help
+
+  $ cat > addverboseitems.py <<EOF
+  > '''extension to test omit indicating.
+  > 
+  > This paragraph is never omitted (for extension)
+  > 
+  > .. container:: verbose
+  > 
+  >   This paragraph is omitted,
+  >   if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
+  > 
+  > This paragraph is never omitted, too (for extension)
+  > '''
+  > 
+  > from mercurial import help, commands
+  > testtopic = """This paragraph is never omitted (for topic).
+  > 
+  > .. container:: verbose
+  > 
+  >   This paragraph is omitted,
+  >   if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
+  > 
+  > This paragraph is never omitted, too (for topic)
+  > """
+  > def extsetup(ui):
+  >     help.helptable.append((["topic-containing-verbose"],
+  >                            "This is the topic to test omit indicating.",
+  >                            lambda : testtopic))
+  > EOF
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
+  $ hg help addverboseitems
+  addverboseitems extension - extension to test omit indicating.
+  
+  This paragraph is never omitted (for extension)
+  
+  This paragraph is never omitted, too (for extension)
+  
+  use "hg help -v addverboseitems" to show more complete help
+  
+  no commands defined
+  $ hg help -v addverboseitems
+  addverboseitems extension - extension to test omit indicating.
+  
+  This paragraph is never omitted (for extension)
+  
+  This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
+  
+  This paragraph is never omitted, too (for extension)
+  
+  no commands defined
+  $ hg help topic-containing-verbose
+  This is the topic to test omit indicating.
+  
+      This paragraph is never omitted (for topic).
+  
+      This paragraph is never omitted, too (for topic)
+  
+  use "hg help -v topic-containing-verbose" to show more complete help
+  $ hg help -v topic-containing-verbose
+  This is the topic to test omit indicating.
+  
+      This paragraph is never omitted (for topic).
+  
+      This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
+  
+      This paragraph is never omitted, too (for topic)
+
 Test usage of section marks in help documents
 
   $ cd "$TESTDIR"/../doc
--- a/tests/test-issue2137.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-issue2137.t	Mon Oct 22 21:54:36 2012 -0700
@@ -12,15 +12,15 @@
   > 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)
+  >     class wraprepo(repo.__class__):
+  >         def commit(self, *args, **kwargs):
+  >             result = super(wraprepo, self).commit(*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
+  >     repo.__class__ = wraprepo
   > 
   > def extsetup(ui):
   >     revlog._maxinline = 8             # split out 00changelog.d early
--- a/tests/test-keyword.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-keyword.t	Mon Oct 22 21:54:36 2012 -0700
@@ -509,9 +509,9 @@
   $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
   overwriting a expanding keywords
   $ hg -q id
-  577e60613a88
+  67d8c481a6be
   $ head -1 a
-  expand $Id: a,v 577e60613a88 1970/01/01 00:00:15 test $
+  expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
 
   $ hg -q strip -n tip
 
--- a/tests/test-largefiles.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-largefiles.t	Mon Oct 22 21:54:36 2012 -0700
@@ -1627,3 +1627,87 @@
   .hglf/large2.dat
 
   $ cd ..
+
+issue3651: summary/outgoing with largefiles shows "no remote repo"
+unexpectedly
+
+  $ mkdir issue3651
+  $ cd issue3651
+
+  $ hg init src
+  $ echo a > src/a
+  $ hg -R src add --large src/a
+  $ hg -R src commit -m '#0'
+  Invoking status precommit hook
+  A a
+
+check messages when no remote repository is specified:
+"no remote repo" route for "hg outgoing --large" is not tested here,
+because it can't be reproduced easily.
+
+  $ hg init clone1
+  $ hg -R clone1 -q pull src
+  $ hg -R clone1 -q update
+  $ hg -R clone1 paths | grep default
+  [1]
+
+  $ hg -R clone1 summary --large
+  parent: 0:fc0bd45326d3 tip
+   #0
+  branch: default
+  commit: (clean)
+  update: (current)
+  largefiles: No remote repo
+
+check messages when there is no files to upload:
+
+  $ hg -q clone src clone2
+  $ hg -R clone2 paths | grep default
+  default = $TESTTMP/issue3651/src (glob)
+
+  $ hg -R clone2 summary --large
+  parent: 0:fc0bd45326d3 tip
+   #0
+  branch: default
+  commit: (clean)
+  update: (current)
+  searching for changes
+  largefiles: (no files to upload)
+  $ hg -R clone2 outgoing --large
+  comparing with $TESTTMP/issue3651/src (glob)
+  searching for changes
+  no changes found
+  searching for changes
+  largefiles: no files to upload
+  [1]
+
+check messages when there are files to upload:
+
+  $ echo b > clone2/b
+  $ hg -R clone2 add --large clone2/b
+  $ hg -R clone2 commit -m '#1'
+  Invoking status precommit hook
+  A b
+  $ hg -R clone2 summary --large
+  parent: 1:1acbe71ce432 tip
+   #1
+  branch: default
+  commit: (clean)
+  update: (current)
+  searching for changes
+  largefiles: 1 to upload
+  $ hg -R clone2 outgoing --large
+  comparing with $TESTTMP/issue3651/src (glob)
+  searching for changes
+  changeset:   1:1acbe71ce432
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     #1
+  
+  searching for changes
+  largefiles to upload:
+  b
+  
+
+  $ cd ..
--- a/tests/test-lfconvert.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-lfconvert.t	Mon Oct 22 21:54:36 2012 -0700
@@ -1,3 +1,5 @@
+  $ USERCACHE="$TESTTMP/cache"; export USERCACHE
+  $ mkdir "${USERCACHE}"
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > largefiles =
@@ -8,6 +10,7 @@
   > minsize = 0.5
   > patterns = **.other
   >     **.dat
+  > usercache=${USERCACHE}
   > EOF
 
 "lfconvert" works
@@ -270,3 +273,25 @@
   pass
 
   $ cd ..
+
+Avoid a traceback if a largefile isn't available (issue3519)
+
+Ensure the largefile can be cached in the source if necessary
+  $ hg clone -U largefiles-repo issue3519
+  $ rm "${USERCACHE}"/*
+  $ hg lfconvert --to-normal issue3519 normalized3519
+  initializing destination normalized3519
+
+Ensure the abort message is useful if a largefile is entirely unavailable
+  $ rm -rf normalized3519
+  $ rm "${USERCACHE}"/*
+  $ rm issue3519/.hg/largefiles/*
+  $ rm largefiles-repo/.hg/largefiles/*
+  $ hg lfconvert --to-normal issue3519 normalized3519
+  initializing destination normalized3519
+  large: can't get file locally
+  (no default or default-push path set in hgrc)
+  abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
+  [255]
+
+
--- a/tests/test-mq-qrefresh-interactive.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-mq-qrefresh-interactive.t	Mon Oct 22 21:54:36 2012 -0700
@@ -46,7 +46,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help qrefresh" to show more info
+  use "hg -v help qrefresh" to show the global options
 
 help qrefresh (record)
 
@@ -91,7 +91,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help qrefresh" to show more info
+  use "hg -v help qrefresh" to show the global options
 
   $ hg init a
   $ cd a
--- a/tests/test-obsolete-checkheads.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-obsolete-checkheads.t	Mon Oct 22 21:54:36 2012 -0700
@@ -38,6 +38,7 @@
 ==========================
 
 setup
+(we add the 1 flags to prevent bumped error during the test)
 
   $ mkcommit old
   $ hg push
@@ -50,7 +51,7 @@
   $ hg up -q '.^'
   $ mkcommit new
   created new head
-  $ hg debugobsolete `getid old` `getid new`
+  $ hg debugobsolete --flags 1 `getid old` `getid new`
   $ hg glog --hidden
   @  71e3228bffe1 (draft) add new
   |
--- a/tests/test-obsolete.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-obsolete.t	Mon Oct 22 21:54:36 2012 -0700
@@ -69,11 +69,11 @@
   $ mkcommit new_c
   created new head
   $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
-  $ hg debugobsolete `getid original_c`  `getid new_c` -d '56 12'
+  $ hg debugobsolete --flag 12 `getid original_c`  `getid new_c` -d '56 12'
   $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
   2:245bde4270cd add original_c
   $ hg debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
 
 do it again (it read the obsstore before adding new changeset)
 
@@ -83,7 +83,7 @@
   created new head
   $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
   $ hg debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
 
 Register two markers with a missing node
@@ -95,7 +95,7 @@
   $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
   $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
   $ hg debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
@@ -155,6 +155,67 @@
      summary:     add a
   
 
+And that bumped changeset are detected
+--------------------------------------
+
+If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
+note that the bumped changeset (5:5601fb93a350) is not a direct successor of
+the public changeset
+
+  $ hg log --hidden -r 'bumped()'
+  changeset:   5:5601fb93a350
+  tag:         tip
+  parent:      1:7c3bad9141dc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add new_3_c
+  
+
+And that we can't push bumped changeset
+
+  $ hg push ../tmpa
+  pushing to ../tmpa
+  searching for changes
+  abort: push includes bumped changeset: 5601fb93a350!
+  [255]
+
+Fixing "bumped" situation
+We need to create a clone of 5 and add a special marker with a flag
+
+  $ hg up '5^'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg revert -ar 5
+  adding new_3_c
+  $ hg ci -m 'add n3w_3_c'
+  created new head
+  $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
+  $ hg log -r 'bumped()'
+  $ hg log -G
+  @  changeset:   6:6f9641995072
+  |  tag:         tip
+  |  parent:      1:7c3bad9141dc
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     add n3w_3_c
+  |
+  | o  changeset:   2:245bde4270cd
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add original_c
+  |
+  o  changeset:   1:7c3bad9141dc
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     add b
+  |
+  o  changeset:   0:1f0dee641bb7
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     add a
+  
+
+
+
   $ cd ..
 
 Exchange Test
@@ -177,29 +238,32 @@
   added 4 changesets with 4 changes to 4 files (+1 heads)
   (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
 
 Rollback//Transaction support
 
   $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
   $ hg debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
   $ hg rollback -n
   repository tip rolled back to revision 3 (undo debugobsolete)
   $ hg rollback
   repository tip rolled back to revision 3 (undo debugobsolete)
   $ hg debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
 
   $ cd ..
 
@@ -214,10 +278,11 @@
   adding file changes
   added 4 changesets with 4 changes to 4 files (+1 heads)
   $ hg -R tmpd debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
 
 Check obsolete keys are exchanged only if source has an obsolete store
 
@@ -236,12 +301,18 @@
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg -R clone-dest log -G --hidden
-  @  changeset:   5:5601fb93a350
+  @  changeset:   6:6f9641995072
   |  tag:         tip
   |  parent:      1:7c3bad9141dc
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  summary:     add new_3_c
+  |  summary:     add n3w_3_c
+  |
+  | x  changeset:   5:5601fb93a350
+  |/   parent:      1:7c3bad9141dc
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add new_3_c
   |
   | x  changeset:   4:ca819180edb9
   |/   parent:      1:7c3bad9141dc
@@ -271,10 +342,11 @@
      summary:     add a
   
   $ hg -R clone-dest debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
 
 
 Destination repo have existing data
@@ -295,10 +367,11 @@
   (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg debugobsolete
   2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
 
 
 On push
@@ -309,10 +382,11 @@
   no changes found
   [1]
   $ hg -R ../tmpc debugobsolete
-  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
   cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
   2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
 
 detect outgoing obsolete and unstable
@@ -320,12 +394,12 @@
 
 
   $ hg glog
-  o  changeset:   3:5601fb93a350
+  o  changeset:   3:6f9641995072
   |  tag:         tip
   |  parent:      1:7c3bad9141dc
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  summary:     add new_3_c
+  |  summary:     add n3w_3_c
   |
   | o  changeset:   2:245bde4270cd
   |/   user:        test
@@ -342,34 +416,34 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add a
   
-  $ hg up 'desc("new_3_c")'
+  $ hg up 'desc("n3w_3_c")'
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ mkcommit original_d
   $ mkcommit original_e
   $ hg debugobsolete `getid original_d` -d '0 0'
   $ hg log -r 'obsolete()'
-  changeset:   4:7c694bff0650
+  changeset:   4:94b33453f93b
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add original_d
   
   $ hg glog -r '::unstable()'
-  @  changeset:   5:6e572121998e
+  @  changeset:   5:cda648ca50f5
   |  tag:         tip
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     add original_e
   |
-  x  changeset:   4:7c694bff0650
+  x  changeset:   4:94b33453f93b
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     add original_d
   |
-  o  changeset:   3:5601fb93a350
+  o  changeset:   3:6f9641995072
   |  parent:      1:7c3bad9141dc
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  summary:     add new_3_c
+  |  summary:     add n3w_3_c
   |
   o  changeset:   1:7c3bad9141dc
   |  user:        test
@@ -387,7 +461,7 @@
   $ hg push ../tmpc/ -r 'desc("original_d")'
   pushing to ../tmpc/
   searching for changes
-  abort: push includes an obsolete changeset: 7c694bff0650!
+  abort: push includes obsolete changeset: 94b33453f93b!
   [255]
 
 refuse to push unstable changeset
@@ -395,7 +469,7 @@
   $ hg push ../tmpc/
   pushing to ../tmpc/
   searching for changes
-  abort: push includes an unstable changeset: 6e572121998e!
+  abort: push includes unstable changeset: cda648ca50f5!
   [255]
 
 Test that extinct changeset are properly detected
@@ -423,18 +497,18 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add original_c
   
-  changeset:   3:5601fb93a350
+  changeset:   3:6f9641995072
   parent:      1:7c3bad9141dc
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     add new_3_c
+  summary:     add n3w_3_c
   
-  changeset:   4:7c694bff0650
+  changeset:   4:94b33453f93b
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add original_d
   
-  changeset:   5:6e572121998e
+  changeset:   5:cda648ca50f5
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -459,22 +533,22 @@
 Do not warn about new head when the new head is a successors of a remote one
 
   $ hg glog
-  @  changeset:   5:6e572121998e
+  @  changeset:   5:cda648ca50f5
   |  tag:         tip
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     add original_e
   |
-  x  changeset:   4:7c694bff0650
+  x  changeset:   4:94b33453f93b
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     add original_d
   |
-  o  changeset:   3:5601fb93a350
+  o  changeset:   3:6f9641995072
   |  parent:      1:7c3bad9141dc
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  summary:     add new_3_c
+  |  summary:     add n3w_3_c
   |
   | o  changeset:   2:245bde4270cd
   |/   user:        test
@@ -491,7 +565,7 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add a
   
-  $ hg up -q 'desc(new_3_c)'
+  $ hg up -q 'desc(n3w_3_c)'
   $ mkcommit obsolete_e
   created new head
   $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
@@ -508,10 +582,10 @@
   $ echo '[extensions]' >> $HGRCPATH
   $ echo "obs=!" >> $HGRCPATH
   $ hg log -r tip
-  obsolete feature not enabled but 7 markers found!
-  changeset:   6:d6a026544050
+  obsolete feature not enabled but 8 markers found!
+  changeset:   6:3de5eca88c00
   tag:         tip
-  parent:      3:5601fb93a350
+  parent:      3:6f9641995072
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add obsolete_e
--- a/tests/test-push-http.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-push-http.t	Mon Oct 22 21:54:36 2012 -0700
@@ -109,11 +109,13 @@
 
 expect push success, phase change failure
 
-  $ echo '[web]' > .hg/hgrc
-  $ echo 'push_ssl = false' >> .hg/hgrc
-  $ echo 'allow_push = *' >> .hg/hgrc
-  $ echo '[hooks]' >> .hg/hgrc
-  $ echo 'prepushkey = python "$TESTDIR/printenv.py" prepushkey 1' >> .hg/hgrc
+  $ cat > .hg/hgrc <<EOF
+  > [web]
+  > push_ssl = false
+  > allow_push = *
+  > [hooks]
+  > prepushkey = python "$TESTDIR/printenv.py" prepushkey 1
+  > EOF
   $ req
   pushing to http://localhost:$HGPORT/
   searching for changes
@@ -127,7 +129,7 @@
 
 expect phase change success
 
-  $ echo 'prepushkey = python "$TESTDIR/printenv.py" prepushkey 0' >> .hg/hgrc
+  $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey 0" >> .hg/hgrc
   $ req
   pushing to http://localhost:$HGPORT/
   searching for changes
--- a/tests/test-qrecord.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-qrecord.t	Mon Oct 22 21:54:36 2012 -0700
@@ -74,7 +74,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help record" to show more info
+  use "hg -v help record" to show the global options
 
 help (no mq, so no qrecord)
 
@@ -85,7 +85,7 @@
   
       See "hg help qnew" & "hg help record" for more information and usage.
   
-  use "hg -v help qrecord" to show more info
+  use "hg -v help qrecord" to show the global options
 
   $ hg init a
 
@@ -117,7 +117,7 @@
   
       See "hg help qnew" & "hg help record" for more information and usage.
   
-  use "hg -v help qrecord" to show more info
+  use "hg -v help qrecord" to show the global options
 
 help (mq present)
 
@@ -150,7 +150,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help qrecord" to show more info
+  use "hg -v help qrecord" to show the global options
 
   $ cd a
 
--- a/tests/test-run-tests.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-run-tests.t	Mon Oct 22 21:54:36 2012 -0700
@@ -55,11 +55,11 @@
 Windows: \r\n is handled like \n and can be escaped:
 
 #if windows
-  $ printf 'crlf\r\ncr\r\tcrlf\r\ncrcrlf\r\r\n'
+  $ printf 'crlf\r\ncr\r\tcrlf\r\ncrlf\r\n'
   crlf
   cr\r (no-eol) (esc)
   \tcrlf (esc)
-  crcrlf\r (esc)
+  crlf\r (esc)
 #endif
 
 Combining esc with other markups - and handling lines ending with \r instead of \n:
--- a/tests/test-ssh.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-ssh.t	Mon Oct 22 21:54:36 2012 -0700
@@ -284,6 +284,13 @@
   $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   73649e48688a
 
+Test (non-)escaping of remote paths with spaces when cloning (issue3145):
+
+  $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
+  destination directory: a repo
+  abort: destination 'a repo' is not empty
+  [255]
+
 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
 parameters:
@@ -374,3 +381,4 @@
   Got arguments 1:user@dummy 2:hg init 'a repo'
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
+  Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
--- a/tests/test-tag.t	Mon Oct 22 18:05:40 2012 -0700
+++ b/tests/test-tag.t	Mon Oct 22 21:54:36 2012 -0700
@@ -40,9 +40,15 @@
   $ hg tag -r 0 x y z y y z
   abort: tag names must be unique
   [255]
-  $ hg tag tap nada dot tip null .
+  $ hg tag tap nada dot tip
   abort: the name 'tip' is reserved
   [255]
+  $ hg tag .
+  abort: the name '.' is reserved
+  [255]
+  $ hg tag null
+  abort: the name 'null' is reserved
+  [255]
   $ hg tag "bleah"
   abort: tag 'bleah' already exists (use -f to force)
   [255]