tests/test-extension.t
branchstable
changeset 20003 dcd3c47e464b
parent 20002 83347ff50134
child 21254 51e5c793a9f4
equal deleted inserted replaced
20002:83347ff50134 20003:dcd3c47e464b
   155   > def extsetup():
   155   > def extsetup():
   156   >     print 'ambigabs.s=%s' % ambigabs.s
   156   >     print 'ambigabs.s=%s' % ambigabs.s
   157   > EOF
   157   > EOF
   158   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
   158   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
   159   ambigabs.s=libroot/ambig.py
   159   ambigabs.s=libroot/ambig.py
   160   $TESTTMP/a
   160   $TESTTMP/a (glob)
   161 #endif
   161 #endif
   162 
   162 
   163 #if no-py3k
   163 #if no-py3k
   164   $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
   164   $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
   165   > import ambig # should load "libroot/mod/ambig.py"
   165   > import ambig # should load "libroot/mod/ambig.py"
   170   > def extsetup():
   170   > def extsetup():
   171   >     print 'ambigrel.s=%s' % ambigrel.s
   171   >     print 'ambigrel.s=%s' % ambigrel.s
   172   > EOF
   172   > EOF
   173   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
   173   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
   174   ambigrel.s=libroot/mod/ambig.py
   174   ambigrel.s=libroot/mod/ambig.py
   175   $TESTTMP/a
   175   $TESTTMP/a (glob)
   176 #endif
   176 #endif
   177 
   177 
   178 Check absolute/relative import of extension specific modules
   178 Check absolute/relative import of extension specific modules
   179 
   179 
   180   $ mkdir $TESTTMP/extroot
   180   $ mkdir $TESTTMP/extroot
   225   (extroot) from extroot.bar import *: this is extroot.bar
   225   (extroot) from extroot.bar import *: this is extroot.bar
   226   (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
   226   (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
   227   (extroot) import extroot: this is extroot.__init__
   227   (extroot) import extroot: this is extroot.__init__
   228   (extroot) from extroot.bar import s: this is extroot.bar
   228   (extroot) from extroot.bar import s: this is extroot.bar
   229   (extroot) import extroot.bar in func(): this is extroot.bar
   229   (extroot) import extroot.bar in func(): this is extroot.bar
   230   $TESTTMP/a
   230   $TESTTMP/a (glob)
   231 
   231 
   232 #if no-py3k
   232 #if no-py3k
   233   $ rm "$TESTTMP"/extroot/foo.*
   233   $ rm "$TESTTMP"/extroot/foo.*
   234   $ cat > $TESTTMP/extroot/foo.py <<EOF
   234   $ cat > $TESTTMP/extroot/foo.py <<EOF
   235   > # test relative import
   235   > # test relative import
   261   (extroot) from bar import *: this is extroot.bar
   261   (extroot) from bar import *: this is extroot.bar
   262   (extroot) import sub1.baz: this is extroot.sub1.baz
   262   (extroot) import sub1.baz: this is extroot.sub1.baz
   263   (extroot) import sub1: this is extroot.sub1.__init__
   263   (extroot) import sub1: this is extroot.sub1.__init__
   264   (extroot) from bar import s: this is extroot.bar
   264   (extroot) from bar import s: this is extroot.bar
   265   (extroot) import bar in func(): this is extroot.bar
   265   (extroot) import bar in func(): this is extroot.bar
   266   $TESTTMP/a
   266   $TESTTMP/a (glob)
   267 #endif
   267 #endif
   268 
   268 
   269   $ cd ..
   269   $ cd ..
   270 
   270 
   271 hide outer repo
   271 hide outer repo
   737   adding a
   737   adding a
   738   $ echo '[extensions]' >> src/.hg/hgrc
   738   $ echo '[extensions]' >> src/.hg/hgrc
   739   $ echo '# enable extension locally' >> src/.hg/hgrc
   739   $ echo '# enable extension locally' >> src/.hg/hgrc
   740   $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
   740   $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
   741   $ hg -R src status
   741   $ hg -R src status
   742   reposetup() for $TESTTMP/reposetup-test/src
   742   reposetup() for $TESTTMP/reposetup-test/src (glob)
   743 
   743 
   744   $ hg clone -U src clone-dst1
   744   $ hg clone -U src clone-dst1
   745   reposetup() for $TESTTMP/reposetup-test/src
   745   reposetup() for $TESTTMP/reposetup-test/src (glob)
   746   $ hg init push-dst1
   746   $ hg init push-dst1
   747   $ hg -q -R src push push-dst1
   747   $ hg -q -R src push push-dst1
   748   reposetup() for $TESTTMP/reposetup-test/src
   748   reposetup() for $TESTTMP/reposetup-test/src (glob)
   749   $ hg init pull-src1
   749   $ hg init pull-src1
   750   $ hg -q -R pull-src1 pull src
   750   $ hg -q -R pull-src1 pull src
   751   reposetup() for $TESTTMP/reposetup-test/src
   751   reposetup() for $TESTTMP/reposetup-test/src (glob)
   752 
   752 
   753   $ echo '[extensions]' >> $HGRCPATH
   753   $ echo '[extensions]' >> $HGRCPATH
   754   $ echo '# disable extension globally and explicitly' >> $HGRCPATH
   754   $ echo '# disable extension globally and explicitly' >> $HGRCPATH
   755   $ echo 'reposetuptest = !' >> $HGRCPATH
   755   $ echo 'reposetuptest = !' >> $HGRCPATH
   756   $ hg clone -U src clone-dst2
   756   $ hg clone -U src clone-dst2
   757   reposetup() for $TESTTMP/reposetup-test/src
   757   reposetup() for $TESTTMP/reposetup-test/src (glob)
   758   $ hg init push-dst2
   758   $ hg init push-dst2
   759   $ hg -q -R src push push-dst2
   759   $ hg -q -R src push push-dst2
   760   reposetup() for $TESTTMP/reposetup-test/src
   760   reposetup() for $TESTTMP/reposetup-test/src (glob)
   761   $ hg init pull-src2
   761   $ hg init pull-src2
   762   $ hg -q -R pull-src2 pull src
   762   $ hg -q -R pull-src2 pull src
   763   reposetup() for $TESTTMP/reposetup-test/src
   763   reposetup() for $TESTTMP/reposetup-test/src (glob)
   764 
   764 
   765   $ echo '[extensions]' >> $HGRCPATH
   765   $ echo '[extensions]' >> $HGRCPATH
   766   $ echo '# enable extension globally' >> $HGRCPATH
   766   $ echo '# enable extension globally' >> $HGRCPATH
   767   $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
   767   $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
   768   $ hg clone -U src clone-dst3
   768   $ hg clone -U src clone-dst3
   769   reposetup() for $TESTTMP/reposetup-test/src
   769   reposetup() for $TESTTMP/reposetup-test/src (glob)
   770   reposetup() for $TESTTMP/reposetup-test/clone-dst3
   770   reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
   771   $ hg init push-dst3
   771   $ hg init push-dst3
   772   reposetup() for $TESTTMP/reposetup-test/push-dst3
   772   reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
   773   $ hg -q -R src push push-dst3
   773   $ hg -q -R src push push-dst3
   774   reposetup() for $TESTTMP/reposetup-test/src
   774   reposetup() for $TESTTMP/reposetup-test/src (glob)
   775   reposetup() for $TESTTMP/reposetup-test/push-dst3
   775   reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
   776   $ hg init pull-src3
   776   $ hg init pull-src3
   777   reposetup() for $TESTTMP/reposetup-test/pull-src3
   777   reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
   778   $ hg -q -R pull-src3 pull src
   778   $ hg -q -R pull-src3 pull src
   779   reposetup() for $TESTTMP/reposetup-test/pull-src3
   779   reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
   780   reposetup() for $TESTTMP/reposetup-test/src
   780   reposetup() for $TESTTMP/reposetup-test/src (glob)
   781 
   781 
   782   $ echo '[extensions]' >> src/.hg/hgrc
   782   $ echo '[extensions]' >> src/.hg/hgrc
   783   $ echo '# disable extension locally' >> src/.hg/hgrc
   783   $ echo '# disable extension locally' >> src/.hg/hgrc
   784   $ echo 'reposetuptest = !' >> src/.hg/hgrc
   784   $ echo 'reposetuptest = !' >> src/.hg/hgrc
   785   $ hg clone -U src clone-dst4
   785   $ hg clone -U src clone-dst4
   786   reposetup() for $TESTTMP/reposetup-test/clone-dst4
   786   reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
   787   $ hg init push-dst4
   787   $ hg init push-dst4
   788   reposetup() for $TESTTMP/reposetup-test/push-dst4
   788   reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
   789   $ hg -q -R src push push-dst4
   789   $ hg -q -R src push push-dst4
   790   reposetup() for $TESTTMP/reposetup-test/push-dst4
   790   reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
   791   $ hg init pull-src4
   791   $ hg init pull-src4
   792   reposetup() for $TESTTMP/reposetup-test/pull-src4
   792   reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
   793   $ hg -q -R pull-src4 pull src
   793   $ hg -q -R pull-src4 pull src
   794   reposetup() for $TESTTMP/reposetup-test/pull-src4
   794   reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
   795 
   795 
   796 disabling in command line overlays with all configuration
   796 disabling in command line overlays with all configuration
   797   $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
   797   $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
   798   $ hg --config extensions.reposetuptest=! init push-dst5
   798   $ hg --config extensions.reposetuptest=! init push-dst5
   799   $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
   799   $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
   832   $ echo '[extensions]' >> parent/.hg/hgrc
   832   $ echo '[extensions]' >> parent/.hg/hgrc
   833   $ echo '# enable extension locally' >> parent/.hg/hgrc
   833   $ echo '# enable extension locally' >> parent/.hg/hgrc
   834   $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
   834   $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
   835   $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
   835   $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
   836   $ hg -R parent status -S -A
   836   $ hg -R parent status -S -A
   837   reposetup() for $TESTTMP/reposetup-test/parent
   837   reposetup() for $TESTTMP/reposetup-test/parent (glob)
   838   reposetup() for $TESTTMP/reposetup-test/parent/sub2
   838   reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
   839   C .hgsub
   839   C .hgsub
   840   C .hgsubstate
   840   C .hgsubstate
   841   C sub1/1
   841   C sub1/1
   842   C sub2/.hgsub
   842   C sub2/.hgsub
   843   C sub2/.hgsubstate
   843   C sub2/.hgsubstate