Mercurial > hg
view tests/test-mq-subrepo-svn.t @ 31950:cc70c6dbac30
util: add a way to issue deprecation warning without a UI object
Our current deprecation warning mechanism relies on ui object. They are case
where we cannot have access to the UI object. On a general basis we avoid using
the python mechanism for deprecation warning because up to Python 2.6 it is
exposing warning to unsuspecting user who cannot do anything to deal with them.
So we build a "safe" strategy to hide this warnings behind a flag in an
environment variable. The test runner set this flag so that tests show these
warning. This will help us marker API as deprecated for extensions to update
their code.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 04 Apr 2017 11:03:29 +0200 |
parents | 048e41e9a6ac |
children | 6d88468d435b |
line wrap: on
line source
#require svn13 $ cat <<EOF >> $HGRCPATH > [extensions] > mq = > [diff] > nodates = 1 > EOF fn to create new repository, and cd into it $ mkrepo() { > hg init $1 > cd $1 > hg qinit > } handle svn subrepos safely $ svnadmin create svn-repo-2499 $ SVNREPOPATH=`pwd`/svn-repo-2499/project #if windows $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #else $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #endif $ mkdir -p svn-project-2499/trunk $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL" qnew on repo w/svn subrepo $ mkrepo repo-2499-svn-subrepo $ svn co "$SVNREPOURL"/trunk sub Checked out revision 1. $ echo 'sub = [svn]sub' >> .hgsub $ hg add .hgsub $ hg status -S -X '**/format' A .hgsub $ hg qnew -m0 0.diff $ cd sub $ echo a > a $ svn add a A a $ svn st A* a (glob) $ cd .. $ hg status -S # doesn't show status for svn subrepos (yet) $ hg qnew -m1 1.diff abort: uncommitted changes in subrepository 'sub' [255] $ cd ..