Patchwork D928: test-strip: make test compatible with chg

login
register
mail settings
Submitter phabricator
Date Oct. 4, 2017, 1:42 p.m.
Message ID <70641174b21d0d06c9debf4b66cd51f2@localhost.localdomain>
Download mbox | patch
Permalink /patch/24471/
State Not Applicable
Headers show

Comments

phabricator - Oct. 4, 2017, 1:42 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG40b6d25ed2d5: test-strip: make test compatible with chg (authored by singhsrb, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D928?vs=2392&id=2409

REVISION DETAIL
  https://phab.mercurial-scm.org/D928

AFFECTED FILES
  tests/test-strip.t

CHANGE DETAILS




To: singhsrb, #hg-reviewers, quark
Cc: quark, mercurial-devel

Patch

diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -962,8 +962,11 @@ 
   $ echo 3 >> I
   $ cat > $TESTTMP/delayedstrip.py <<EOF
   > from __future__ import absolute_import
-  > from mercurial import commands, repair
-  > def reposetup(ui, repo):
+  > from mercurial import commands, registrar, repair
+  > cmdtable = {}
+  > command = registrar.command(cmdtable)
+  > @command('testdelayedstrip')
+  > def testdelayedstrip(ui, repo):
   >     def getnodes(expr):
   >         return [repo.changelog.node(r) for r in repo.revs(expr)]
   >     with repo.wlock():
@@ -973,10 +976,10 @@ 
   >                 repair.delayedstrip(ui, repo, getnodes('G+H+Z'), 'I')
   >                 commands.commit(ui, repo, message='J', date='0 0')
   > EOF
-  $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/delayedstrip.py
+  $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py
   warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
   saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg (glob)
-  
+
   $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
   @  6:2f2d51af6205 J
   |
@@ -1009,8 +1012,11 @@ 
   $ cp -R . ../scmutilcleanup.obsstore
 
   $ cat > $TESTTMP/scmutilcleanup.py <<EOF
-  > from mercurial import scmutil
-  > def reposetup(ui, repo):
+  > from mercurial import registrar, scmutil
+  > cmdtable = {}
+  > command = registrar.command(cmdtable)
+  > @command('testnodescleanup')
+  > def testnodescleanup(ui, repo):
   >     def nodes(expr):
   >         return [repo.changelog.node(r) for r in repo.revs(expr)]
   >     def node(expr):
@@ -1024,10 +1030,10 @@ 
   >                 scmutil.cleanupnodes(repo, mapping, 'replace')
   >                 scmutil.cleanupnodes(repo, nodes('((B::)+I+Z)-D2'), 'replace')
   > EOF
-  $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py
+  $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
   warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
   saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg (glob)
-  
+
   $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
   o  8:1473d4b996d1 G2 b-F@divergent3 b-G
   |
@@ -1068,8 +1074,8 @@ 
   > stabilization.track-operation=1
   > EOF
 
-  $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py
-  
+  $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
+
   $ rm .hg/localtags
   $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
   o  12:1473d4b996d1 G2 b-F@divergent3 b-G