Merge
authorBryan O'Sullivan <bryano@fb.com>
Fri, 06 Jul 2012 20:28:32 -0700
changeset 17122 5d6cbfa975bf
parent 17120 01d847e0fdc9 (diff)
parent 17121 d13f47c800fd (current diff)
child 17123 8e030168b09e
child 17133 9937484e8634
Merge
--- a/.hgignore	Fri Jul 06 20:19:55 2012 -0700
+++ b/.hgignore	Fri Jul 06 20:28:32 2012 -0700
@@ -8,6 +8,7 @@
 *.o
 *.so
 *.dll
+*.exe
 *.pyd
 *.pyc
 *.pyo
@@ -31,7 +32,6 @@
 patches
 mercurial/__version__.py
 mercurial.egg-info
-Output/Mercurial-*.exe
 .DS_Store
 tags
 cscope.*
@@ -53,5 +53,4 @@
 
 # hackable windows distribution additions
 ^hg-python
-^hg.exe$
 ^hg.py$
--- a/.hgsigs	Fri Jul 06 20:19:55 2012 -0700
+++ b/.hgsigs	Fri Jul 06 20:28:32 2012 -0700
@@ -55,3 +55,4 @@
 00182b3d087909e3c3ae44761efecdde8f319ef3 0 iD8DBQBPoFhIywK+sNU5EO8RAhzhAKCBj1n2jxPTkZNJJ5pSp3soa+XHIgCgsZZpAQxOpXwCp0eCdNGe0+pmxmg=
 5983de86462c5a9f42a3ad0f5e90ce5b1d221d25 0 iD8DBQBPovNWywK+sNU5EO8RAhgiAJ980T91FdPTRMmVONDhpkMsZwVIMACgg3bKvoWSeuCW28llUhAJtUjrMv0=
 85a358df5bbbe404ca25730c9c459b34263441dc 0 iD8DBQBPyZsWywK+sNU5EO8RAnpLAJ48qrGDJRT+pteS0mSQ11haqHstPwCdG4ccGbk+0JHb7aNy8/NRGAOqn9w=
+b013baa3898e117959984fc64c29d8c784d2f28b 0 iD8DBQBP8QOPywK+sNU5EO8RAqimAKCFRSx0lvG6y8vne2IhNG062Hn0dACeMLI5/zhpWpHBIVeAAquYfx2XFeA=
--- a/.hgtags	Fri Jul 06 20:19:55 2012 -0700
+++ b/.hgtags	Fri Jul 06 20:28:32 2012 -0700
@@ -67,3 +67,4 @@
 00182b3d087909e3c3ae44761efecdde8f319ef3 2.2
 5983de86462c5a9f42a3ad0f5e90ce5b1d221d25 2.2.1
 85a358df5bbbe404ca25730c9c459b34263441dc 2.2.2
+b013baa3898e117959984fc64c29d8c784d2f28b 2.2.3
--- a/contrib/check-code.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/contrib/check-code.py	Fri Jul 06 20:28:32 2012 -0700
@@ -100,6 +100,8 @@
      "explicit exit code checks unnecessary"),
     (uprefix + r'set -e', "don't use set -e"),
     (uprefix + r'\s', "don't indent commands, use > for continued lines"),
+    (r'^  saved backup bundle to \$TESTTMP.*\.hg$',
+     "use (glob) to match Windows paths too"),
   ],
   # warnings
   []
--- a/hgext/convert/filemap.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/hgext/convert/filemap.py	Fri Jul 06 20:28:32 2012 -0700
@@ -294,23 +294,34 @@
         # A parent p is interesting if its mapped version (self.parentmap[p]):
         # - is not SKIPREV
         # - is still not in the list of parents (we don't want duplicates)
-        # - is not an ancestor of the mapped versions of the other parents
+        # - is not an ancestor of the mapped versions of the other parents or
+        #   there is no parent in the same branch than the current revision.
         mparents = []
-        wp = None
+        knownparents = set()
+        branch = self.commits[rev].branch
+        hasbranchparent = False
         for i, p1 in enumerate(parents):
             mp1 = self.parentmap[p1]
-            if mp1 == SKIPREV or mp1 in mparents:
+            if mp1 == SKIPREV or mp1 in knownparents:
                 continue
-            for p2 in parents:
-                if p1 == p2 or mp1 == self.parentmap[p2]:
-                    continue
-                if mp1 in self.wantedancestors[p2]:
-                    break
-            else:
-                mparents.append(mp1)
-                wp = i
-
-        if wp is None and parents:
+            isancestor = util.any(p2 for p2 in parents
+                                  if p1 != p2 and mp1 != self.parentmap[p2]
+                                  and mp1 in self.wantedancestors[p2])
+            if not isancestor and not hasbranchparent and len(parents) > 1:
+                # This could be expensive, avoid unnecessary calls.
+                if self._cachedcommit(p1).branch == branch:
+                    hasbranchparent = True
+            mparents.append((p1, mp1, i, isancestor))
+            knownparents.add(mp1)
+        # Discard parents ancestors of other parents if there is a
+        # non-ancestor one on the same branch than current revision.
+        if hasbranchparent:
+            mparents = [p for p in mparents if not p[3]]
+        wp = None
+        if mparents:
+            wp = max(p[2] for p in mparents)
+            mparents = [p[1] for p in mparents]
+        elif parents:
             wp = 0
 
         self.origparents[rev] = parents
@@ -319,7 +330,6 @@
         if 'close' in self.commits[rev].extra:
             # A branch closing revision is only useful if one of its
             # parents belong to the branch being closed
-            branch = self.commits[rev].branch
             pbranches = [self._cachedcommit(p).branch for p in mparents]
             if branch in pbranches:
                 closed = True
--- a/hgext/graphlog.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/hgext/graphlog.py	Fri Jul 06 20:28:32 2012 -0700
@@ -455,7 +455,11 @@
              filematcher=None):
     seen, state = [], asciistate()
     for rev, type, ctx, parents in dag:
-        char = ctx.node() in showparents and '@' or 'o'
+        char = 'o'
+        if ctx.node() in showparents:
+            char = '@'
+        elif ctx.obsolete():
+            char = 'x'
         copies = None
         if getrenamed and ctx.rev():
             copies = []
@@ -467,7 +471,9 @@
         if filematcher is not None:
             revmatchfn = filematcher(ctx.rev())
         displayer.show(ctx, copies=copies, matchfn=revmatchfn)
-        lines = displayer.hunk.pop(rev).split('\n')[:-1]
+        lines = displayer.hunk.pop(rev).split('\n')
+        if not lines[-1]:
+            del lines[-1]
         displayer.flush(rev)
         edges = edgefn(type, char, lines, seen, rev, parents)
         for type, char, lines, coldata in edges:
--- a/hgext/histedit.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/hgext/histedit.py	Fri Jul 06 20:28:32 2012 -0700
@@ -476,7 +476,7 @@
             newtip = sorted(replacemap.values(), key=repo.changelog.rev)[-1]
             copybms(oldtip, newtip)
 
-            for old, new in replacemap.iteritems():
+            for old, new in sorted(replacemap.iteritems()):
                 copybms(old, new)
                 # TODO update mq state
 
--- a/hgext/largefiles/overrides.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/hgext/largefiles/overrides.py	Fri Jul 06 20:28:32 2012 -0700
@@ -807,18 +807,21 @@
     if subrepos:
         for subpath in ctx.substate:
             sub = ctx.sub(subpath)
-            sub.archive(repo.ui, archiver, prefix)
+            submatch = match_.narrowmatcher(subpath, matchfn)
+            sub.archive(repo.ui, archiver, prefix, submatch)
 
     archiver.done()
 
-def hgsubrepoarchive(orig, repo, ui, archiver, prefix):
+def hgsubrepoarchive(orig, repo, ui, archiver, prefix, match=None):
     rev = repo._state[1]
     ctx = repo._repo[rev]
 
     lfcommands.cachelfiles(ui, repo._repo, ctx.node())
 
     def write(name, mode, islink, getdata):
-        if lfutil.isstandin(name):
+        # At this point, the standin has been replaced with the largefile name,
+        # so the normal matcher works here without the lfutil variants.
+        if match and not match(f):
             return
         data = getdata()
 
@@ -850,7 +853,9 @@
 
     for subpath in ctx.substate:
         sub = ctx.sub(subpath)
-        sub.archive(repo.ui, archiver, prefix)
+        submatch = match_.narrowmatcher(subpath, match)
+        sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/',
+                    submatch)
 
 # If a largefile is modified, the change is not reflected in its
 # standin until a commit. cmdutil.bailifchanged() raises an exception
--- a/hgext/mq.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/hgext/mq.py	Fri Jul 06 20:28:32 2012 -0700
@@ -3537,13 +3537,12 @@
     applied = set([repo[r.node].rev() for r in repo.mq.applied])
     return [r for r in subset if r in applied]
 
-def extsetup(ui):
-    revset.symbols['mq'] = revsetmq
-
 # tell hggettext to extract docstrings from these functions:
 i18nfunctions = [revsetmq]
 
-def uisetup(ui):
+def extsetup(ui):
+    # Ensure mq wrappers are called first, regardless of extension load order by
+    # NOT wrapping in uisetup() and instead deferring to init stage two here.
     mqopt = [('', 'mq', None, _("operate on patch repository"))]
 
     extensions.wrapcommand(commands.table, 'import', mqimport)
@@ -3568,6 +3567,7 @@
         if extmodule.__file__ != __file__:
             dotable(getattr(extmodule, 'cmdtable', {}))
 
+    revset.symbols['mq'] = revsetmq
 
 colortable = {'qguard.negative': 'red',
               'qguard.positive': 'yellow',
--- a/hgext/record.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/hgext/record.py	Fri Jul 06 20:28:32 2012 -0700
@@ -381,7 +381,7 @@
         if skipall is None:
             h.pretty(ui)
         msg = (_('examine changes to %s?') %
-               _(' and ').join(map(repr, h.files())))
+               _(' and ').join("'%s'" % f for f in h.files()))
         r, skipfile, skipall, np = prompt(skipfile, skipall, msg, None)
         if not r:
             continue
--- a/i18n/ja.po	Fri Jul 06 20:19:55 2012 -0700
+++ b/i18n/ja.po	Fri Jul 06 20:28:32 2012 -0700
@@ -125,7 +125,7 @@
 msgstr ""
 "Project-Id-Version: Mercurial\n"
 "Report-Msgid-Bugs-To: <mercurial-devel@selenic.com>\n"
-"POT-Creation-Date: 2012-05-29 19:03+0900\n"
+"POT-Creation-Date: 2012-06-30 20:47+0900\n"
 "PO-Revision-Date: 2009-11-16 21:24+0100\n"
 "Last-Translator: Japanese translation team <mercurial-ja@googlegroups.com>\n"
 "Language-Team: Japanese\n"
@@ -790,7 +790,7 @@
 msgstr ""
 "bugzilla.bzurl\n"
 "  アクセス先 Bugzilla のベース URL。\n"
-"  デフォルト値は ``http://localhost/bugzilla``。"
+"  デフォルト値は ``http://localhost/bugzilla`` 。"
 
 msgid ""
 "bugzilla.user\n"
@@ -799,7 +799,7 @@
 msgstr ""
 "bugzilla.user\n"
 "  Bugzilla との XMLRPC 連携で、 ログインに使用するユーザ名。\n"
-"  デフォルト値は ``bugs``。"
+"  デフォルト値は ``bugs`` 。"
 
 msgid ""
 "bugzilla.password\n"
@@ -840,21 +840,21 @@
 msgstr ""
 "bugzilla.host\n"
 "  Bugzilla データベースを持つ MySQL サーバのホスト名。\n"
-"  デフォルト値は ``localhost``。"
+"  デフォルト値は ``localhost`` 。"
 
 msgid ""
 "bugzilla.db\n"
 "  Name of the Bugzilla database in MySQL. Default ``bugs``."
 msgstr ""
 "bugzilla.db\n"
-"  MySQL における Bugzilla データベースの名前。 デフォルト値は ``bugs``。"
+"  MySQL における Bugzilla データベースの名前。 デフォルト値は ``bugs`` 。"
 
 msgid ""
 "bugzilla.user\n"
 "  Username to use to access MySQL server. Default ``bugs``."
 msgstr ""
 "bugzilla.user\n"
-"  MySQL サーバへのアクセスに使用するユーザ名。 デフォルト値は ``bugs``。"
+"  MySQL サーバへのアクセスに使用するユーザ名。 デフォルト値は ``bugs`` 。"
 
 msgid ""
 "bugzilla.password\n"
@@ -886,7 +886,7 @@
 msgstr ""
 "bugzilla.bzdir\n"
 "   Bugzilla のインストール先ディレクトリ。 デフォルトの ``notify``\n"
-"   設定において使用されます。 デフォルト値は ``/var/www/html/bugzilla``。"
+"   設定において使用されます。 デフォルト値は ``/var/www/html/bugzilla`` 。"
 
 msgid ""
 "bugzilla.notify\n"
@@ -1921,7 +1921,7 @@
 msgstr ""
 "    :hook.cvschangesets: CVS ログからのリビジョン算出完了後に呼ばれる\n"
 "        Python 関数。 関数呼び出しの際には、 リビジョン一覧が渡され、\n"
-"       リビジョンの改変や、 追加/削除を、 直接実施できます。"
+"        リビジョンの改変や、 追加/削除を、 直接実施できます。"
 
 msgid ""
 "    An additional \"debugcvsps\" Mercurial command allows the builtin\n"
@@ -1972,21 +1972,21 @@
 "        The default is ``branches``."
 msgstr ""
 "    :convert.svn.branches: ブランチを格納するディレクトリ。\n"
-"        デフォルト値は ``branches``。"
+"        デフォルト値は ``branches`` 。"
 
 msgid ""
 "    :convert.svn.tags: specify the directory containing tags. The\n"
 "        default is ``tags``."
 msgstr ""
 "    :convert.svn.tags: タグを格納するディレクトリ。\n"
-"        デフォルト値は ``tags``。"
+"        デフォルト値は ``tags`` 。"
 
 msgid ""
 "    :convert.svn.trunk: specify the name of the trunk branch. The\n"
 "        default is ``trunk``."
 msgstr ""
 "    :convert.svn.trunk: trunk ブランチのブランチ名。\n"
-"        デフォルト値は ``trunk``。"
+"        デフォルト値は ``trunk`` 。"
 
 msgid ""
 "    Source history can be retrieved starting at a specific revision,\n"
@@ -2061,7 +2061,7 @@
 "        ``default``."
 msgstr ""
 "    :convert.hg.tagsbranch: タグ付けを実施するリビジョンのブランチ名。\n"
-"        デフォルト値は ``default``。"
+"        デフォルト値は ``default`` 。"
 
 msgid ""
 "    :convert.hg.usebranchnames: preserve branch names. The default is\n"
@@ -3364,7 +3364,7 @@
 "    See :hg:`help dates` for a list of formats valid for -d/--date.\n"
 "    "
 msgstr ""
-"    -d/--date での日時表記は :he:`help dates` を参照してください。\n"
+"    -d/--date での日時表記は :hg:`help dates` を参照してください。\n"
 "    "
 
 msgid "uncommitted merge - please provide a specific revision"
@@ -6401,21 +6401,22 @@
 msgstr "電子メールによる push 通知送信用フック集"
 
 msgid ""
-"This extension let you run hooks sending email notifications when\n"
-"changesets are being pushed, from the sending or receiving side."
-msgstr ""
-"本エクステンションは、 変更履歴が反映された際に、 反映元ないし反映先の、\n"
-"いずれかが契機となって、 電子メールによる通知を行う機能を提供します。"
+"This extension implements hooks to send email notifications when\n"
+"changesets are sent from or received by the local repository."
+msgstr ""
+"本エクステンションでは、 変更履歴が、 手元のリポジトリに取り込まれたり、\n"
+"他のリポジトリへと反映されたのを契機に、 電子メールを送信するための、\n"
+"フックを提供します。"
 
 msgid ""
 "First, enable the extension as explained in :hg:`help extensions`, and\n"
 "register the hook you want to run. ``incoming`` and ``changegroup`` hooks\n"
-"are run by the changesets receiver while the ``outgoing`` one is for\n"
-"the sender::"
+"are run when changesets are received, while ``outgoing`` hooks are for\n"
+"changesets sent to another repository::"
 msgstr ""
 ":hg:`help extensions` にならって、 本エクステンションを有効にした上で、\n"
 "実行したいフックを登録してください。 `incoming`` および ``changegroup``\n"
-"フックは反映「先」で、 ``outgoing`` は反映「元」で実行されます::"
+"フックは履歴の取り込みで、 ``outgoing`` は履歴の反映の際に実行されます::"
 
 msgid ""
 "  [hooks]\n"
@@ -6438,24 +6439,25 @@
 "  outgoing.notify = python:hgext.notify.hook"
 
 msgid ""
-"Now the hooks are running, subscribers must be assigned to\n"
-"repositories. Use the ``[usersubs]`` section to map repositories to a\n"
-"given email or the ``[reposubs]`` section to map emails to a single\n"
-"repository::"
-msgstr ""
-"フック実行には、 リポジトリに対するメール送信先 (subscriber:購読者)\n"
-"の設定が必要です。 メール送信先毎のリポジトリ設定には ``[usersubs]``、\n"
-"リポジトリ毎のメール送信先設定には ``[reposubs]`` を使用します::"
+"This registers the hooks. To enable notification, subscribers must\n"
+"be assigned to repositories. The ``[usersubs]`` section maps multiple\n"
+"repositories to a given recipient. The ``[reposubs]`` section maps\n"
+"multiple recipients to a single repository::"
+msgstr ""
+"上記の設定により、 フックが登録されます。 メール通知を有効にするには、\n"
+"リポジトリ毎のメール送信先 (subscriber:購読者) 設定が必要です。\n"
+"``[usersubs]`` は単一購読者に複数のリポジトリを設定します。\n"
+"``[reposubs]`` は単一リポジトリに複数の購読者を設定します。"
 
 msgid ""
 "  [usersubs]\n"
-"  # key is subscriber email, value is a comma-separated list of glob\n"
+"  # key is subscriber email, value is a comma-separated list of repo glob\n"
 "  # patterns\n"
 "  user@host = pattern"
 msgstr ""
 "  [usersubs]\n"
-"  # 左辺には送信先メールアドレス、右辺にはカンマ区切りの合致(glob)\n"
-"  # パターンを記述してください\n"
+"  # 左辺には送信先メールアドレス、右辺にはカンマ区切りの\n"
+"  # リポジトリ合致(glob)パターンを記述してください\n"
 "  user@host = pattern"
 
 msgid ""
@@ -6470,11 +6472,17 @@
 
 msgid ""
 "Glob patterns are matched against absolute path to repository\n"
-"root. The subscriptions can be defined in their own file and\n"
-"referenced with::"
-msgstr ""
-"合致パターンの適用対象は、 リポジトリルートの絶対パスです。\n"
-"メール送信設定は、 別途設定ファイルにおいて、 記述することもできます::"
+"root."
+msgstr "合致パターンの適用対象は、 リポジトリルートの絶対パスです。"
+
+msgid ""
+"In order to place them under direct user management, ``[usersubs]`` and\n"
+"``[reposubs]`` sections may be placed in a separate ``hgrc`` file and\n"
+"incorporated by reference::"
+msgstr ""
+"``[usersubs]`` および ``[reposubs]`` 設定を、 別のファイルに記述して、\n"
+"そのファイルを読み込むようにすることで、 メール送信先ユーザの管理を、\n"
+"独立させることが可能です::"
 
 msgid ""
 "  [notify]\n"
@@ -6484,19 +6492,11 @@
 "  config = /path/to/subscriptionsfile"
 
 msgid ""
-"Alternatively, they can be added to Mercurial configuration files by\n"
-"setting the previous entry to an empty value."
-msgstr ""
-"Mercurial の設定ファイルには、 これらの値に空値を設定する記述を、\n"
-"「とりあえず」書いておいても構いません。"
-
-msgid ""
-"At this point, notifications should be generated but will not be sent until "
-"you\n"
-"set the ``notify.test`` entry to ``False``."
-msgstr ""
-"ここまでの段階では、 通知内容は生成されますが、 ``notify.test`` 設定を\n"
-"``False`` にしない限り、 通知メールは送信されないからです。"
+"Notifications will not be sent until the ``notify.test`` value is set\n"
+"to ``False``; see below."
+msgstr ""
+"``notify.test`` 設定を ``False`` にしない限り、 メールは送信されません。\n"
+"詳細は後述の説明を参照してください。"
 
 msgid ""
 "Notifications content can be tweaked with the following configuration "
@@ -6514,28 +6514,34 @@
 
 msgid ""
 "notify.sources\n"
-"  Space separated list of change sources. Notifications are sent only\n"
-"  if it includes the incoming or outgoing changes source. Incoming\n"
-"  sources can be ``serve`` for changes coming from http or ssh,\n"
-"  ``pull`` for pulled changes, ``unbundle`` for changes added by\n"
-"  :hg:`unbundle` or ``push`` for changes being pushed\n"
-"  locally. Outgoing sources are the same except for ``unbundle`` which\n"
-"  is replaced by ``bundle``. Default: serve."
+"  Space-separated list of change sources. Notifications are activated only\n"
+"  when a changeset's source is in this list. Sources may be:"
 msgstr ""
 "notify.sources\n"
-"  空白区切りの、 変更反映元一覧。 変更反映元ないし、 変更反映先の種別が、\n"
-"  一覧に含まれる場合にのみ、 通知メールが送信されます。 incoming の場合、\n"
-"  反映元種別は、 http ないし ssh 経由での ``serve``、 :hg:`pull`\n"
-"  実行での ``pull``、 :hg:`unbundle` 実行での ``unbundle``、\n"
-"  ローカルホスト上における :hg:`push` 実行での ``push`` のいずれかです。\n"
-"  outgoing の場合、 ``unbundle`` が ``bundle`` になる以外は、\n"
-"  同じ種別が使用されます。 デフォルト値は serve。"
+"  空白区切りの変更反映元一覧。 変更反映元が一覧要素と合致する場合のみ、\n"
+"  メール送信が有効になります。 指定可能な要素は:"
+
+msgid ""
+"  :``serve``: changesets received via http or ssh\n"
+"  :``pull``: changesets received via ``hg pull``\n"
+"  :``unbundle``: changesets received via ``hg unbundle``\n"
+"  :``push``: changesets sent or received via ``hg push``\n"
+"  :``bundle``: changesets sent via ``hg unbundle``"
+msgstr ""
+"  :``serve``: http または ssh 経由での取り込み\n"
+"  :``pull``: ``hg pull`` 経由での取り込み\n"
+"  :``unbundle``: ``hg unbundle`` 経由での取り込み\n"
+"  :``push``: ``hg push`` 経由での反映/取り込み\n"
+"  :``bundle``: ``hg unbundle`` 経由での反映"
+
+msgid "  Default: serve."
+msgstr " デフォルト値は serve です。"
 
 msgid ""
 "notify.strip\n"
 "  Number of leading slashes to strip from url paths. By default, "
 "notifications\n"
-"  references repositories with their absolute path. ``notify.strip`` let "
+"  reference repositories with their absolute path. ``notify.strip`` lets "
 "you\n"
 "  turn them into relative paths. For example, ``notify.strip=3`` will "
 "change\n"
@@ -6550,12 +6556,10 @@
 
 msgid ""
 "notify.domain\n"
-"  If subscribers emails or the from email have no domain set, complete them\n"
-"  with this value."
+"  Default email domain for sender or recipients with no explicit domain."
 msgstr ""
 "notify.domain\n"
-"  電子メールの送信先、 ないし送信元が、 ドメイン部分を持たない場合に、\n"
-"  この設定値が使用されます。"
+"  明示的なドメインが無い場合の、 送信元/先メールアドレスのドメイン。"
 
 msgid ""
 "notify.style\n"
@@ -6573,7 +6577,8 @@
 
 msgid ""
 "notify.incoming\n"
-"  Template to use when run as incoming hook, override ``notify.template``."
+"  Template to use when run as an incoming hook, overriding ``notify."
+"template``."
 msgstr ""
 "notify.incoming\n"
 "  incoming フックで使用するテンプレート指定。 設定された場合は、\n"
@@ -6581,7 +6586,8 @@
 
 msgid ""
 "notify.outgoing\n"
-"  Template to use when run as outgoing hook, override ``notify.template``."
+"  Template to use when run as an outgoing hook, overriding ``notify."
+"template``."
 msgstr ""
 "notify.outgoing\n"
 "  outgoing フックで使用するテンプレート設定。 設定された場合は、\n"
@@ -6589,17 +6595,17 @@
 
 msgid ""
 "notify.changegroup\n"
-"  Template to use when running as changegroup hook, override\n"
+"  Template to use when running as a changegroup hook, overriding\n"
 "  ``notify.template``."
 msgstr ""
 "notify.changegroup\n"
-"  changegroup フックで使用するテンプレート設定、 設定された場合は、\n"
+"  changegroup フックで使用するテンプレート設定。 設定された場合は、\n"
 "  ``notify.template`` に優先します。"
 
 msgid ""
 "notify.maxdiff\n"
 "  Maximum number of diff lines to include in notification email. Set to 0\n"
-"  to disable the diff, -1 to include all of it. Default: 300."
+"  to disable the diff, or -1 to include all of it. Default: 300."
 msgstr ""
 "notify.maxdiff\n"
 "  メール本文に含める、 差分情報の最大行数。 0 の場合は、 差分が含まれず、\n"
@@ -6607,7 +6613,7 @@
 
 msgid ""
 "notify.maxsubject\n"
-"  Maximum number of characters in emails subject line. Default: 67."
+"  Maximum number of characters in email's subject line. Default: 67."
 msgstr ""
 "notify.maxsubject\n"
 "  メール表題 (subject) の最大文字数。 デフォルト値は 67。"
@@ -6636,25 +6642,24 @@
 
 msgid ""
 "notify.fromauthor\n"
-"  If set, use the first committer of the changegroup for the \"From\" field "
-"of\n"
-"  the notification mail. If not set, take the user from the pushing repo.\n"
-"  Default: False."
+"  If set, use the committer of the first changeset in a changegroup for\n"
+"  the \"From\" field of the notification mail. If not set, take the user\n"
+"  from the pushing repo.  Default: False."
 msgstr ""
 "notify.fromauthor\n"
-"  真値の場合、 通知対象 (の最初の) リビジョンのユーザ名を、 通知メールの\n"
-"  \"From\" フィールドに使用します。 それ以外は、 変更反映元からの、\n"
-"  ユーザ名情報を利用します。 デフォルト値は False。"
-
-msgid ""
-"If set, the following entries will also be used to customize the "
+"  真値の場合、 通知契機リビジョン群の、 先頭リビジョンのユーザ名を、\n"
+"  通知メールの \"From\" フィールドに使用します。 それ以外の場合は、\n"
+"  変更反映元からの、 ユーザ名情報を利用します。 デフォルト値は False。"
+
+msgid ""
+"If set, the following entries will also be used to customize the\n"
 "notifications:"
 msgstr "通知のカスタマイズには、 以下の設定も利用可能です:"
 
 msgid ""
 "email.from\n"
-"  Email ``From`` address to use if none can be found in generated email "
-"content."
+"  Email ``From`` address to use if none can be found in the generated\n"
+"  email content."
 msgstr ""
 "email.from\n"
 "  生成された通知メール本文に、 相当する情報が無い場合は、 この値が\n"
@@ -6662,7 +6667,7 @@
 
 msgid ""
 "web.baseurl\n"
-"  Root repository browsing URL to combine with repository paths when making\n"
+"  Root repository URL to combine with repository paths when making\n"
 "  references. See also ``notify.strip``."
 msgstr ""
 "web.baseurl\n"
@@ -7513,8 +7518,8 @@
 "    If a rebase is interrupted to manually resolve a merge, it can be\n"
 "    continued with --continue/-c or aborted with --abort/-a."
 msgstr ""
-"    手動マージでの衝突解消の必要性から、 移動処理が中断された場合、\n"
-"    --continue/-c での再開や、 --abort/-a での中断が可能です。"
+"    手動マージでの衝突解消の必要性から、 移動処理が中断された場合は、\n"
+"    --continue/-c での再開や、 --abort/-a での移動前状態への復旧が可能です。"
 
 msgid ""
 "    Returns 0 on success, 1 if nothing to rebase.\n"
@@ -7611,8 +7616,9 @@
 msgid "no rebase in progress"
 msgstr "進行中の移動状態はありません"
 
-msgid "warning: immutable rebased changeset detected, can't abort\n"
-msgstr "警告: 移動対象リビジョンが改変不能なため中断できません\n"
+#, python-format
+msgid "can't abort rebase due to immutable changesets %s"
+msgstr "改変不能リビジョンがあるため rebase 前の状態に復旧できません: %s"
 
 msgid "warning: new changesets detected on target branch, can't abort\n"
 msgstr "警告: 新規リビジョンが対象ブランチに検出されたので中断できません\n"
@@ -7828,7 +7834,7 @@
 msgstr "hg qrecord [OPTION]... PATCH [FILE]..."
 
 msgid "interactively select changes to refresh"
-msgstr "パッチ更新内容内容を対話的に選択"
+msgstr "パッチ更新内容を対話的に選択"
 
 msgid "recreates hardlinks between repository clones"
 msgstr "複製リポジトリ間でのハードリンクの再生成"
@@ -9120,7 +9126,7 @@
 "    are detected."
 msgstr ""
 "    ファイルの改名を検知するには -s/--similarity を使用します。 指定値が\n"
-"     0 より大きい場合は、 全ての追加・除外ファイルが、 確認対象となって、\n"
+"    0 より大きい場合は、 全ての追加・除外ファイルが、 確認対象となって、\n"
 "    改名の有無が判定されます。 このオプションには、 0(改名比較無し)\n"
 "    から 100 (完全一致で判定)までの範囲でパーセンテージを指定します。\n"
 "    判定処理には、 相応の時間を要する場合があります。 判定結果の確認は、\n"
@@ -9488,7 +9494,7 @@
 "if\n"
 "        that revision is not usable because of another issue)::"
 msgstr ""
-"      - 現ビジョンないし特定のリビジョンをスキップ (例: 別な問題により、\n"
+"      - 現リビジョンないし特定のリビジョンをスキップ (例: 別な問題により、\n"
 "        当該リビジョンの検証ができない)::"
 
 msgid ""
@@ -11092,11 +11098,11 @@
 
 #, python-format
 msgid "skipping ancestor revision %s\n"
-msgstr "祖先ビジョン %s を飛ばしています\n"
+msgstr "祖先リビジョン %s を飛ばしています\n"
 
 #, python-format
 msgid "skipping already grafted revision %s\n"
-msgstr "移植済みビジョン %s を飛ばしています\n"
+msgstr "移植済みリビジョン %s を飛ばしています\n"
 
 #, python-format
 msgid "skipping already grafted revision %s (same origin %d)\n"
@@ -11193,8 +11199,8 @@
 msgid "show normal and closed branch heads"
 msgstr "閉鎖済みヘッドも表示"
 
-msgid "[-ac] [-r STARTREV] [REV]..."
-msgstr "[-ac] [-r STARTREV] [REV]..."
+msgid "[-ct] [-r STARTREV] [REV]..."
+msgstr "[-ct] [-r STARTREV] [REV]..."
 
 msgid "show current repository heads or show branch heads"
 msgstr "現時点でのリポジトリ(ないしブランチ)のヘッド表示"
@@ -13400,7 +13406,7 @@
 "    特別なタグで、 改名や、 他のリビジョンへの付け替えはできません。"
 
 msgid "update to new branch head if changesets were unbundled"
-msgstr "新規取り込みの際には作業領域を新規ブランチヘッドでで更新"
+msgstr "新規取り込みの際には作業領域を新規ブランチヘッドで更新"
 
 msgid "[-u] FILE..."
 msgstr "[-u] FILE..."
@@ -13444,15 +13450,15 @@
 "    (詳細は :hg:`help bookmarks` 参照)"
 
 msgid ""
-"    If the changeset is not a descendant of the working directory's\n"
-"    parent, the update is aborted. With the -c/--check option, the\n"
-"    working directory is checked for uncommitted changes; if none are\n"
-"    found, the working directory is updated to the specified\n"
+"    If the changeset is not a descendant or ancestor of the working\n"
+"    directory's parent, the update is aborted. With the -c/--check\n"
+"    option, the working directory is checked for uncommitted changes; if\n"
+"    none are found, the working directory is updated to the specified\n"
 "    changeset."
 msgstr ""
-"    指定リビジョンが、 作業領域の親リビジョンの直系の子孫でない場合、\n"
+"    指定リビジョンが、 作業領域の祖先/直系の子孫のいずれでもでない場合、\n"
 "    作業領域の更新は中断されます。 -c/--check が指定された場合、\n"
-"    作業領域中の未コミット変更の有無を確認し、 変更が無かった場合には\n"
+"    作業領域中の未コミット変更の有無を確認し、 変更が無かった場合には、\n"
 "    作業領域を指定リビジョンで更新します。"
 
 msgid ""
@@ -18215,10 +18221,10 @@
 "Branch, named\n"
 "    [名前付きブランチ] 同一のブランチ名を持つリビジョンの集合。\n"
 "    名前付きブランチに属するリビジョンは、 その子リビジョンも、\n"
-"     同じ名前付きブランチに属します。 別な名前付きブランチを、\n"
+"    同じ名前付きブランチに属します。 別な名前付きブランチを、\n"
 "    明示的に指定することで、 次のコミットで生成される子リビジョンの、\n"
 "    所属ブランチを変更できます。 ブランチ管理の詳細は、\n"
-"    :hg:`help branch`、 :hg:`help branches` および\n"
+"    :hg:`help branch` 、 :hg:`help branches` および\n"
 "    :hg:`commit --close-branch` を参照してください。"
 
 msgid ""
@@ -18797,7 +18803,7 @@
 "Repository\n"
 "    [リポジトリ] 管理対象ファイルの状態を記録したメタデータ。\n"
 "    記録された状態によって、 リビジョンが表現されます。 リポジトリは、\n"
-"    通常 (「常に」ではありません) であれば、 作業領域の ``.hg`\n"
+"    通常 (「常に」ではありません) であれば、 作業領域の ``.hg``\n"
 "    配下にあります。 記録された状態は、 特定のリビジョンを指定した\n"
 "    \"updating\" によって、 作業領域に再現されます。"
 
@@ -19219,7 +19225,7 @@
 "preferred. For instance::"
 msgstr ""
 "``collections`` セクションでは、 実リポジトリから仮想リポジトリへの、\n"
-"パスの対応付けを定義しますが、 ``paths `` セクションによる記述の方が、\n"
+"パスの対応付けを定義しますが、 ``paths`` セクションによる記述の方が、\n"
 "一般的に推奨されます。 記述例は::"
 
 msgid ""
@@ -19666,7 +19672,7 @@
 "if needed. See :hg:`help -v phase` for examples."
 msgstr ""
 "予期せぬ類似リビジョン生成回避のため、 mq/rebase 等のエクステンションは、\n"
-" 一旦 public 化されたリビジョンを処理対処にできません。\n"
+"一旦 public 化されたリビジョンを処理対処にできません。\n"
 "必要であれば :hg:`phase` コマンドによる手動でのフェーズ変更も可能です。\n"
 "実行例に関しては :hg:`help -v phase` を参照してください。"
 
@@ -22109,6 +22115,9 @@
 msgid "could not symlink to %r: %s"
 msgstr "%r に対してシンボリックリンクできません: %s"
 
+msgid "empty revision range"
+msgstr "リビジョンの範囲指定が空です"
+
 #, python-format
 msgid "recording removal of %s as rename to %s (%d%% similar)\n"
 msgstr "%s の削除を %s へのファイル名変更として記録中 (類似度 %d%%)\n"
@@ -22377,6 +22386,12 @@
 msgid "not removing repo %s because it has changes.\n"
 msgstr "変更が含まれているため、 リポジトリ %s は削除されません\n"
 
+msgid "cannot retrieve git version"
+msgstr "git のバージョン情報が取得できません"
+
+msgid "git subrepo requires at least 1.6.0 or later"
+msgstr "副リポジトリ利用には 1.6.0 以降の git が必要です"
+
 #, python-format
 msgid "revision %s does not exist in subrepo %s\n"
 msgstr "リビジョン %s は副リポジトリ %s には存在しません\n"
--- a/i18n/pt_BR.po	Fri Jul 06 20:19:55 2012 -0700
+++ b/i18n/pt_BR.po	Fri Jul 06 20:28:32 2012 -0700
@@ -6138,6 +6138,16 @@
 "    Use a opção --no-backup para descartar o bundle de backup assim\n"
 "    que a operação terminar."
 
+msgid ""
+"    Strip is not a history-rewriting operation and can be used on\n"
+"    changesets in the public phase. But if the stripped changesets have\n"
+"    been pushed to a remote repository you will likely pull them again."
+msgstr ""
+"    A operação strip não reescreve o histórico, e pode ser usada em\n"
+"    revisões na fase pública. Mas se revisões removidas por strip\n"
+"    tiverem sido enviadas para um repositório remoto, um comando pull\n"
+"    subsequente poderá trazê-las de volta."
+
 msgid "empty revision set"
 msgstr "conjunto vazio de revisões"
 
--- a/mercurial/archival.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/archival.py	Fri Jul 06 20:28:32 2012 -0700
@@ -7,6 +7,7 @@
 
 from i18n import _
 from node import hex
+import match as matchmod
 import cmdutil
 import scmutil, util, encoding
 import cStringIO, os, tarfile, time, zipfile
@@ -284,6 +285,7 @@
     if subrepos:
         for subpath in ctx.substate:
             sub = ctx.sub(subpath)
-            sub.archive(repo.ui, archiver, prefix)
+            submatch = matchmod.narrowmatcher(subpath, matchfn)
+            sub.archive(repo.ui, archiver, prefix, submatch)
 
     archiver.done()
--- a/mercurial/commands.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/commands.py	Fri Jul 06 20:28:32 2012 -0700
@@ -17,7 +17,7 @@
 import minirst, revset, fileset
 import dagparser, context, simplemerge
 import random, setdiscovery, treediscovery, dagutil, pvec
-import phases
+import phases, obsolete
 
 table = {}
 
@@ -2049,6 +2049,31 @@
     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,
+         _('[OBSOLETED [REPLACEMENT] [REPL... ]'))
+def debugobsolete(ui, repo, precursor=None, *successors, **opts):
+    """create arbitrary obsolete marker"""
+    if precursor is not None:
+        metadata = {}
+        if 'date' in opts:
+            metadata['date'] = opts['date']
+        metadata['user'] = opts['user'] or ui.username()
+        succs = tuple(bin(succ) for succ in successors)
+        l = repo.lock()
+        try:
+            repo.obsstore.create(bin(precursor), succs, 0, metadata)
+        finally:
+            l.release()
+    else:
+        for mctx in obsolete.allmarkers(repo):
+            ui.write(hex(mctx.precnode()))
+            for repl in mctx.succnodes():
+                ui.write(' ')
+                ui.write(hex(repl))
+            ui.write(' %X ' % mctx._data[2])
+            ui.write(mctx.metadata())
+            ui.write('\n')
+
 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'))
 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
     '''access the pushkey key/value protocol
--- a/mercurial/context.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/context.py	Fri Jul 06 20:28:32 2012 -0700
@@ -230,6 +230,11 @@
         for d in self._repo.changelog.descendants([self._rev]):
             yield changectx(self._repo, d)
 
+    def obsolete(self):
+        """True if the changeset is obsolete"""
+        return (self.node() in self._repo.obsstore.precursors
+                and self.phase() > phases.public)
+
     def _fileinfo(self, path):
         if '_manifest' in self.__dict__:
             try:
--- a/mercurial/dirstate.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/dirstate.py	Fri Jul 06 20:28:32 2012 -0700
@@ -312,7 +312,8 @@
         if self[f] not in "?r" and "_dirs" in self.__dict__:
             _decdirs(self._dirs, f)
 
-    def _addpath(self, f, check=False):
+    def _addpath(self, f, state, mode, size, mtime, check=False):
+        assert state not in "?r"
         oldstate = self[f]
         if check or oldstate == "r":
             scmutil.checkfilename(f)
@@ -327,14 +328,14 @@
                         _('file %r in dirstate clashes with %r') % (d, f))
         if oldstate in "?r" and "_dirs" in self.__dict__:
             _incdirs(self._dirs, f)
+        self._dirty = True
+        self._map[f] = (state, mode, size, mtime)
 
     def normal(self, f):
         '''Mark a file normal and clean.'''
-        self._dirty = True
-        self._addpath(f)
         s = os.lstat(self._join(f))
         mtime = int(s.st_mtime)
-        self._map[f] = ('n', s.st_mode, s.st_size, mtime)
+        self._addpath(f, 'n', s.st_mode, s.st_size, mtime)
         if f in self._copymap:
             del self._copymap[f]
         if mtime > self._lastnormaltime:
@@ -361,9 +362,7 @@
                 return
             if entry[0] == 'm' or entry[0] == 'n' and entry[2] == -2:
                 return
-        self._dirty = True
-        self._addpath(f)
-        self._map[f] = ('n', 0, -1, -1)
+        self._addpath(f, 'n', 0, -1, -1)
         if f in self._copymap:
             del self._copymap[f]
 
@@ -372,17 +371,13 @@
         if self._pl[1] == nullid:
             raise util.Abort(_("setting %r to other parent "
                                "only allowed in merges") % f)
-        self._dirty = True
-        self._addpath(f)
-        self._map[f] = ('n', 0, -2, -1)
+        self._addpath(f, 'n', 0, -2, -1)
         if f in self._copymap:
             del self._copymap[f]
 
     def add(self, f):
         '''Mark a file added.'''
-        self._dirty = True
-        self._addpath(f, True)
-        self._map[f] = ('a', 0, -1, -1)
+        self._addpath(f, 'a', 0, -1, -1, True)
         if f in self._copymap:
             del self._copymap[f]
 
@@ -406,10 +401,8 @@
         '''Mark a file merged.'''
         if self._pl[1] == nullid:
             return self.normallookup(f)
-        self._dirty = True
         s = os.lstat(self._join(f))
-        self._addpath(f)
-        self._map[f] = ('m', s.st_mode, s.st_size, int(s.st_mtime))
+        self._addpath(f, 'm', s.st_mode, s.st_size, int(s.st_mtime))
         if f in self._copymap:
             del self._copymap[f]
 
--- a/mercurial/help/hgignore.txt	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/help/hgignore.txt	Fri Jul 06 20:28:32 2012 -0700
@@ -33,6 +33,11 @@
 commands support the ``-I`` and ``-X`` options; see
 :hg:`help <command>` and :hg:`help patterns` for details.
 
+Files that are already tracked are not affected by .hgignore, even
+if they appear in .hgignore. An untracked file X can be explicitly
+added with :hg:`add X`, even if X would be excluded by a pattern
+in .hgignore.
+
 Syntax
 ------
 
--- a/mercurial/help/hgweb.txt	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/help/hgweb.txt	Fri Jul 06 20:28:32 2012 -0700
@@ -1,47 +1,50 @@
 Mercurial's internal web server, hgweb, can serve either a single
-repository, or a collection of them. In the latter case, a special
-configuration file can be used to specify the repository paths to use
-and global web configuration options.
+repository, or a tree of repositories. In the second case, repository
+paths and global options can be defined using a dedicated
+configuration file common to :hg:`serve`, ``hgweb.wsgi``,
+``hgweb.cgi`` and ``hgweb.fcgi``.
 
-This file uses the same syntax as other Mercurial configuration files,
-but only the following sections are recognized:
+This file uses the same syntax as other Mercurial configuration files
+but recognizes only the following sections:
 
   - web
   - paths
   - collections
 
-The ``web`` section can specify all the settings described in the web
-section of the hgrc(5) documentation. See :hg:`help config` for
-information on where to find the manual page.
+The ``web`` options are thorougly described in :hg:`help config`.
+
+The ``paths`` section maps URL paths to paths of repositories in the
+filesystem. hgweb will not expose the filesystem directly - only
+Mercurial repositories can be published and only according to the
+configuration.
 
-The ``paths`` section provides mappings of physical repository
-paths to virtual ones. For instance::
+The left hand side is the path in the URL. Note that hgweb reserves
+subpaths like ``rev`` or ``file``, try using different names for
+nested repositories to avoid confusing effects.
+
+The right hand side is the path in the filesystem. If the specified
+path ends with ``*`` or ``**`` the filesystem will be searched
+recursively for repositories below that point.
+With ``*`` it will not recurse into the repositories it finds (except for
+``.hg/patches``).
+With ``**`` it will also search inside repository working directories
+and possibly find subrepositories.
+
+In this example::
 
   [paths]
-  projects/a = /foo/bar
-  projects/b = /baz/quux
-  web/root = /real/root/*
-  / = /real/root2/*
-  virtual/root2 = /real/root2/**
+  /projects/a = /srv/tmprepos/a
+  /projects/b = c:/repos/b
+  / = /srv/repos/*
+  /user/bob = /home/bob/repos/**
 
 - The first two entries make two repositories in different directories
   appear under the same directory in the web interface
-- The third entry maps every Mercurial repository found in '/real/root'
-  into 'web/root'. This format is preferred over the [collections] one,
-  since using absolute paths as configuration keys is not supported on every
-  platform (especially on Windows).
-- The fourth entry is a special case mapping all repositories in
-  '/real/root2' in the root of the virtual directory.
-- The fifth entry recursively finds all repositories under the real
-  root, and maps their relative paths under the virtual root.
+- The third entry will publish every Mercurial repository found in
+  ``/srv/repos/``, for instance the repository ``/srv/repos/quux/``
+  will appear as ``http://server/quux/``
+- The fourth entry will publish both ``http://server/user/bob/quux/``
+  and ``http://server/user/bob/quux/testsubrepo/``
 
-The ``collections`` section provides mappings of trees of physical
-repositories paths to virtual ones, though the paths syntax is generally
-preferred. For instance::
-
-  [collections]
-  /foo = /foo
-
-Here, the left side will be stripped off all repositories found in the
-right side. Thus ``/foo/bar`` and ``foo/quux/baz`` will be listed as
-``bar`` and ``quux/baz`` respectively.
+The ``collections`` section is deprecated and has been superseeded by
+``paths``.
--- a/mercurial/hgweb/hgwebdir_mod.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Fri Jul 06 20:28:32 2012 -0700
@@ -23,10 +23,10 @@
     repos = []
     for prefix, root in cleannames(paths):
         roothead, roottail = os.path.split(root)
-        # "foo = /bar/*" makes every subrepo of /bar/ to be
-        # mounted as foo/subrepo
-        # and "foo = /bar/**" also recurses into the subdirectories,
-        # remember to use it without working dir.
+        # "foo = /bar/*" or "foo = /bar/**" lets every repo /bar/N in or below
+        # /bar/ be served as as foo/N .
+        # '*' will not search inside dirs with .hg (except .hg/patches),
+        # '**' will search inside dirs with .hg (and thus also find subrepos).
         try:
             recurse = {'*': False, '**': True}[roottail]
         except KeyError:
--- a/mercurial/localrepo.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/localrepo.py	Fri Jul 06 20:28:32 2012 -0700
@@ -4,12 +4,11 @@
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
-
 from node import bin, hex, nullid, nullrev, short
 from i18n import _
-import repo, changegroup, subrepo, discovery, pushkey
+import repo, changegroup, subrepo, discovery, pushkey, obsolete
 import changelog, dirstate, filelog, manifest, context, bookmarks, phases
-import lock, transaction, store, encoding
+import lock, transaction, store, encoding, base85
 import scmutil, util, extensions, hook, error, revset
 import match as matchmod
 import merge as mergemod
@@ -192,6 +191,14 @@
     def _phasecache(self):
         return phases.phasecache(self, self._phasedefaults)
 
+    @storecache('obsstore')
+    def obsstore(self):
+        store = obsolete.obsstore()
+        data = self.sopener.tryread('obsstore')
+        if data:
+            store.loadmarkers(data)
+        return store
+
     @storecache('00changelog.i')
     def changelog(self):
         c = changelog.changelog(self.sopener)
@@ -983,6 +990,16 @@
             self.store.write()
             if '_phasecache' in vars(self):
                 self._phasecache.write()
+            if 'obsstore' in vars(self) and self.obsstore._new:
+                # XXX: transaction logic should be used here. But for
+                # now rewriting the whole file is good enough.
+                f = self.sopener('obsstore', 'wb', atomictemp=True)
+                try:
+                    self.obsstore.flushmarkers(f)
+                    f.close()
+                except: # re-raises
+                    f.discard()
+                    raise
             for k, ce in self._filecache.items():
                 if k == 'dirstate':
                     continue
@@ -1656,6 +1673,11 @@
                 # Remote is old or publishing all common changesets
                 # should be seen as public
                 phases.advanceboundary(self, phases.public, subset)
+
+            remoteobs = remote.listkeys('obsolete')
+            if 'dump' in remoteobs:
+                data = base85.b85decode(remoteobs['dump'])
+                self.obsstore.mergemarkers(data)
         finally:
             lock.release()
 
@@ -1796,6 +1818,12 @@
                         if not r:
                             self.ui.warn(_('updating %s to public failed!\n')
                                             % newremotehead)
+                if 'obsolete' in self.listkeys('namespaces') and self.obsstore:
+                    data = self.obsstore._writemarkers()
+                    r = remote.pushkey('obsolete', 'dump', '',
+                                       base85.b85encode(data))
+                    if not r:
+                        self.ui.warn(_('failed to push obsolete markers!\n'))
             finally:
                 if lock is not None:
                     lock.release()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/obsolete.py	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,279 @@
+# obsolete.py - obsolete markers handling
+#
+# Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
+#                Logilab SA        <contact@logilab.fr>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+"""Obsolete markers handling
+
+An obsolete marker maps an old changeset to a list of new
+changesets. If the list of new changesets is empty, the old changeset
+is said to be "killed". Otherwise, the old changeset is being
+"replaced" by the new changesets.
+
+Obsolete markers can be used to record and distribute changeset graph
+transformations performed by history rewriting operations, and help
+building new tools to reconciliate conflicting rewriting actions. To
+facilitate conflicts resolution, markers include various annotations
+besides old and news changeset identifiers, such as creation date or
+author name.
+
+
+Format
+------
+
+Markers are stored in an append-only file stored in
+'.hg/store/obsstore'.
+
+The file starts with a version header:
+
+- 1 unsigned byte: version number, starting at zero.
+
+
+The header is followed by the markers. Each marker is made of:
+
+- 1 unsigned byte: number of new changesets "R", could be zero.
+
+- 1 unsigned 32-bits integer: metadata size "M" in bytes.
+
+- 1 byte: a bit field. It is reserved for flags used in obsolete
+  markers common operations, to avoid repeated decoding of metadata
+  entries.
+
+- 20 bytes: obsoleted changeset identifier.
+
+- N*20 bytes: new changesets identifiers.
+
+- M bytes: metadata as a sequence of nul-terminated strings. Each
+  string contains a key and a value, separated by a color ':', without
+  additional encoding. Keys cannot contain '\0' or ':' and values
+  cannot contain '\0'.
+"""
+import struct
+from mercurial import util, base85
+from i18n import _
+
+_pack = struct.pack
+_unpack = struct.unpack
+
+
+
+# data used for parsing and writing
+_fmversion = 0
+_fmfixed   = '>BIB20s'
+_fmnode = '20s'
+_fmfsize = struct.calcsize(_fmfixed)
+_fnodesize = struct.calcsize(_fmnode)
+
+def _readmarkers(data):
+    """Read and enumerate markers from raw data"""
+    off = 0
+    diskversion = _unpack('>B', data[off:off + 1])[0]
+    off += 1
+    if diskversion != _fmversion:
+        raise util.Abort(_('parsing obsolete marker: unknown version %r')
+                         % diskversion)
+
+    # Loop on markers
+    l = len(data)
+    while off + _fmfsize <= l:
+        # read fixed part
+        cur = data[off:off + _fmfsize]
+        off += _fmfsize
+        nbsuc, mdsize, flags, pre = _unpack(_fmfixed, cur)
+        # read replacement
+        sucs = ()
+        if nbsuc:
+            s = (_fnodesize * nbsuc)
+            cur = data[off:off + s]
+            sucs = _unpack(_fmnode * nbsuc, cur)
+            off += s
+        # read metadata
+        # (metadata will be decoded on demand)
+        metadata = data[off:off + mdsize]
+        if len(metadata) != mdsize:
+            raise util.Abort(_('parsing obsolete marker: metadata is too '
+                               'short, %d bytes expected, got %d')
+                             % (len(metadata), mdsize))
+        off += mdsize
+        yield (pre, sucs, flags, metadata)
+
+def encodemeta(meta):
+    """Return encoded metadata string to string mapping.
+
+    Assume no ':' in key and no '\0' in both key and value."""
+    for key, value in meta.iteritems():
+        if ':' in key or '\0' in key:
+            raise ValueError("':' and '\0' are forbidden in metadata key'")
+        if '\0' in value:
+            raise ValueError("':' are forbidden in metadata value'")
+    return '\0'.join(['%s:%s' % (k, meta[k]) for k in sorted(meta)])
+
+def decodemeta(data):
+    """Return string to string dictionary from encoded version."""
+    d = {}
+    for l in data.split('\0'):
+        if l:
+            key, value = l.split(':')
+            d[key] = value
+    return d
+
+class marker(object):
+    """Wrap obsolete marker raw data"""
+
+    def __init__(self, repo, data):
+        # the repo argument will be used to create changectx in later version
+        self._repo = repo
+        self._data = data
+        self._decodedmeta = None
+
+    def precnode(self):
+        """Precursor changeset node identifier"""
+        return self._data[0]
+
+    def succnodes(self):
+        """List of successor changesets node identifiers"""
+        return self._data[1]
+
+    def metadata(self):
+        """Decoded metadata dictionary"""
+        if self._decodedmeta is None:
+            self._decodedmeta = decodemeta(self._data[3])
+        return self._decodedmeta
+
+    def date(self):
+        """Creation date as (unixtime, offset)"""
+        parts = self.metadata()['date'].split(' ')
+        return (float(parts[0]), int(parts[1]))
+
+class obsstore(object):
+    """Store obsolete markers
+
+    Markers can be accessed with two mappings:
+    - precursors: old -> set(new)
+    - successors: new -> set(old)
+    """
+
+    def __init__(self):
+        self._all = []
+        # new markers to serialize
+        self._new = []
+        self.precursors = {}
+        self.successors = {}
+
+    def __iter__(self):
+        return iter(self._all)
+
+    def __nonzero__(self):
+        return bool(self._all)
+
+    def create(self, prec, succs=(), flag=0, metadata=None):
+        """obsolete: add a new obsolete marker
+
+        * ensuring it is hashable
+        * check mandatory metadata
+        * encode metadata
+        """
+        if metadata is None:
+            metadata = {}
+        if len(prec) != 20:
+            raise ValueError(prec)
+        for succ in succs:
+            if len(succ) != 20:
+                raise ValueError(succ)
+        marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata))
+        self.add(marker)
+
+    def add(self, marker):
+        """Add a new marker to the store
+
+        This marker still needs to be written to disk"""
+        self._new.append(marker)
+        self._load(marker)
+
+    def loadmarkers(self, data):
+        """Load all markers in data, mark them as known."""
+        for marker in _readmarkers(data):
+            self._load(marker)
+
+    def mergemarkers(self, data):
+        other = set(_readmarkers(data))
+        local = set(self._all)
+        new = other - local
+        for marker in new:
+            self.add(marker)
+
+    def flushmarkers(self, stream):
+        """Write all markers to a stream
+
+        After this operation, "new" markers are considered "known"."""
+        self._writemarkers(stream)
+        self._new[:] = []
+
+    def _load(self, marker):
+        self._all.append(marker)
+        pre, sucs = marker[:2]
+        self.precursors.setdefault(pre, set()).add(marker)
+        for suc in sucs:
+            self.successors.setdefault(suc, set()).add(marker)
+
+    def _writemarkers(self, stream=None):
+        # Kept separate from flushmarkers(), it will be reused for
+        # markers exchange.
+        if stream is None:
+            final = []
+            w = final.append
+        else:
+            w = stream.write
+        w(_pack('>B', _fmversion))
+        for marker in self._all:
+            pre, sucs, flags, metadata = marker
+            nbsuc = len(sucs)
+            format = _fmfixed + (_fmnode * nbsuc)
+            data = [nbsuc, len(metadata), flags, pre]
+            data.extend(sucs)
+            w(_pack(format, *data))
+            w(metadata)
+        if stream is None:
+            return ''.join(final)
+
+def listmarkers(repo):
+    """List markers over pushkey"""
+    if not repo.obsstore:
+        return {}
+    data = repo.obsstore._writemarkers()
+    return {'dump': base85.b85encode(data)}
+
+def pushmarker(repo, key, old, new):
+    """Push markers over pushkey"""
+    if key != 'dump':
+        repo.ui.warn(_('unknown key: %r') % key)
+        return 0
+    if old:
+        repo.ui.warn(_('unexpected old value') % key)
+        return 0
+    data = base85.b85decode(new)
+    lock = repo.lock()
+    try:
+        repo.obsstore.mergemarkers(data)
+        return 1
+    finally:
+        lock.release()
+
+def allmarkers(repo):
+    """all obsolete markers known in a repository"""
+    for markerdata in repo.obsstore:
+        yield marker(repo, markerdata)
+
+def precursormarkers(ctx):
+    """obsolete marker making this changeset obsolete"""
+    for data in ctx._repo.obsstore.precursors.get(ctx.node(), ()):
+        yield marker(ctx._repo, data)
+
+def successormarkers(ctx):
+    """obsolete marker marking this changeset as a successors"""
+    for data in ctx._repo.obsstore.successors.get(ctx.node(), ()):
+        yield marker(ctx._repo, data)
+
--- a/mercurial/pushkey.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/pushkey.py	Fri Jul 06 20:28:32 2012 -0700
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import bookmarks, phases
+import bookmarks, phases, obsolete
 
 def _nslist(repo):
     n = {}
@@ -16,6 +16,7 @@
 _namespaces = {"namespaces": (lambda *x: False, _nslist),
                "bookmarks": (bookmarks.pushbookmark, bookmarks.listbookmarks),
                "phases": (phases.pushphase, phases.listphases),
+               "obsolete": (obsolete.pushmarker, obsolete.listmarkers),
               }
 
 def register(namespace, pushkey, listkeys):
--- a/mercurial/revset.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/revset.py	Fri Jul 06 20:28:32 2012 -0700
@@ -1058,8 +1058,11 @@
     Valid fields are most regular revision fields and some special fields.
 
     Regular revision fields are ``description``, ``author``, ``branch``,
-    ``date``, ``files``, ``phase``, ``parents``, ``substate`` and ``user``.
-    Note that ``author`` and ``user`` are synonyms.
+    ``date``, ``files``, ``phase``, ``parents``, ``substate``, ``user``
+    and ``diff``.
+    Note that ``author`` and ``user`` are synonyms. ``diff`` refers to the
+    contents of the revision. Two revisions matching their ``diff`` will
+    also match their ``files``.
 
     Special fields are ``summary`` and ``metadata``:
     ``summary`` matches the first line of the description.
@@ -1079,12 +1082,18 @@
                 _("matching requires a string "
                 "as its second argument")).split()
 
-    # Make sure that there are no repeated fields, and expand the
-    # 'special' 'metadata' field type
+    # Make sure that there are no repeated fields,
+    # expand the 'special' 'metadata' field type
+    # and check the 'files' whenever we check the 'diff'
     fields = []
     for field in fieldlist:
         if field == 'metadata':
             fields += ['user', 'description', 'date']
+        elif field == 'diff':
+            # a revision matching the diff must also match the files
+            # since matching the diff is very costly, make sure to
+            # also match the files first
+            fields += ['files', 'diff']
         else:
             if field == 'author':
                 field = 'user'
@@ -1098,7 +1107,7 @@
     # Not all fields take the same amount of time to be matched
     # Sort the selected fields in order of increasing matching cost
     fieldorder = ['phase', 'parents', 'user', 'date', 'branch', 'summary',
-        'files', 'description', 'substate']
+        'files', 'description', 'substate', 'diff']
     def fieldkeyfunc(f):
         try:
             return fieldorder.index(f)
@@ -1121,6 +1130,7 @@
         'phase': lambda r: repo[r].phase(),
         'substate': lambda r: repo[r].substate,
         'summary': lambda r: repo[r].description().splitlines()[0],
+        'diff': lambda r: list(repo[r].diff(git=True),)
     }
     for info in fields:
         getfield = _funcs.get(info, None)
@@ -1151,6 +1161,8 @@
     Reverse order of set.
     """
     l = getset(repo, subset, x)
+    if not isinstance(l, list):
+        l = list(l)
     l.reverse()
     return l
 
--- a/mercurial/scmutil.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/scmutil.py	Fri Jul 06 20:28:32 2012 -0700
@@ -350,7 +350,8 @@
         raise util.Abort('%s not under root' % myname)
 
 def walkrepos(path, followsym=False, seen_dirs=None, recurse=False):
-    '''yield every hg repository under path, recursively.'''
+    '''yield every hg repository under path, always recursively.
+    The recurse flag will only control recursion into repo working dirs'''
     def errhandler(err):
         if err.filename == path:
             raise err
--- a/mercurial/subrepo.py	Fri Jul 06 20:19:55 2012 -0700
+++ b/mercurial/subrepo.py	Fri Jul 06 20:28:32 2012 -0700
@@ -8,7 +8,7 @@
 import errno, os, re, xml.dom.minidom, shutil, posixpath
 import stat, subprocess, tarfile
 from i18n import _
-import config, scmutil, util, node, error, cmdutil, bookmarks
+import config, scmutil, util, node, error, cmdutil, bookmarks, match as matchmod
 hg = None
 propertycache = util.propertycache
 
@@ -351,8 +351,11 @@
         """return file flags"""
         return ''
 
-    def archive(self, ui, archiver, prefix):
-        files = self.files()
+    def archive(self, ui, archiver, prefix, match=None):
+        if match is not None:
+            files = [f for f in self.files() if match(f)]
+        else:
+            files = self.files()
         total = len(files)
         relpath = subrelpath(self)
         ui.progress(_('archiving (%s)') % relpath, 0,
@@ -445,15 +448,16 @@
             self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
                                % (inst, subrelpath(self)))
 
-    def archive(self, ui, archiver, prefix):
+    def archive(self, ui, archiver, prefix, match=None):
         self._get(self._state + ('hg',))
-        abstractsubrepo.archive(self, ui, archiver, prefix)
+        abstractsubrepo.archive(self, ui, archiver, prefix, match)
 
         rev = self._state[1]
         ctx = self._repo[rev]
         for subpath in ctx.substate:
             s = subrepo(ctx, subpath)
-            s.archive(ui, archiver, os.path.join(prefix, self._path))
+            submatch = matchmod.narrowmatcher(subpath, match)
+            s.archive(ui, archiver, os.path.join(prefix, self._path), submatch)
 
     def dirty(self, ignoreupdate=False):
         r = self._state[1]
@@ -1205,7 +1209,7 @@
             else:
                 os.remove(path)
 
-    def archive(self, ui, archiver, prefix):
+    def archive(self, ui, archiver, prefix, match=None):
         source, revision = self._state
         if not revision:
             return
@@ -1221,6 +1225,8 @@
         for i, info in enumerate(tar):
             if info.isdir():
                 continue
+            if match and not match(info.name):
+                continue
             if info.issym():
                 data = info.linkname
             else:
--- a/tests/histedit-helpers.sh	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/histedit-helpers.sh	Fri Jul 06 20:28:32 2012 -0700
@@ -1,5 +1,3 @@
-#!/bin/sh
-
 fixbundle() {
     grep -v 'saving bundle' | grep -v 'saved backup' | \
         grep -v added | grep -v adding | \
--- a/tests/test-bookmarks-pushpull.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-bookmarks-pushpull.t	Fri Jul 06 20:28:32 2012 -0700
@@ -40,6 +40,7 @@
   bookmarks	
   phases	
   namespaces	
+  obsolete	
   $ hg debugpushkey ../a bookmarks
   Y	4e3505fd95835d721066b76e75dbb8cc554d7f77
   X	4e3505fd95835d721066b76e75dbb8cc554d7f77
@@ -214,6 +215,7 @@
   bookmarks	
   phases	
   namespaces	
+  obsolete	
   $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
   Y	4efff6d98829d9c824c621afd6e3f01865f5439f
   foobar	9b140be1080824d768c5a4691a564088eede71f9
--- a/tests/test-casecollision.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-casecollision.t	Fri Jul 06 20:28:32 2012 -0700
@@ -31,6 +31,37 @@
   $ hg st
   A A
   A a
+  $ mkdir b
+  $ touch b/c b/D
+  $ hg add b
+  adding b/D
+  adding b/c
+  $ touch b/d b/C
+  $ hg add b/C
+  warning: possible case-folding collision for b/C
+  $ hg add b/d
+  warning: possible case-folding collision for b/d
+  $ touch b/a1 b/a2
+  $ hg add b
+  adding b/a1
+  adding b/a2
+  $ touch b/A2 b/a1.1
+  $ hg add b/a1.1 b/A2
+  warning: possible case-folding collision for b/A2
+  $ touch b/f b/F
+  $ hg add b/f b/F
+  warning: possible case-folding collision for b/f
+  $ touch g G
+  $ hg add g G
+  warning: possible case-folding collision for g
+  $ mkdir h H
+  $ touch h/x H/x
+  $ hg add h/x H/x
+  warning: possible case-folding collision for h/x
+  $ touch h/s H/s
+  $ hg add h/s
+  $ hg add H/s
+  warning: possible case-folding collision for H/s
 
 case changing rename must not warn or abort
 
--- a/tests/test-convert-bzr.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-convert-bzr.t	Fri Jul 06 20:28:32 2012 -0700
@@ -225,6 +225,7 @@
   $ bzr switch -b branch
   Tree is up to date at revision 1.
   Switched to branch: *repo/branch/ (glob)
+  $ sleep 1
   $ echo b > b
   $ bzr add -q b
   $ bzr ci -qm addb
@@ -233,6 +234,7 @@
   $ bzr switch --force ../repo/trunk
   Updated to revision 1.
   Switched to branch: */repo/trunk/ (glob)
+  $ sleep 1
   $ echo a >> a
   $ bzr ci -qm changea
   $ cd ..
--- a/tests/test-convert-filemap.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-convert-filemap.t	Fri Jul 06 20:28:32 2012 -0700
@@ -375,3 +375,189 @@
   |
   o  0 "addb" files: b
   
+
+test merge parents/empty merges pruning
+
+  $ glog()
+  > {
+  >     hg glog --template '{rev}:{node|short}@{branch} "{desc}" files: {files}\n' "$@"
+  > }
+
+test anonymous branch pruning
+
+  $ hg init anonymousbranch
+  $ cd anonymousbranch
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Am add
+  adding a
+  adding b
+  $ echo a >> a
+  $ hg ci -m changea
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b >> b
+  $ hg ci -m changeb
+  created new head
+  $ hg up 1
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+  $ cd ..
+
+  $ cat > filemap <<EOF
+  > include a
+  > EOF
+  $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg
+  initializing destination anonymousbranch-hg repository
+  scanning source...
+  sorting...
+  converting...
+  3 add
+  2 changea
+  1 changeb
+  0 merge
+  $ glog -R anonymousbranch
+  @    3:c71d5201a498@default "merge" files:
+  |\
+  | o  2:607eb44b17f9@default "changeb" files: b
+  | |
+  o |  1:1f60ea617824@default "changea" files: a
+  |/
+  o  0:0146e6129113@default "add" files: a b
+  
+  $ glog -R anonymousbranch-hg
+  o  1:cda818e7219b@default "changea" files: a
+  |
+  o  0:c334dc3be0da@default "add" files: a
+  
+  $ cat anonymousbranch-hg/.hg/shamap
+  0146e6129113dba9ac90207cfdf2d7ed35257ae5 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
+  1f60ea61782421edf8d051ff4fcb61b330f26a4a cda818e7219b5f7f3fb9f49780054ed6a1905ec3
+  607eb44b17f9348cd5cbd26e16af87ba77b0b037 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
+  c71d5201a498b2658d105a6bf69d7a0df2649aea cda818e7219b5f7f3fb9f49780054ed6a1905ec3
+
+  $ cat > filemap <<EOF
+  > include b
+  > EOF
+  $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg2
+  initializing destination anonymousbranch-hg2 repository
+  scanning source...
+  sorting...
+  converting...
+  3 add
+  2 changea
+  1 changeb
+  0 merge
+  $ glog -R anonymousbranch
+  @    3:c71d5201a498@default "merge" files:
+  |\
+  | o  2:607eb44b17f9@default "changeb" files: b
+  | |
+  o |  1:1f60ea617824@default "changea" files: a
+  |/
+  o  0:0146e6129113@default "add" files: a b
+  
+  $ glog -R anonymousbranch-hg2
+  o  1:62dd350b0df6@default "changeb" files: b
+  |
+  o  0:4b9ced861657@default "add" files: b
+  
+  $ cat anonymousbranch-hg2/.hg/shamap
+  0146e6129113dba9ac90207cfdf2d7ed35257ae5 4b9ced86165703791653059a1db6ed864630a523
+  1f60ea61782421edf8d051ff4fcb61b330f26a4a 4b9ced86165703791653059a1db6ed864630a523
+  607eb44b17f9348cd5cbd26e16af87ba77b0b037 62dd350b0df695f7d2c82a02e0499b16fd790f22
+  c71d5201a498b2658d105a6bf69d7a0df2649aea 62dd350b0df695f7d2c82a02e0499b16fd790f22
+
+test named branch pruning
+
+  $ hg init namedbranch
+  $ cd namedbranch
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Am add
+  adding a
+  adding b
+  $ echo a >> a
+  $ hg ci -m changea
+  $ hg up 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch foo
+  marked working directory as branch foo
+  (branches are permanent and global, did you want a bookmark?)
+  $ echo b >> b
+  $ hg ci -m changeb
+  $ hg up default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+  $ cd ..
+
+  $ cat > filemap <<EOF
+  > include a
+  > EOF
+  $ hg convert --filemap filemap namedbranch namedbranch-hg
+  initializing destination namedbranch-hg repository
+  scanning source...
+  sorting...
+  converting...
+  3 add
+  2 changea
+  1 changeb
+  0 merge
+  $ glog -R namedbranch
+  @    3:73899bcbe45c@default "merge" files:
+  |\
+  | o  2:8097982d19fc@foo "changeb" files: b
+  | |
+  o |  1:1f60ea617824@default "changea" files: a
+  |/
+  o  0:0146e6129113@default "add" files: a b
+  
+  $ glog -R namedbranch-hg
+  o  1:cda818e7219b@default "changea" files: a
+  |
+  o  0:c334dc3be0da@default "add" files: a
+  
+
+  $ cd namedbranch
+  $ hg --config extensions.mq= strip tip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  saved backup bundle to $TESTTMP/namedbranch/.hg/strip-backup/73899bcbe45c-backup.hg (glob)
+  $ hg up foo
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge
+  $ cd ..
+
+  $ hg convert --filemap filemap namedbranch namedbranch-hg2
+  initializing destination namedbranch-hg2 repository
+  scanning source...
+  sorting...
+  converting...
+  3 add
+  2 changea
+  1 changeb
+  0 merge
+  $ glog -R namedbranch
+  @    3:e1959de76e1b@foo "merge" files:
+  |\
+  | o  2:8097982d19fc@foo "changeb" files: b
+  | |
+  o |  1:1f60ea617824@default "changea" files: a
+  |/
+  o  0:0146e6129113@default "add" files: a b
+  
+  $ glog -R namedbranch-hg2
+  o    2:dcf314454667@foo "merge" files:
+  |\
+  | o  1:cda818e7219b@default "changea" files: a
+  |/
+  o  0:c334dc3be0da@default "add" files: a
+  
--- a/tests/test-debugcomplete.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-debugcomplete.t	Fri Jul 06 20:28:32 2012 -0700
@@ -86,6 +86,7 @@
   debugindexdot
   debuginstall
   debugknown
+  debugobsolete
   debugpushkey
   debugpvec
   debugrebuildstate
@@ -236,6 +237,7 @@
   debugindexdot: 
   debuginstall: 
   debugknown: 
+  debugobsolete: date, user
   debugpushkey: 
   debugpvec: 
   debugrebuildstate: rev
--- a/tests/test-dirstate.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-dirstate.t	Fri Jul 06 20:28:32 2012 -0700
@@ -14,6 +14,21 @@
   moving a/b/c/d/x to z/b/c/d/x (glob)
   moving a/b/c/d/y to z/b/c/d/y (glob)
   moving a/b/c/d/z to z/b/c/d/z (glob)
+
+Test name collisions
+
+  $ rm z/b/c/d/x
+  $ mkdir z/b/c/d/x
+  $ touch z/b/c/d/x/y
+  $ hg add z/b/c/d/x/y
+  abort: file 'z/b/c/d/x' in dirstate clashes with 'z/b/c/d/x/y'
+  [255]
+  $ rm -rf z/b/c/d
+  $ touch z/b/c/d
+  $ hg add z/b/c/d
+  abort: directory 'z/b/c/d' already in dirstate
+  [255]
+
   $ cd ..
 
 Issue1790: dirstate entry locked into unset if file mtime is set into
--- a/tests/test-glog.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-glog.t	Fri Jul 06 20:28:32 2012 -0700
@@ -2060,4 +2060,30 @@
   []
   []
 
+A template without trailing newline should do something sane
+
+  $ hg glog -r ::2 --template '{rev} {desc}'
+  o  2 mv b dir/b
+  |
+  o  1 copy a b
+  |
+
+Extra newlines must be preserved
+
+  $ hg glog -r ::2 --template '\n{rev} {desc}\n\n'
+  o
+  |  2 mv b dir/b
+  |
+  o
+  |  1 copy a b
+  |
+
+The almost-empty template should do something sane too ...
+
+  $ hg glog -r ::2 --template '\n'
+  o
+  |
+  o
+  |
+
   $ cd ..
--- a/tests/test-hgweb-diffs.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-hgweb-diffs.t	Fri Jul 06 20:28:32 2012 -0700
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" serve execbit || exit 80
+  $ "$TESTDIR/hghave" serve || exit 80
 
 setting up repo
 
@@ -12,9 +12,22 @@
 
 change permissions for git diffs
 
-  $ chmod +x a
-  $ hg rm b
-  $ hg ci -Amb
+  $ hg import -q --bypass - <<EOF
+  > # HG changeset patch
+  > # User test
+  > # Date 0 0
+  > b
+  > 
+  > diff --git a/a b/a
+  > old mode 100644
+  > new mode 100755
+  > diff --git a/b b/b
+  > deleted file mode 100644
+  > --- a/b
+  > +++ /dev/null
+  > @@ -1,1 +0,0 @@
+  > -b
+  > EOF
 
 set up hgweb
 
@@ -548,7 +561,7 @@
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd test1
-  $ hg import -q --exact http://localhost:$HGPORT/rev/1
+  $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1
 
 raw revision with diff block numbers
 
--- a/tests/test-histedit-bookmark-motion.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-histedit-bookmark-motion.t	Fri Jul 06 20:28:32 2012 -0700
@@ -87,16 +87,16 @@
   histedit: Should update metadata for the following changes:
   histedit:  055a42cdd887 to ae467701c500
   histedit:     moving bookmarks three
+  histedit:  177f92b77385 to d36c0562f908
+  histedit:     moving bookmarks also-two, two
   histedit:  652413bf663e to 0efacef7cb48
   histedit:     moving bookmarks five
   histedit:  d2ae7f538514 to cb9a9f314b8b
   histedit:     moving bookmarks will-move-backwards
   histedit:  e860deea161a to ae467701c500
   histedit:     moving bookmarks four
-  histedit:  177f92b77385 to d36c0562f908
-  histedit:     moving bookmarks also-two, two
-  saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg
-  saved backup bundle to $TESTTMP/r/.hg/strip-backup/34a9919932c1-backup.hg
+  saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg (glob)
+  saved backup bundle to $TESTTMP/r/.hg/strip-backup/34a9919932c1-backup.hg (glob)
   $ hg log --graph
   @  changeset:   3:0efacef7cb48
   |  bookmark:    five
@@ -149,10 +149,10 @@
   histedit: Should update metadata for the following changes:
   histedit:  0efacef7cb48 to 1be9c35b4cb2
   histedit:     moving bookmarks five
+  histedit:  0efacef7cb48 to 7c044e3e33a9
   histedit:  ae467701c500 to 1be9c35b4cb2
   histedit:     moving bookmarks four, three
-  histedit:  0efacef7cb48 to 7c044e3e33a9
-  saved backup bundle to $TESTTMP/r/.hg/strip-backup/ae467701c500-backup.hg
+  saved backup bundle to $TESTTMP/r/.hg/strip-backup/ae467701c500-backup.hg (glob)
 
 We expect 'five' to stay at tip, since the tipmost bookmark is most
 likely the useful signal.
--- a/tests/test-histedit-commute	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick e860deea161a e
-pick 652413bf663e f
-pick 055a42cdd887 d
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-}
-
-initrepo
-
-echo % log before edit
-hg log --graph
-
-echo % show the edit commands offered
-HGEDITOR=cat hg histedit 177f92b77385
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo % rules should end up in .hg/histedit-last-edit.txt:
-cat .hg/histedit-last-edit.txt
-echo '**** end of rules file ****'
-
-echo % log after edit
-hg log --graph
-
-echo % put things back
-
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick 853c68da763f d
-pick b069cc29fb22 e
-pick 26f6a030ae82 f
-EOF
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-hg log --graph
-
-
-echo % slightly different this time
-
-cat > $EDITED <<EOF
-pick 055a42cdd887 d
-pick 652413bf663e f
-pick e860deea161a e
-pick 177f92b77385 c
-EOF
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-hg log --graph
-
-
-echo % keep prevents stripping dead revs
-cat > $EDITED <<EOF
-pick bfe4a5a76b37 d
-pick c4f52e213402 f
-pick 99a62755c625 c
-pick 7c6fdd608667 e
-EOF
-HGEDITOR="cat $EDITED > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle
-hg log --graph
-
-echo '% try with --rev'
-cat > $EDITED <<EOF
-pick 7c6fdd608667 e
-pick 99a62755c625 c
-EOF
-hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle
-hg log --graph
-
-echo % should also work if a commit message is missing
-BUNDLE="$TESTDIR/missing-comment.hg"
-hg init missing
-cd missing
-hg unbundle $BUNDLE
-hg co tip
-hg log --graph
-hg histedit 0
--- a/tests/test-histedit-commute.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +0,0 @@
-% log before edit
-@  changeset:   5:652413bf663e
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% show the edit commands offered
-pick 177f92b77385 2 c
-pick 055a42cdd887 3 d
-pick e860deea161a 4 e
-pick 652413bf663e 5 f
-
-# Edit history between 177f92b77385 and 652413bf663e
-#
-# Commands:
-#  p, pick = use commit
-#  e, edit = use commit, but stop for amending
-#  f, fold = use commit, but fold into previous commit (combines N and N-1)
-#  d, drop = remove commit from history
-#  m, mess = edit message without changing commit content
-#
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% edit the history
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% rules should end up in .hg/histedit-last-edit.txt:
-pick 177f92b77385 c
-pick e860deea161a e
-pick 652413bf663e f
-pick 055a42cdd887 d
-**** end of rules file ****
-% log after edit
-@  changeset:   5:853c68da763f
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   4:26f6a030ae82
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   3:b069cc29fb22
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% put things back
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  changeset:   5:652413bf663e
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% slightly different this time
-0 files updated, 0 files merged, 4 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  changeset:   5:99a62755c625
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   4:7c6fdd608667
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:c4f52e213402
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   2:bfe4a5a76b37
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% keep prevents stripping dead revs
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  changeset:   7:99e266581538
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   6:5ad36efb0653
-|  parent:      3:c4f52e213402
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-| o  changeset:   5:99a62755c625
-| |  user:        test
-| |  date:        Thu Jan 01 00:00:00 1970 +0000
-| |  summary:     c
-| |
-| o  changeset:   4:7c6fdd608667
-|/   user:        test
-|    date:        Thu Jan 01 00:00:00 1970 +0000
-|    summary:     e
-|
-o  changeset:   3:c4f52e213402
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   2:bfe4a5a76b37
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% try with --rev
-abort: may not use changesets other than the ones listed
-@  changeset:   7:99e266581538
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   6:5ad36efb0653
-|  parent:      3:c4f52e213402
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-| o  changeset:   5:99a62755c625
-| |  user:        test
-| |  date:        Thu Jan 01 00:00:00 1970 +0000
-| |  summary:     c
-| |
-| o  changeset:   4:7c6fdd608667
-|/   user:        test
-|    date:        Thu Jan 01 00:00:00 1970 +0000
-|    summary:     e
-|
-o  changeset:   3:c4f52e213402
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   2:bfe4a5a76b37
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% should also work if a commit message is missing
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  changeset:   2:bd22688093b3
-|  tag:         tip
-|  user:        Robert Altman <robert.altman@telventDTN.com>
-|  date:        Mon Nov 28 16:40:04 2011 +0000
-|  summary:     Update file.
-|
-o  changeset:   1:3b3e956f9171
-|  user:        Robert Altman <robert.altman@telventDTN.com>
-|  date:        Mon Nov 28 16:37:57 2011 +0000
-|
-o  changeset:   0:141947992243
-   user:        Robert Altman <robert.altman@telventDTN.com>
-   date:        Mon Nov 28 16:35:28 2011 +0000
-   summary:     Checked in text file
-
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-commute.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,359 @@
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > pick 055a42cdd887 d
+  > EOF
+  $ initrepo ()
+  > {
+  >     hg init r
+  >     cd r
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  > }
+
+  $ initrepo
+
+log before edit
+  $ hg log --graph
+  @  changeset:   5:652413bf663e
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+show the edit commands offered
+  $ HGEDITOR=cat hg histedit 177f92b77385
+  pick 177f92b77385 2 c
+  pick 055a42cdd887 3 d
+  pick e860deea161a 4 e
+  pick 652413bf663e 5 f
+  
+  # Edit history between 177f92b77385 and 652413bf663e
+  #
+  # Commands:
+  #  p, pick = use commit
+  #  e, edit = use commit, but stop for amending
+  #  f, fold = use commit, but fold into previous commit (combines N and N-1)
+  #  d, drop = remove commit from history
+  #  m, mess = edit message without changing commit content
+  #
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+rules should end up in .hg/histedit-last-edit.txt:
+  $ cat .hg/histedit-last-edit.txt
+  pick 177f92b77385 c
+  pick e860deea161a e
+  pick 652413bf663e f
+  pick 055a42cdd887 d
+
+log after edit
+  $ hg log --graph
+  @  changeset:   5:853c68da763f
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   4:26f6a030ae82
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   3:b069cc29fb22
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+put things back
+
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick 853c68da763f d
+  > pick b069cc29fb22 e
+  > pick 26f6a030ae82 f
+  > EOF
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg log --graph
+  @  changeset:   5:652413bf663e
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+slightly different this time
+
+  $ cat > $EDITED <<EOF
+  > pick 055a42cdd887 d
+  > pick 652413bf663e f
+  > pick e860deea161a e
+  > pick 177f92b77385 c
+  > EOF
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --graph
+  @  changeset:   5:99a62755c625
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   4:7c6fdd608667
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:c4f52e213402
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   2:bfe4a5a76b37
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+keep prevents stripping dead revs
+  $ cat > $EDITED <<EOF
+  > pick bfe4a5a76b37 d
+  > pick c4f52e213402 f
+  > pick 99a62755c625 c
+  > pick 7c6fdd608667 e
+  > EOF
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --graph
+  > cat > $EDITED <<EOF
+  > pick 7c6fdd608667 e
+  > pick 99a62755c625 c
+  > EOF
+  @  changeset:   7:99e266581538
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   6:5ad36efb0653
+  |  parent:      3:c4f52e213402
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  | o  changeset:   5:99a62755c625
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     c
+  | |
+  | o  changeset:   4:7c6fdd608667
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     e
+  |
+  o  changeset:   3:c4f52e213402
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   2:bfe4a5a76b37
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+try with --rev
+  $ hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle
+  abort: may not use changesets other than the ones listed
+  $ hg log --graph
+  @  changeset:   7:99e266581538
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   6:5ad36efb0653
+  |  parent:      3:c4f52e213402
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  | o  changeset:   5:99a62755c625
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     c
+  | |
+  | o  changeset:   4:7c6fdd608667
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     e
+  |
+  o  changeset:   3:c4f52e213402
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   2:bfe4a5a76b37
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+should also work if a commit message is missing
+  $ BUNDLE="$TESTDIR/missing-comment.hg"
+  $ hg init missing
+  $ cd missing
+  $ hg unbundle $BUNDLE
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg co tip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --graph
+  @  changeset:   2:bd22688093b3
+  |  tag:         tip
+  |  user:        Robert Altman <robert.altman@telventDTN.com>
+  |  date:        Mon Nov 28 16:40:04 2011 +0000
+  |  summary:     Update file.
+  |
+  o  changeset:   1:3b3e956f9171
+  |  user:        Robert Altman <robert.altman@telventDTN.com>
+  |  date:        Mon Nov 28 16:37:57 2011 +0000
+  |
+  o  changeset:   0:141947992243
+     user:        Robert Altman <robert.altman@telventDTN.com>
+     date:        Mon Nov 28 16:35:28 2011 +0000
+     summary:     Checked in text file
+  
+  $ hg histedit 0
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ..
--- a/tests/test-histedit-drop	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-drop 177f92b77385 c
-pick e860deea161a e
-pick 652413bf663e f
-pick 055a42cdd887 d
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-}
-
-initrepo
-
-echo % log before edit
-hg log --graph
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo % log after edit
-hg log --graph
-
-echo % manifest after edit
-hg manifest
-
-echo % EOF
--- a/tests/test-histedit-drop.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-% log before edit
-@  changeset:   5:652413bf663e
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% edit the history
-0 files updated, 0 files merged, 4 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% log after edit
-@  changeset:   4:708943196e52
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   3:75cbdffecadb
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   2:493dc0964412
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% manifest after edit
-a
-b
-d
-e
-f
-% EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-drop.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,107 @@
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > drop 177f92b77385 c
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > pick 055a42cdd887 d
+  > EOF
+  $ initrepo ()
+  > {
+  >     hg init r
+  >     cd r
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  > }
+
+  $ initrepo
+
+log before edit
+  $ hg log --graph
+  @  changeset:   5:652413bf663e
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+log after edit
+  $ hg log --graph
+  @  changeset:   4:708943196e52
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   3:75cbdffecadb
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   2:493dc0964412
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+manifest after edit
+  $ hg manifest
+  a
+  b
+  d
+  e
+  f
+
+  $ cd ..
--- a/tests/test-histedit-edit	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick 055a42cdd887 d
-edit e860deea161a e
-pick 652413bf663e f
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-}
-
-initrepo
-
-echo % log before edit
-hg log --graph
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo % commit, then edit the revision
-hg ci -m 'wat'
-echo a > e
-HGEDITOR='echo "foobaz" > ' hg histedit --continue 2>&1 | fixbundle
-
-hg log --graph
-
-echo '% contents of e:'
-hg cat e
-
-cat > $EDITED <<EOF
-edit bf757c081cd0 f
-EOF
-HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle
-hg status
-HGEDITOR='true' hg histedit --continue
-hg status
-
-echo % log after edit
-hg log --limit 1
-
-echo "% say we'll change the message, but don't."
-cat > ../edit.sh <<EOF
-#!/bin/sh
-cat \$1 | sed s/pick/mess/ > tmp
-mv tmp \$1
-EOF
-chmod +x ../edit.sh
-HGEDITOR="../edit.sh" hg histedit tip 2>&1 | fixbundle
-hg status
-hg log --limit 1
-
-echo % modify the message
-cat > $EDITED <<EOF
-mess bf757c081cd0 f
-EOF
-HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle
-hg status
-hg log --limit 1
-
-echo % rollback should not work after a histedit
-hg rollback
-
-echo % EOF
--- a/tests/test-histedit-edit.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-% log before edit
-@  changeset:   5:652413bf663e
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% edit the history
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-abort: Make changes as needed, you may commit or record as needed now.
-When you are finished, run hg histedit --continue to resume.
-% commit, then edit the revision
-created new head
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  changeset:   6:bf757c081cd0
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   5:d6b15fed32d4
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     foobaz
-|
-o  changeset:   4:1a60820cd1f6
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     wat
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% contents of e:
-a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-abort: Make changes as needed, you may commit or record as needed now.
-When you are finished, run hg histedit --continue to resume.
-A f
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% log after edit
-changeset:   6:bf757c081cd0
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     f
-
-% say we'll change the message, but don't.
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   6:bf757c081cd0
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     f
-
-% modify the message
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   6:0b16746f8e89
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     mess bf757c081cd0 f
-
-% rollback should not work after a histedit
-no rollback information available
-% EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-edit.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,178 @@
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick 055a42cdd887 d
+  > edit e860deea161a e
+  > pick 652413bf663e f
+  > EOF
+  $ initrepo ()
+  > {
+  >     hg init r
+  >     cd r
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  > }
+
+  $ initrepo
+
+log before edit
+  $ hg log --graph
+  @  changeset:   5:652413bf663e
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  abort: Make changes as needed, you may commit or record as needed now.
+  When you are finished, run hg histedit --continue to resume.
+
+commit, then edit the revision
+  $ hg ci -m 'wat'
+  created new head
+  $ echo a > e
+  $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg log --graph
+  @  changeset:   6:bf757c081cd0
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   5:d6b15fed32d4
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     foobaz
+  |
+  o  changeset:   4:1a60820cd1f6
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     wat
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+  $ hg cat e
+  a
+
+  $ cat > $EDITED <<EOF
+  > edit bf757c081cd0 f
+  > EOF
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  abort: Make changes as needed, you may commit or record as needed now.
+  When you are finished, run hg histedit --continue to resume.
+  $ hg status
+  A f
+  $ HGEDITOR='true' hg histedit --continue
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg status
+
+log after edit
+  $ hg log --limit 1
+  changeset:   6:bf757c081cd0
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     f
+  
+
+say we'll change the message, but don't.
+  $ cat > ../edit.sh <<EOF
+  > cat "\$1" | sed s/pick/mess/ > tmp
+  > mv tmp "\$1"
+  > EOF
+  $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg status
+  $ hg log --limit 1
+  changeset:   6:bf757c081cd0
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     f
+  
+
+modify the message
+  $ cat > $EDITED <<EOF
+  > mess bf757c081cd0 f
+  > EOF
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg status
+  $ hg log --limit 1
+  changeset:   6:0b16746f8e89
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     mess bf757c081cd0 f
+  
+
+rollback should not work after a histedit
+  $ hg rollback
+  no rollback information available
+  [1]
+
+  $ cd ..
--- a/tests/test-histedit-fold	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-pick e860deea161a e
-pick 652413bf663e f
-fold 177f92b77385 c
-pick 055a42cdd887 d
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-}
-
-initrepo
-
-echo % log before edit
-hg log --graph
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo % log after edit
-hg log --graph
-
-echo % post-fold manifest
-hg manifest
-
-echo % EOF
--- a/tests/test-histedit-fold-non-commute	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick 055a42cdd887 d
-fold bfa474341cc9 does not commute with e
-pick e860deea161a e
-pick 652413bf663e f
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-    echo a >> e
-    hg ci -m 'does not commute with e'
-}
-
-initrepo
-
-echo % log before edit
-hg log --graph
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo % fix up
-echo a > e
-hg add e
-cat > cat.py <<EOF
-import sys
-print open(sys.argv[1]).read()
-print
-print
-EOF
-HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed'
-
-echo
-echo % just continue this time
-hg histedit --continue 2>&1 | fixbundle
-
-
-echo % log after edit
-hg log --graph
-
-echo % contents of e
-hg cat e
-
-echo % manifest
-hg manifest
-
-echo % EOF
--- a/tests/test-histedit-fold-non-commute.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-% log before edit
-@  changeset:   6:bfa474341cc9
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     does not commute with e
-|
-o  changeset:   5:652413bf663e
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% edit the history
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-% fix up
-d
-***
-does not commute with e
-
-
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-file e already exists
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-
-% just continue this time
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% log after edit
-@  changeset:   4:f768fd60ca34
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   3:671efe372e33
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% contents of e
-a
-% manifest
-a
-b
-c
-d
-e
-f
-% EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-fold-non-commute.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,146 @@
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick 055a42cdd887 d
+  > fold bfa474341cc9 does not commute with e
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > EOF
+  $ initrepo ()
+  > {
+  >     hg init $1
+  >     cd $1
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  >     echo a >> e
+  >     hg ci -m 'does not commute with e'
+  >     cd ..
+  > }
+
+  $ initrepo r
+  $ cd r
+
+log before edit
+  $ hg log --graph
+  @  changeset:   6:bfa474341cc9
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     does not commute with e
+  |
+  o  changeset:   5:652413bf663e
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+fix up
+  $ echo a > e
+  $ hg add e
+  $ cat > cat.py <<EOF
+  > import sys
+  > print open(sys.argv[1]).read()
+  > print
+  > print
+  > EOF
+  $ HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed'
+  d
+  ***
+  does not commute with e
+  
+  
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  file e already exists
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+just continue this time
+  $ hg histedit --continue 2>&1 | fixbundle
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+log after edit
+  $ hg log --graph
+  @  changeset:   4:f768fd60ca34
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   3:671efe372e33
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+contents of e
+  $ hg cat e
+  a
+
+manifest
+  $ hg manifest
+  a
+  b
+  c
+  d
+  e
+  f
+
+  $ cd ..
--- a/tests/test-histedit-fold.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-% log before edit
-@  changeset:   5:652413bf663e
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% edit the history
-0 files updated, 0 files merged, 4 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% log after edit
-@  changeset:   4:82b0c1ff1777
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   3:150aafb44a91
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     pick e860deea161a e
-|
-o  changeset:   2:493dc0964412
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% post-fold manifest
-a
-b
-c
-d
-e
-f
-% EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-fold.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,110 @@
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > fold 177f92b77385 c
+  > pick 055a42cdd887 d
+  > EOF
+  $ initrepo ()
+  > {
+  >     hg init r
+  >     cd r
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  > }
+
+  $ initrepo
+
+log before edit
+  $ hg log --graph
+  @  changeset:   5:652413bf663e
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+log after edit
+  $ hg log --graph
+  @  changeset:   4:82b0c1ff1777
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   3:150aafb44a91
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     pick e860deea161a e
+  |
+  o  changeset:   2:493dc0964412
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+post-fold manifest
+  $ hg manifest
+  a
+  b
+  c
+  d
+  e
+  f
+
+  $ cd ..
--- a/tests/test-histedit-no-change	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-#!/bin/sh
-
-# test for issue #6:
-# editing a changeset without any actual change would corrupt the repository
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-initrepo ()
-{
-    dir="$1"
-    comment="$2"
-
-    if [ -n "${comment}" ]; then
-        echo % ${comment}
-        echo % ${comment} | sed 's:.:-:g'
-    fi
-
-    hg init ${dir}
-    cd ${dir}
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-}
-
-geneditor ()
-{
-    # generate an editor script for selecting changesets to be edited
-
-    choice=$1  # changesets that should be edited (using sed line ranges)
-
-    cat <<EOF | sed 's:^....::'
-    #!/bin/sh
-
-    # editing the rules, replacing 'pick' with 'edit' for the chosen lines
-    sed '${choice}s:^pick:edit:' \$1 > \${1}.tmp
-    mv \${1}.tmp \$1
-
-    # displaying the resulting rules, minus comments and empty lines
-    sed '/^#/d;/^$/d;s:^:| :' \$1 >&2
-EOF
-}
-
-startediting ()
-{
-    # begin an editing session
-
-    choice="$1"  # changesets that should be edited
-    number="$2"  # number of changesets considered (from tip)
-    comment="$3"
-
-    geneditor "${choice}" > edit.sh
-    chmod +x edit.sh
-
-    echo % start editing the history ${comment}
-    HGEDITOR=./edit.sh hg histedit -- -${number} 2>&1 | fixbundle
-}
-
-continueediting ()
-{
-    # continue an edit already in progress
-
-    editor="$1"  # message editor when finalizing editing
-    comment="$2"
-
-    echo % finalize changeset editing ${comment}
-    HGEDITOR=${editor} hg histedit --continue 2>&1 | fixbundle
-}
-
-graphlog ()
-{
-    comment="${1:-log}"
-
-    echo % "${comment}"
-    hg glog --template '{rev} {node} \"{desc|firstline}\"\n'
-}
-
-
-
-initrepo r1 "test editing with no change"
-graphlog "log before editing"
-startediting 2 3 "(not changing anything)" # edit the 2nd of 3 changesets
-continueediting true "(leaving commit message unaltered)"
-
-echo "% check state of working copy"
-hg id
-
-graphlog "log after history editing"
-
-
-cd ..
-initrepo r2 "test editing with no change, then abort"
-graphlog "log before editing"
-startediting 1,2 3 "(not changing anything)" # edit the 1st two of 3 changesets
-continueediting true "(leaving commit message unaltered)"
-graphlog "log after first edit"
-
-echo % abort editing session
-hg histedit --abort 2>&1 | fixbundle
-
-graphlog "log after abort"
-
-echo % EOF
--- a/tests/test-histedit-no-change.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-% test editing with no change
------------------------------
-% log before editing
-@  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
-|
-o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
-|
-o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
-|
-o  2 177f92b773850b59254aa5e923436f921b55483b "c"
-|
-o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
-|
-o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
-
-% start editing the history (not changing anything)
-| pick 055a42cdd887 3 d
-| edit e860deea161a 4 e
-| pick 652413bf663e 5 f
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-abort: Make changes as needed, you may commit or record as needed now.
-When you are finished, run hg histedit --continue to resume.
-% finalize changeset editing (leaving commit message unaltered)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% check state of working copy
-652413bf663e tip
-% log after history editing
-@  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
-|
-o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
-|
-o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
-|
-o  2 177f92b773850b59254aa5e923436f921b55483b "c"
-|
-o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
-|
-o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
-
-% test editing with no change, then abort
------------------------------------------
-% log before editing
-@  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
-|
-o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
-|
-o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
-|
-o  2 177f92b773850b59254aa5e923436f921b55483b "c"
-|
-o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
-|
-o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
-
-% start editing the history (not changing anything)
-| edit 055a42cdd887 3 d
-| edit e860deea161a 4 e
-| pick 652413bf663e 5 f
-0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-abort: Make changes as needed, you may commit or record as needed now.
-When you are finished, run hg histedit --continue to resume.
-% finalize changeset editing (leaving commit message unaltered)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: Make changes as needed, you may commit or record as needed now.
-When you are finished, run hg histedit --continue to resume.
-% log after first edit
-o  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
-|
-o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
-|
-@  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
-|
-o  2 177f92b773850b59254aa5e923436f921b55483b "c"
-|
-o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
-|
-o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
-
-% abort editing session
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% log after abort
-@  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
-|
-o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
-|
-o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
-|
-o  2 177f92b773850b59254aa5e923436f921b55483b "c"
-|
-o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
-|
-o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
-
-% EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-no-change.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,187 @@
+test for old histedit issue #6:
+editing a changeset without any actual change would corrupt the repository
+
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ initrepo ()
+  > {
+  >     dir="$1"
+  >     comment="$2"
+  >     if [ -n "${comment}" ]; then
+  >         echo % ${comment}
+  >         echo % ${comment} | sed 's:.:-:g'
+  >     fi
+  >     hg init ${dir}
+  >     cd ${dir}
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  >     cd ..
+  > }
+
+  $ geneditor ()
+  > {
+  >     # generate an editor script for selecting changesets to be edited
+  >     choice=$1  # changesets that should be edited (using sed line ranges)
+  >     cat <<EOF | sed 's:^....::'
+  >     # editing the rules, replacing 'pick' with 'edit' for the chosen lines
+  >     sed '${choice}s:^pick:edit:' "\$1" > "\${1}.tmp"
+  >     mv "\${1}.tmp" "\$1"
+  >     # displaying the resulting rules, minus comments and empty lines
+  >     sed '/^#/d;/^$/d;s:^:| :' "\$1" >&2
+  > EOF
+  > }
+
+  $ startediting ()
+  > {
+  >     # begin an editing session
+  >     choice="$1"  # changesets that should be edited
+  >     number="$2"  # number of changesets considered (from tip)
+  >     comment="$3"
+  >     geneditor "${choice}" > edit.sh
+  >     echo % start editing the history ${comment}
+  >     HGEDITOR="sh ./edit.sh" hg histedit -- -${number} 2>&1 | fixbundle
+  > }
+
+  $ continueediting ()
+  > {
+  >     # continue an edit already in progress
+  >     editor="$1"  # message editor when finalizing editing
+  >     comment="$2"
+  >     echo % finalize changeset editing ${comment}
+  >     HGEDITOR=${editor} hg histedit --continue 2>&1 | fixbundle
+  > }
+
+  $ graphlog ()
+  > {
+  >     comment="${1:-log}"
+  >     echo % "${comment}"
+  >     hg glog --template '{rev} {node} \"{desc|firstline}\"\n'
+  > }
+
+
+  $ initrepo r1 "test editing with no change"
+  % test editing with no change
+  -----------------------------
+  $ cd r1
+  $ graphlog "log before editing"
+  % log before editing
+  @  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
+  |
+  o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
+  |
+  o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
+  |
+  o  2 177f92b773850b59254aa5e923436f921b55483b "c"
+  |
+  o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
+  |
+  o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
+  
+  $ startediting 2 3 "(not changing anything)" # edit the 2nd of 3 changesets
+  % start editing the history (not changing anything)
+  | pick 055a42cdd887 3 d
+  | edit e860deea161a 4 e
+  | pick 652413bf663e 5 f
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  abort: Make changes as needed, you may commit or record as needed now.
+  When you are finished, run hg histedit --continue to resume.
+  $ continueediting true "(leaving commit message unaltered)"
+  % finalize changeset editing (leaving commit message unaltered)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+check state of working copy
+  $ hg id
+  652413bf663e tip
+
+  $ graphlog "log after history editing"
+  % log after history editing
+  @  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
+  |
+  o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
+  |
+  o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
+  |
+  o  2 177f92b773850b59254aa5e923436f921b55483b "c"
+  |
+  o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
+  |
+  o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
+  
+
+  $ cd ..
+
+  $ initrepo r2 "test editing with no change, then abort"
+  % test editing with no change, then abort
+  -----------------------------------------
+  $ cd r2
+  $ graphlog "log before editing"
+  % log before editing
+  @  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
+  |
+  o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
+  |
+  o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
+  |
+  o  2 177f92b773850b59254aa5e923436f921b55483b "c"
+  |
+  o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
+  |
+  o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
+  
+  $ startediting 1,2 3 "(not changing anything)" # edit the 1st two of 3 changesets
+  % start editing the history (not changing anything)
+  | edit 055a42cdd887 3 d
+  | edit e860deea161a 4 e
+  | pick 652413bf663e 5 f
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  abort: Make changes as needed, you may commit or record as needed now.
+  When you are finished, run hg histedit --continue to resume.
+  $ continueediting true "(leaving commit message unaltered)"
+  % finalize changeset editing (leaving commit message unaltered)
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  abort: Make changes as needed, you may commit or record as needed now.
+  When you are finished, run hg histedit --continue to resume.
+  $ graphlog "log after first edit"
+  % log after first edit
+  o  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
+  |
+  o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
+  |
+  @  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
+  |
+  o  2 177f92b773850b59254aa5e923436f921b55483b "c"
+  |
+  o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
+  |
+  o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
+  
+
+abort editing session
+  $ hg histedit --abort 2>&1 | fixbundle
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ graphlog "log after abort"
+  % log after abort
+  @  5 652413bf663ef2a641cab26574e46d5f5a64a55a "f"
+  |
+  o  4 e860deea161a2f77de56603b340ebbb4536308ae "e"
+  |
+  o  3 055a42cdd88768532f9cf79daa407fc8d138de9b "d"
+  |
+  o  2 177f92b773850b59254aa5e923436f921b55483b "c"
+  |
+  o  1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b"
+  |
+  o  0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a"
+  
+
+  $ cd ..
--- a/tests/test-histedit-non-commute	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick 055a42cdd887 d
-pick bfa474341cc9 does not commute with e
-pick e860deea161a e
-pick 652413bf663e f
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-    echo a >> e
-    hg ci -m 'does not commute with e'
-}
-
-initrepo
-
-echo % log before edit
-hg log --graph
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo % abort the edit
-hg histedit --abort 2>&1 | fixbundle
-
-echo
-echo
-echo % second edit set
-
-hg log --graph
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo % fix up
-echo a > e
-hg add e
-hg histedit --continue 2>&1 | fixbundle
-
-echo
-echo % just continue this time
-hg histedit --continue 2>&1 | fixbundle
-
-echo % log after edit
-hg log --graph
-
-echo % start over
-
-cd ..
-rm -r r
-initrepo
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick 055a42cdd887 d
-mess bfa474341cc9 does not commute with e
-pick e860deea161a e
-pick 652413bf663e f
-EOF
-
-echo % edit the history, this time with a fold action
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo
-echo a > e
-hg add e
-HGEDITOR="cat $EDITED > " hg histedit --continue 2>&1 | fixbundle
-echo % second edit also fails, but just continue
-hg histedit --continue 2>&1 | fixbundle
-
-echo % post message fix
-hg log --graph
-
-echo % EOF
--- a/tests/test-histedit-non-commute-abort	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/histedit-helpers.sh"
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick 055a42cdd887 d
-pick bfa474341cc9 does not commute with e
-pick e860deea161a e
-pick 652413bf663e f
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-    echo a >> e
-    hg ci -m 'does not commute with e'
-}
-
-initrepo
-
-echo % log before edit
-hg log --graph
-
-echo % edit the history
-HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
-
-echo '% fix up (pre abort)'
-echo a > e
-hg add e
-hg histedit --continue 2>&1 | fixbundle
-
-echo % abort the edit
-hg histedit --abort 2>&1 | fixbundle
-
-echo % log after abort
-hg log --graph
-echo % EOF
--- a/tests/test-histedit-non-commute-abort.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-% log before edit
-@  changeset:   6:bfa474341cc9
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     does not commute with e
-|
-o  changeset:   5:652413bf663e
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% edit the history
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-% fix up (pre abort)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-file e already exists
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-% abort the edit
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% log after abort
-@  changeset:   6:bfa474341cc9
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     does not commute with e
-|
-o  changeset:   5:652413bf663e
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-non-commute-abort.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,131 @@
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick 055a42cdd887 d
+  > pick bfa474341cc9 does not commute with e
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > EOF
+  $ initrepo ()
+  > {
+  >     hg init r
+  >     cd r
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  >     echo a >> e
+  >     hg ci -m 'does not commute with e'
+  >     cd ..
+  > }
+
+  $ initrepo
+  $ cd r
+
+log before edit
+  $ hg log --graph
+  @  changeset:   6:bfa474341cc9
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     does not commute with e
+  |
+  o  changeset:   5:652413bf663e
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+fix up (pre abort)
+  $ echo a > e
+  $ hg add e
+  $ hg histedit --continue 2>&1 | fixbundle
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  file e already exists
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+abort the edit
+  $ hg histedit --abort 2>&1 | fixbundle
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+log after abort
+  $ hg log --graph
+  @  changeset:   6:bfa474341cc9
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     does not commute with e
+  |
+  o  changeset:   5:652413bf663e
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+  $ cd ..
--- a/tests/test-histedit-non-commute.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-% log before edit
-@  changeset:   6:bfa474341cc9
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     does not commute with e
-|
-o  changeset:   5:652413bf663e
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% edit the history
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-% abort the edit
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-
-% second edit set
-@  changeset:   6:bfa474341cc9
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     does not commute with e
-|
-o  changeset:   5:652413bf663e
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:e860deea161a
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% edit the history
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-% fix up
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-file e already exists
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-
-% just continue this time
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% log after edit
-@  changeset:   5:9ab84894b459
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:1fff3ae8199d
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     does not commute with e
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% start over
-% edit the history, this time with a fold action
-0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-file e already exists
-1 out of 1 hunks FAILED -- saving rejects to file e.rej
-abort: Fix up the change and run hg histedit --continue
-% second edit also fails, but just continue
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% post message fix
-@  changeset:   5:6459970fb49b
-|  tag:         tip
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     f
-|
-o  changeset:   4:556f27c874b0
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     pick 177f92b77385 c
-|
-o  changeset:   3:055a42cdd887
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     d
-|
-o  changeset:   2:177f92b77385
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     c
-|
-o  changeset:   1:d2ae7f538514
-|  user:        test
-|  date:        Thu Jan 01 00:00:00 1970 +0000
-|  summary:     b
-|
-o  changeset:   0:cb9a9f314b8b
-   user:        test
-   date:        Thu Jan 01 00:00:00 1970 +0000
-   summary:     a
-
-% EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-non-commute.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,244 @@
+  $ . "$TESTDIR/histedit-helpers.sh"
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick 055a42cdd887 d
+  > pick bfa474341cc9 does not commute with e
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > EOF
+  $ initrepo ()
+  > {
+  >     hg init $1
+  >     cd $1
+  >     for x in a b c d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  >     echo a >> e
+  >     hg ci -m 'does not commute with e'
+  >     cd ..
+  > }
+
+  $ initrepo r1
+  $ cd r1
+
+log before edit
+  $ hg log --graph
+  @  changeset:   6:bfa474341cc9
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     does not commute with e
+  |
+  o  changeset:   5:652413bf663e
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+abort the edit
+  $ hg histedit --abort 2>&1 | fixbundle
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+
+second edit set
+
+  $ hg log --graph
+  @  changeset:   6:bfa474341cc9
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     does not commute with e
+  |
+  o  changeset:   5:652413bf663e
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:e860deea161a
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+edit the history
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+fix up
+  $ echo a > e
+  $ hg add e
+  $ hg histedit --continue 2>&1 | fixbundle
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  file e already exists
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+just continue this time
+  $ hg histedit --continue 2>&1 | fixbundle
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+log after edit
+  $ hg log --graph
+  @  changeset:   5:9ab84894b459
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:1fff3ae8199d
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     does not commute with e
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+start over
+
+  $ cd ..
+
+  $ initrepo r2
+  $ cd r2
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick 055a42cdd887 d
+  > mess bfa474341cc9 does not commute with e
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > EOF
+
+edit the history, this time with a fold action
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+
+  $ echo a > e
+  $ hg add e
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit --continue 2>&1 | fixbundle
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  file e already exists
+  1 out of 1 hunks FAILED -- saving rejects to file e.rej
+  abort: Fix up the change and run hg histedit --continue
+second edit also fails, but just continue
+  $ hg histedit --continue 2>&1 | fixbundle
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+post message fix
+  $ hg log --graph
+  @  changeset:   5:6459970fb49b
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   4:556f27c874b0
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     pick 177f92b77385 c
+  |
+  o  changeset:   3:055a42cdd887
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     d
+  |
+  o  changeset:   2:177f92b77385
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
+  $ cd ..
--- a/tests/test-histedit-outgoing	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-graphlog=
-histedit=
-EOF
-
-EDITED=`pwd`/editedhistory
-cat > $EDITED <<EOF
-pick 177f92b77385 c
-pick e860deea161a e
-pick 652413bf663e f
-pick 055a42cdd887 d
-EOF
-initrepo ()
-{
-    hg init r
-    cd r
-    for x in a b c ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-
-    cd ..
-    hg clone r r2 | grep -v updating
-    cd r2
-    for x in d e f ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-
-    cd ..
-    hg init r3
-    cd r3
-    for x in g h i ; do
-        echo $x > $x
-        hg add $x
-        hg ci -m $x
-    done
-    cd ..
-}
-
-initrepo
-
-echo % show the edit commands offered by outgoing
-cd r2
-HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
-cd ..
-
-echo % show the error from unrelated repos
-cd r3
-HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
-cd ..
-
-echo % show the error from unrelated repos
-cd r3
-HGEDITOR=cat hg histedit --force --outgoing ../r
-cd ..
--- a/tests/test-histedit-outgoing.out	Fri Jul 06 20:19:55 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% show the edit commands offered by outgoing
-pick 055a42cdd887 3 d
-pick e860deea161a 4 e
-pick 652413bf663e 5 f
-
-# Edit history between 055a42cdd887 and 652413bf663e
-#
-# Commands:
-#  p, pick = use commit
-#  e, edit = use commit, but stop for amending
-#  f, fold = use commit, but fold into previous commit (combines N and N-1)
-#  d, drop = remove commit from history
-#  m, mess = edit message without changing commit content
-#
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% show the error from unrelated repos
-abort: repository is unrelated
-% show the error from unrelated repos
-comparing with ../r
-searching for changes
-warning: repository is unrelated
-pick 2a4042b45417 0 g
-pick 68c46b4927ce 1 h
-pick 51281e65ba79 2 i
-
-# Edit history between 2a4042b45417 and 51281e65ba79
-#
-# Commands:
-#  p, pick = use commit
-#  e, edit = use commit, but stop for amending
-#  f, fold = use commit, but fold into previous commit (combines N and N-1)
-#  d, drop = remove commit from history
-#  m, mess = edit message without changing commit content
-#
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-histedit-outgoing.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,91 @@
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > graphlog=
+  > histedit=
+  > EOF
+
+  $ EDITED="$TESTTMP/editedhistory"
+  $ cat > $EDITED <<EOF
+  > pick 177f92b77385 c
+  > pick e860deea161a e
+  > pick 652413bf663e f
+  > pick 055a42cdd887 d
+  > EOF
+  $ initrepos ()
+  > {
+  >     hg init r
+  >     cd r
+  >     for x in a b c ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  >     cd ..
+  >     hg clone r r2 | grep -v updating
+  >     cd r2
+  >     for x in d e f ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  >     cd ..
+  >     hg init r3
+  >     cd r3
+  >     for x in g h i ; do
+  >         echo $x > $x
+  >         hg add $x
+  >         hg ci -m $x
+  >     done
+  >     cd ..
+  > }
+
+  $ initrepos
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+show the edit commands offered by outgoing
+  $ cd r2
+  $ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
+  pick 055a42cdd887 3 d
+  pick e860deea161a 4 e
+  pick 652413bf663e 5 f
+  
+  # Edit history between 055a42cdd887 and 652413bf663e
+  #
+  # Commands:
+  #  p, pick = use commit
+  #  e, edit = use commit, but stop for amending
+  #  f, fold = use commit, but fold into previous commit (combines N and N-1)
+  #  d, drop = remove commit from history
+  #  m, mess = edit message without changing commit content
+  #
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ..
+
+show the error from unrelated repos
+  $ cd r3
+  $ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
+  abort: repository is unrelated
+  [1]
+  $ cd ..
+
+show the error from unrelated repos
+  $ cd r3
+  $ HGEDITOR=cat hg histedit --force --outgoing ../r
+  comparing with ../r
+  searching for changes
+  warning: repository is unrelated
+  pick 2a4042b45417 0 g
+  pick 68c46b4927ce 1 h
+  pick 51281e65ba79 2 i
+  
+  # Edit history between 2a4042b45417 and 51281e65ba79
+  #
+  # Commands:
+  #  p, pick = use commit
+  #  e, edit = use commit, but stop for amending
+  #  f, fold = use commit, but fold into previous commit (combines N and N-1)
+  #  d, drop = remove commit from history
+  #  m, mess = edit message without changing commit content
+  #
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ..
--- a/tests/test-hook.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-hook.t	Fri Jul 06 20:28:32 2012 -0700
@@ -198,6 +198,7 @@
   listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
   no changes found
   listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
+  listkeys hook: HG_NAMESPACE=obsolete HG_VALUES={}
   listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
   adding remote bookmark bar
   importing bookmark bar
--- a/tests/test-http-proxy.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-http-proxy.t	Fri Jul 06 20:28:32 2012 -0700
@@ -105,20 +105,24 @@
   * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
+  * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=obsolete (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
+  * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=obsolete (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
+  * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=obsolete (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=phases (glob)
+  * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=obsolete (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob)
 
--- a/tests/test-https.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-https.t	Fri Jul 06 20:28:32 2012 -0700
@@ -125,6 +125,7 @@
   adding file changes
   added 1 changesets with 4 changes to 4 files
   warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
+  warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
   updating to branch default
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg verify -R copy-pull
@@ -154,6 +155,7 @@
   added 1 changesets with 1 changes to 1 files
   warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
   changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
+  warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
   (run 'hg update' to get a working copy)
   $ cd ..
 
@@ -182,6 +184,7 @@
   pulling from https://localhost:$HGPORT/
   searching for changes
   no changes found
+  warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
 
 cacert mismatch
 
@@ -194,6 +197,7 @@
   pulling from https://127.0.0.1:$HGPORT/
   searching for changes
   no changes found
+  warning: 127.0.0.1 certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
   $ hg -R copy-pull pull --config web.cacerts=pub-other.pem
   abort: error: *:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (glob)
   [255]
@@ -202,6 +206,7 @@
   pulling from https://localhost:$HGPORT/
   searching for changes
   no changes found
+  warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
 
 Test server cert which isn't valid yet
 
@@ -259,6 +264,7 @@
   pulling from https://localhost:$HGPORT/
   searching for changes
   no changes found
+  warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
 
 Test https with cacert and fingerprint through proxy
 
--- a/tests/test-keyword.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-keyword.t	Fri Jul 06 20:28:32 2012 -0700
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" unix-permissions serve || exit 80
-
   $ cat <<EOF >> $HGRCPATH
   > [extensions]
   > keyword =
@@ -297,16 +295,20 @@
 
   $ echo '$Id$' > c
   $ echo 'tests for different changenodes' >> c
+#if unix-permissions
   $ chmod 600 c
   $ ls -l c | cut -b 1-10
   -rw-------
+#endif
 
 commit file c
 
   $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
   adding c
+#if unix-permissions
   $ ls -l c | cut -b 1-10
   -rw-------
+#endif
 
 force expansion
 
@@ -330,11 +332,11 @@
 
 record chunk
 
-  >>> lines = open('a').readlines()
+  >>> lines = open('a', 'rb').readlines()
   >>> lines.insert(1, 'foo\n')
   >>> lines.append('bar\n')
-  >>> open('a', 'w').writelines(lines)
-  $ hg record -d '1 10' -m rectest a<<EOF
+  >>> open('a', 'wb').writelines(lines)
+  $ hg record -d '10 1' -m rectest a<<EOF
   > y
   > y
   > n
@@ -355,7 +357,7 @@
   record change 2/2 to 'a'? [Ynesfdaq?] 
 
   $ hg identify
-  d17e03c92c97+ tip
+  5f5eb23505c3+ tip
   $ hg status
   M a
   A r
@@ -363,7 +365,7 @@
 Cat modified file a
 
   $ cat a
-  expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
+  expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
   foo
   do not process $Id:
   xxx $
@@ -372,8 +374,8 @@
 Diff remaining chunk
 
   $ hg diff a
-  diff -r d17e03c92c97 a
-  --- a/a	Wed Dec 31 23:59:51 1969 -0000
+  diff -r 5f5eb23505c3 a
+  --- a/a	Thu Jan 01 00:00:09 1970 -0000
   +++ b/a	* (glob)
   @@ -2,3 +2,4 @@
    foo
@@ -391,7 +393,7 @@
 
  - do not use "hg record -m" here!
 
-  $ hg record -l msg -d '1 11' a<<EOF
+  $ hg record -l msg -d '11 1' a<<EOF
   > y
   > y
   > y
@@ -419,7 +421,7 @@
 rollback and revert expansion
 
   $ cat a
-  expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
+  expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
   foo
   do not process $Id:
   xxx $
@@ -460,14 +462,14 @@
 
 record added file alone
 
-  $ hg -v record -l msg -d '1 12' r<<EOF
+  $ hg -v record -l msg -d '12 2' r<<EOF
   > y
   > EOF
   diff --git a/r b/r
   new file mode 100644
   examine changes to 'r'? [Ynesfdaq?] 
   r
-  committed changeset 3:899491280810
+  committed changeset 3:82a2f715724d
   overwriting r expanding keywords
  - status call required for dirstate.normallookup() check
   $ hg status r
@@ -484,14 +486,14 @@
 
   $ echo '$Id$' > i
   $ hg add i
-  $ hg --verbose record -d '1 13' -m recignored<<EOF
+  $ hg --verbose record -d '13 1' -m recignored<<EOF
   > y
   > EOF
   diff --git a/i b/i
   new file mode 100644
   examine changes to 'i'? [Ynesfdaq?] 
   i
-  committed changeset 3:5f40fe93bbdc
+  committed changeset 3:9f40ceb5a072
   $ cat i
   $Id$
   $ hg -q rollback
@@ -502,14 +504,14 @@
 
   $ echo amend >> a
   $ echo amend >> b
-  $ hg -q commit -d '1 14' -m 'prepare amend'
+  $ hg -q commit -d '14 1' -m 'prepare amend'
 
-  $ hg --debug commit --amend -d '1 15' -m 'amend without changes' | grep keywords
+  $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
   overwriting a expanding keywords
   $ hg -q id
-  a71343332ea9
+  577e60613a88
   $ head -1 a
-  expand $Id: a,v a71343332ea9 1970/01/01 00:00:01 test $
+  expand $Id: a,v 577e60613a88 1970/01/01 00:00:15 test $
 
   $ hg -q strip -n tip
 
@@ -612,6 +614,7 @@
 cp symlink file; hg cp -A symlink file (part1)
 - copied symlink points to kwfile: overwrite
 
+#if symlink
   $ cp sym i
   $ ls -l i
   -rw-r--r--* (glob)
@@ -624,6 +627,7 @@
   expand $Id$
   $ hg forget i
   $ rm i
+#endif
 
 Test different options of hg kwfiles
 
@@ -924,6 +928,7 @@
   nonexistent:* (glob)
 
 
+#if serve
 hg serve
  - expand with hgweb file
  - no expansion with hgweb annotate/changeset/filediff
@@ -987,6 +992,7 @@
   
   
   $ cat errors.log
+#endif
 
 Prepare merge and resolve tests
 
--- a/tests/test-largefiles.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-largefiles.t	Fri Jul 06 20:28:32 2012 -0700
@@ -1,6 +1,5 @@
-  $ "$TESTDIR/hghave" serve || exit 80
-  $ USERCACHE=`pwd`/cache; export USERCACHE
-  $ mkdir -p ${USERCACHE}
+  $ USERCACHE="$TESTTMP/cache"; export USERCACHE
+  $ mkdir "${USERCACHE}"
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > largefiles=
@@ -14,7 +13,7 @@
   > patterns=glob:**.dat
   > usercache=${USERCACHE}
   > [hooks]
-  > precommit=echo "Invoking status precommit hook"; hg status
+  > precommit=sh -c "echo \"Invoking status precommit hook\"; hg status"
   > EOF
 
 Create the repo with a couple of revisions of both large and normal
@@ -142,6 +141,7 @@
   $ cat sub/large4
   large22
 
+#if hgweb
 Test display of largefiles in hgweb
 
   $ hg serve -d -p $HGPORT --pid-file ../hg.pid
@@ -164,6 +164,7 @@
   
   
   $ "$TESTDIR/killdaemons.py"
+#endif
 
 Test archiving the various revisions.  These hit corner cases known with
 archiving.
@@ -436,7 +437,7 @@
 
 Test cloning with --all-largefiles flag
 
-  $ rm -Rf ${USERCACHE}/*
+  $ rm "${USERCACHE}"/*
   $ hg clone --all-largefiles a a-backup
   updating to branch default
   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -460,10 +461,10 @@
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
-  $ rm -Rf ${USERCACHE}/*
+  $ rm "${USERCACHE}"/*
   $ cd a-backup
   $ hg pull --all-largefiles
-  pulling from $TESTTMP/a
+  pulling from $TESTTMP/a (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -727,7 +728,7 @@
   3 largefiles updated, 0 removed
 # Delete the largefiles in the largefiles system cache so that we have an
 # opportunity to test that caching after a pull works.
-  $ rm ${USERCACHE}/*
+  $ rm "${USERCACHE}"/*
   $ cd f
   $ echo "large4-merge-test" > sub/large4
   $ hg commit -m "Modify large4 to test merge"
@@ -845,7 +846,7 @@
   normal3-modified
   $ hg cat sub/large4
   large4-modified
-  $ rm ${USERCACHE}/*
+  $ rm "${USERCACHE}"/*
   $ hg cat -r a381d2c8c80e -o cat.out sub/large4
   $ cat cat.out
   large4-modified
@@ -880,6 +881,7 @@
   (use 'hg revert new-largefile' to cancel the pending addition)
   $ cd ..
 
+#if serve
 vanilla clients not locked out from largefiles servers on vanilla repos
   $ mkdir r1
   $ cd r1
@@ -912,6 +914,8 @@
   added 1 changesets with 1 changes to 1 files
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+#endif
+
 
 vanilla clients locked out from largefiles http repos
   $ mkdir r4
@@ -923,6 +927,8 @@
   Invoking status precommit hook
   A f1
   $ cd ..
+
+#if serve
   $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
@@ -935,6 +941,7 @@
 
 used all HGPORTs, kill all daemons
   $ "$TESTDIR/killdaemons.py"
+#endif
 
 vanilla clients locked out from largefiles ssh repos
   $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
@@ -945,6 +952,8 @@
   Please enable it in your Mercurial config file.
   [255]
 
+#if serve
+
 largefiles clients refuse to push largefiles repos to vanilla servers
   $ mkdir r6
   $ cd r6
@@ -980,7 +989,7 @@
 
 putlfile errors are shown (issue3123)
 Corrupt the cached largefile in r7
-  $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8
+  $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
   $ hg init empty
   $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
   >   --config 'web.allow_push=*' --config web.push_ssl=False
@@ -989,7 +998,7 @@
   pushing to http://localhost:$HGPORT1/
   searching for changes
   remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
-  abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/
+  abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
   [255]
   $ rm -rf empty
 
@@ -1004,7 +1013,7 @@
   $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
   >   --config 'web.allow_push=*' --config web.push_ssl=False
   $ cat hg.pid >> $DAEMON_PIDS
-  $ rm ${USERCACHE}/*
+  $ rm "${USERCACHE}"/*
   $ hg push -R r8 http://localhost:$HGPORT2
   pushing to http://localhost:$HGPORT2/
   searching for changes
@@ -1018,6 +1027,9 @@
 used all HGPORTs, kill all daemons
   $ "$TESTDIR/killdaemons.py"
 
+#endif
+
+
 #if unix-permissions
 
 Clone a local repository owned by another user
--- a/tests/test-merge-types.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-merge-types.t	Fri Jul 06 20:28:32 2012 -0700
@@ -72,9 +72,11 @@
 
 Update to link without local change should get us a symlink (issue3316):
 
- $ hg up -C 0
- $ hg up
- $ hg st
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg st
 
 Update to link with local change should cause a merge prompt (issue3200):
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-obsolete.t	Fri Jul 06 20:28:32 2012 -0700
@@ -0,0 +1,220 @@
+
+  $ mkcommit() {
+  >    echo "$1" > "$1"
+  >    hg add "$1"
+  >    hg ci -m "add $1"
+  > }
+  $ getid() {
+  >    hg id --debug -ir "desc('$1')"
+  > }
+
+
+  $ hg init tmpa
+  $ cd tmpa
+
+Killing a single changeset without replacement
+
+  $ mkcommit kill_me
+  $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
+  $ hg debugobsolete
+  97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
+  $ cd ..
+
+Killing a single changeset with replacement
+
+  $ hg init tmpb
+  $ cd tmpb
+  $ mkcommit a
+  $ mkcommit b
+  $ mkcommit original_c
+  $ hg up "desc('b')"
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ mkcommit new_c
+  created new head
+  $ hg debugobsolete `getid original_c`  `getid new_c` -d '56 12'
+  $ hg debugobsolete
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+
+do it again (it read the obsstore before adding new changeset)
+
+  $ hg up '.^'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ mkcommit new_2_c
+  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'}
+  cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
+
+Register two markers with a missing node
+
+  $ hg up '.^'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ mkcommit new_3_c
+  created new head
+  $ 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'}
+  cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
+  ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
+  1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+
+Check that graphlog detect that a changeset is obsolete:
+
+  $ hg --config 'extensions.graphlog=' glog
+  @  changeset:   5:5601fb93a350
+  |  tag:         tip
+  |  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
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add new_2_c
+  |
+  | x  changeset:   3:cdbce2fbb163
+  |/   parent:      1:7c3bad9141dc
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add new_c
+  |
+  | x  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
+  
+
+Check that public changeset are not accounted as obsolete:
+
+  $ hg phase --public 2
+  $ hg --config 'extensions.graphlog=' glog
+  @  changeset:   5:5601fb93a350
+  |  tag:         tip
+  |  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
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add new_2_c
+  |
+  | x  changeset:   3:cdbce2fbb163
+  |/   parent:      1:7c3bad9141dc
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add new_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
+============================
+
+Destination repo does not have any data
+---------------------------------------
+
+Try to pull markers
+
+  $ hg init tmpc
+  $ cd tmpc
+  $ hg pull ../tmpb
+  pulling from ../tmpb
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 6 changesets with 6 changes to 6 files (+3 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg debugobsolete
+  ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
+  cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+
+  $ cd ..
+
+Try to pull markers
+
+  $ hg init tmpd
+  $ hg -R tmpb push tmpd
+  pushing to tmpd
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 6 changesets with 6 changes to 6 files (+3 heads)
+  $ hg -R tmpd debugobsolete
+  ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
+  cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+
+
+Destination repo have existing data
+---------------------------------------
+
+On pull
+
+  $ hg init tmpe
+  $ cd tmpe
+  $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
+  $ hg pull ../tmpb
+  pulling from ../tmpb
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 6 changesets with 6 changes to 6 files (+3 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg debugobsolete
+  2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
+  ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
+  cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+
+On push
+
+  $ hg push ../tmpc
+  pushing to ../tmpc
+  searching for changes
+  no changes found
+  [1]
+  $ hg -R ../tmpc debugobsolete
+  ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
+  cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+  2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
--- a/tests/test-revset.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-revset.t	Fri Jul 06 20:28:32 2012 -0700
@@ -372,6 +372,17 @@
   4
   3
   2
+  $ log 'reverse(all())'
+  9
+  8
+  7
+  6
+  5
+  4
+  3
+  2
+  1
+  0
   $ log 'rev(5)'
   5
   $ log 'sort(limit(reverse(all()), 3))'
--- a/tests/test-ssh.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-ssh.t	Fri Jul 06 20:28:32 2012 -0700
@@ -167,6 +167,7 @@
   bookmarks	
   phases	
   namespaces	
+  obsolete	
   $ hg book foo -r 0
   $ hg out -B
   comparing with ssh://user@dummy/remote
--- a/tests/test-subrepo-deep-nested-change.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-subrepo-deep-nested-change.t	Fri Jul 06 20:28:32 2012 -0700
@@ -98,3 +98,167 @@
   path sub2
    source   ../sub2
    revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
+
+Check that deep archiving works
+ 
+  $ cd cloned
+  $ echo 'test' > sub1/sub2/test.txt
+  $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
+  $ mkdir sub1/sub2/folder
+  $ echo 'subfolder' > sub1/sub2/folder/test.txt
+  $ hg --config extensions.largefiles=! add sub1/sub2/folder/test.txt
+  $ hg ci -Sm "add test.txt"
+  committing subrepository sub1
+  committing subrepository sub1/sub2 (glob)
+  $ hg --config extensions.largefiles=! archive -S ../archive_all
+  $ find ../archive_all | sort
+  ../archive_all
+  ../archive_all/.hg_archival.txt
+  ../archive_all/.hgsub
+  ../archive_all/.hgsubstate
+  ../archive_all/main
+  ../archive_all/sub1
+  ../archive_all/sub1/.hgsub
+  ../archive_all/sub1/.hgsubstate
+  ../archive_all/sub1/sub1
+  ../archive_all/sub1/sub2
+  ../archive_all/sub1/sub2/folder
+  ../archive_all/sub1/sub2/folder/test.txt
+  ../archive_all/sub1/sub2/sub2
+  ../archive_all/sub1/sub2/test.txt
+
+Check that archive -X works in deep subrepos
+
+  $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
+  $ find ../archive_exclude | sort
+  ../archive_exclude
+  ../archive_exclude/.hg_archival.txt
+  ../archive_exclude/.hgsub
+  ../archive_exclude/.hgsubstate
+  ../archive_exclude/main
+  ../archive_exclude/sub1
+  ../archive_exclude/sub1/.hgsub
+  ../archive_exclude/sub1/.hgsubstate
+  ../archive_exclude/sub1/sub1
+  ../archive_exclude/sub1/sub2
+  ../archive_exclude/sub1/sub2/sub2
+
+  $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
+  $ find ../archive_include | sort
+  ../archive_include
+  ../archive_include/sub1
+  ../archive_include/sub1/sub2
+  ../archive_include/sub1/sub2/folder
+  ../archive_include/sub1/sub2/folder/test.txt
+  ../archive_include/sub1/sub2/test.txt
+
+Check that deep archive works with largefiles (which overrides hgsubrepo impl)
+This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
+subrepos are archived properly.
+Note that add --large through a subrepo currently adds the file as a normal file
+
+  $ echo "large" > sub1/sub2/large.bin
+  $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
+  $ echo "large" > large.bin
+  $ hg --config extensions.largefiles= add --large large.bin
+  $ hg --config extensions.largefiles= ci -S -m "add large files"
+  committing subrepository sub1
+  committing subrepository sub1/sub2 (glob)
+
+  $ hg --config extensions.largefiles= archive -S ../archive_lf
+  $ find ../archive_lf | sort
+  ../archive_lf
+  ../archive_lf/.hg_archival.txt
+  ../archive_lf/.hgsub
+  ../archive_lf/.hgsubstate
+  ../archive_lf/large.bin
+  ../archive_lf/main
+  ../archive_lf/sub1
+  ../archive_lf/sub1/.hgsub
+  ../archive_lf/sub1/.hgsubstate
+  ../archive_lf/sub1/sub1
+  ../archive_lf/sub1/sub2
+  ../archive_lf/sub1/sub2/folder
+  ../archive_lf/sub1/sub2/folder/test.txt
+  ../archive_lf/sub1/sub2/large.bin
+  ../archive_lf/sub1/sub2/sub2
+  ../archive_lf/sub1/sub2/test.txt
+  $ rm -rf ../archive_lf
+
+Exclude large files from main and sub-sub repo
+
+  $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
+  $ find ../archive_lf | sort
+  ../archive_lf
+  ../archive_lf/.hg_archival.txt
+  ../archive_lf/.hgsub
+  ../archive_lf/.hgsubstate
+  ../archive_lf/main
+  ../archive_lf/sub1
+  ../archive_lf/sub1/.hgsub
+  ../archive_lf/sub1/.hgsubstate
+  ../archive_lf/sub1/sub1
+  ../archive_lf/sub1/sub2
+  ../archive_lf/sub1/sub2/folder
+  ../archive_lf/sub1/sub2/folder/test.txt
+  ../archive_lf/sub1/sub2/sub2
+  ../archive_lf/sub1/sub2/test.txt
+  $ rm -rf ../archive_lf
+
+Exclude normal files from main and sub-sub repo
+
+  $ hg --config extensions.largefiles= archive -S -X '**.txt' ../archive_lf
+  $ find ../archive_lf | sort
+  ../archive_lf
+  ../archive_lf/.hgsub
+  ../archive_lf/.hgsubstate
+  ../archive_lf/large.bin
+  ../archive_lf/main
+  ../archive_lf/sub1
+  ../archive_lf/sub1/.hgsub
+  ../archive_lf/sub1/.hgsubstate
+  ../archive_lf/sub1/sub1
+  ../archive_lf/sub1/sub2
+  ../archive_lf/sub1/sub2/large.bin
+  ../archive_lf/sub1/sub2/sub2
+  $ rm -rf ../archive_lf
+
+Include normal files from within a largefiles subrepo
+
+  $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
+  $ find ../archive_lf | sort
+  ../archive_lf
+  ../archive_lf/.hg_archival.txt
+  ../archive_lf/sub1
+  ../archive_lf/sub1/sub2
+  ../archive_lf/sub1/sub2/folder
+  ../archive_lf/sub1/sub2/folder/test.txt
+  ../archive_lf/sub1/sub2/test.txt
+  $ rm -rf ../archive_lf
+
+Include large files from within a largefiles subrepo
+
+  $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
+  $ find ../archive_lf | sort
+  ../archive_lf
+  ../archive_lf/large.bin
+  ../archive_lf/sub1
+  ../archive_lf/sub1/sub2
+  ../archive_lf/sub1/sub2/large.bin
+  $ rm -rf ../archive_lf
+
+Find an exact largefile match in a largefiles subrepo
+
+  $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
+  $ find ../archive_lf | sort
+  ../archive_lf
+  ../archive_lf/sub1
+  ../archive_lf/sub1/sub2
+  ../archive_lf/sub1/sub2/large.bin
+  $ rm -rf ../archive_lf
+
+Find an exact match to a standin (should archive nothing)
+  $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
+  $ find ../archive_lf 2> /dev/null | sort
+
+  $ cd ..
--- a/tests/test-subrepo-git.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-subrepo-git.t	Fri Jul 06 20:28:32 2012 -0700
@@ -270,6 +270,16 @@
   gg
   ggg
 
+  $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
+  $ find ../archive_x | sort | grep -v pax_global_header
+  ../archive_x
+  ../archive_x/.hg_archival.txt
+  ../archive_x/.hgsub
+  ../archive_x/.hgsubstate
+  ../archive_x/a
+  ../archive_x/s
+  ../archive_x/s/g
+
 create nested repo
 
   $ cd ..
--- a/tests/test-subrepo-relative-path.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-subrepo-relative-path.t	Fri Jul 06 20:28:32 2012 -0700
@@ -74,9 +74,7 @@
 
 subrepo paths with ssh urls
 
-  $ cp "$TESTDIR/dummyssh" "$BINDIR/ssh"
-
-  $ hg clone ssh://user@dummy/cloned sshclone
+  $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/cloned sshclone
   requesting all changes
   adding changesets
   adding manifests
@@ -91,7 +89,7 @@
   added 1 changesets with 1 changes to 1 files
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ hg -R sshclone push ssh://user@dummy/$TESTTMP/cloned
+  $ hg -R sshclone push -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/cloned
   pushing to ssh://user@dummy/$TESTTMP/cloned
   pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub
   searching for changes
@@ -105,4 +103,3 @@
   Got arguments 1:user@dummy 2:hg -R sub serve --stdio
   Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio
   Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio
-  $ rm "$BINDIR/ssh"
--- a/tests/test-subrepo-svn.t	Fri Jul 06 20:19:55 2012 -0700
+++ b/tests/test-subrepo-svn.t	Fri Jul 06 20:28:32 2012 -0700
@@ -550,6 +550,28 @@
   archiving (recreated): 0/1 files (0.00%)
   archiving (recreated): 1/1 files (100.00%)
 
+  $ hg archive -S ../archive-exclude --debug -X **old
+  archiving: 0/2 files (0.00%)
+  archiving: .hgsub 1/2 files (50.00%)
+  archiving: .hgsubstate 2/2 files (100.00%)
+  archiving (obstruct): 0/1 files (0.00%)
+  archiving (obstruct): 1/1 files (100.00%)
+  archiving (s): 0/2 files (0.00%)
+  archiving (s): 1/2 files (50.00%)
+  archiving (s): 2/2 files (100.00%)
+  archiving (recreated): 0 files
+  $ find ../archive-exclude | sort
+  ../archive-exclude
+  ../archive-exclude/.hg_archival.txt
+  ../archive-exclude/.hgsub
+  ../archive-exclude/.hgsubstate
+  ../archive-exclude/obstruct
+  ../archive-exclude/obstruct/other
+  ../archive-exclude/s
+  ../archive-exclude/s/alpha
+  ../archive-exclude/s/dir
+  ../archive-exclude/s/dir/epsilon.py
+
 Test forgetting files, not implemented in svn subrepo, used to
 traceback