D455: test-revset: make it work with chg

quark (Jun Wu) phabricator at mercurial-scm.org
Sun Aug 20 19:58:18 UTC 2017


quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  chg currently triggers `reposetup` as a side effect of `hg serve` command.
  Therefore change the test to not output during `reposetup` to be compatible
  with chg.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-revset.t

CHANGE DETAILS

diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -4437,24 +4437,27 @@
 Test repo.anyrevs with customized revset overrides
 
   $ cat > $TESTTMP/printprevset.py <<EOF
-  > from mercurial import encoding
-  > def reposetup(ui, repo):
+  > from mercurial import encoding, registrar
+  > cmdtable = {}
+  > command = registrar.command(cmdtable)
+  > @command('printprevset')
+  > def printprevset(ui, repo):
   >     alias = {}
   >     p = encoding.environ.get('P')
   >     if p:
   >         alias['P'] = p
   >     revs = repo.anyrevs(['P'], user=True, localalias=alias)
-  >     ui.write('P=%r' % list(revs))
+  >     ui.write('P=%r\n' % list(revs))
   > EOF
 
   $ cat >> .hg/hgrc <<EOF
   > custompredicate = !
   > printprevset = $TESTTMP/printprevset.py
   > EOF
 
-  $ hg --config revsetalias.P=1 log -r . -T '\n'
+  $ hg --config revsetalias.P=1 printprevset
   P=[1]
-  $ P=3 hg --config revsetalias.P=2 log -r . -T '\n'
+  $ P=3 hg --config revsetalias.P=2 printprevset
   P=[3]
 
   $ cd ..



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


More information about the Mercurial-devel mailing list