tests/test-hook.t
branchstable
changeset 49366 288de6f5d724
parent 48876 42d2b31cee0b
child 49877 950c39918bd2
equal deleted inserted replaced
49364:e8ea403b1c46 49366:288de6f5d724
   829   [40]
   829   [40]
   830 
   830 
   831   $ cd "$TESTTMP/b"
   831   $ cd "$TESTTMP/b"
   832 
   832 
   833   $ cat > hooktests.py <<EOF
   833   $ cat > hooktests.py <<EOF
   834   > from __future__ import print_function
       
   835   > from mercurial import (
   834   > from mercurial import (
   836   >     error,
   835   >     error,
   837   >     pycompat,
   836   >     pycompat,
   838   > )
   837   > )
   839   > 
   838   > 
   977   SyntaxError: * (glob)
   976   SyntaxError: * (glob)
   978   exception from second failed import attempt:
   977   exception from second failed import attempt:
   979   Traceback (most recent call last): (py3 !)
   978   Traceback (most recent call last): (py3 !)
   980   SyntaxError: * (glob) (py3 !)
   979   SyntaxError: * (glob) (py3 !)
   981   Traceback (most recent call last):
   980   Traceback (most recent call last):
   982   ImportError: No module named hgext_syntaxerror (no-py3 !)
       
   983   ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
   981   ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
   984   ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
   982   ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
   985   Traceback (most recent call last):
   983   Traceback (most recent call last):
   986   SyntaxError: * (glob) (py3 !)
   984   SyntaxError: * (glob) (py3 !)
   987   Traceback (most recent call last): (py3 !)
   985   Traceback (most recent call last): (py3 !)
   988   ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
   986   ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
   989   ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
   987   ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
   990   Traceback (most recent call last): (py3 !)
   988   Traceback (most recent call last): (py3 !)
   991   HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed (no-py3 !)
       
   992       raise error.HookLoadError( (py38 !)
   989       raise error.HookLoadError( (py38 !)
   993   mercurial.error.HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed (py3 !)
   990   mercurial.error.HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed (py3 !)
   994   abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
   991   abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
   995 
   992 
   996   $ echo '[hooks]' > ../a/.hg/hgrc
   993   $ echo '[hooks]' > ../a/.hg/hgrc
  1121   abort: $ENOENT$: '$TESTTMP/d/repo/nonexistent.py'
  1118   abort: $ENOENT$: '$TESTTMP/d/repo/nonexistent.py'
  1122   [255]
  1119   [255]
  1123 
  1120 
  1124   $ hg id
  1121   $ hg id
  1125   loading pre-identify.npmd hook failed:
  1122   loading pre-identify.npmd hook failed:
  1126   abort: No module named repo (no-py3 !)
       
  1127   abort: No module named 'repo' (py3 !)
  1123   abort: No module named 'repo' (py3 !)
  1128   [255]
  1124   [255]
  1129 
  1125 
  1130   $ cd ../../b
  1126   $ cd ../../b
  1131 
  1127 
  1142 
  1138 
  1143   $ echo a >> a
  1139   $ echo a >> a
  1144   $ hg --traceback commit -ma 2>&1 | egrep '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
  1140   $ hg --traceback commit -ma 2>&1 | egrep '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
  1145   exception from first failed import attempt:
  1141   exception from first failed import attempt:
  1146   Traceback (most recent call last):
  1142   Traceback (most recent call last):
  1147   ImportError: No module named somebogusmodule (no-py3 !)
       
  1148   ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
  1143   ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
  1149   ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
  1144   ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
  1150   exception from second failed import attempt:
  1145   exception from second failed import attempt:
  1151   Traceback (most recent call last): (py3 !)
  1146   Traceback (most recent call last): (py3 !)
  1152   ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
  1147   ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
  1156   ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
  1151   ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
  1157   Traceback (most recent call last): (py3 !)
  1152   Traceback (most recent call last): (py3 !)
  1158   ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
  1153   ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
  1159   ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
  1154   ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
  1160   Traceback (most recent call last):
  1155   Traceback (most recent call last):
  1161   ImportError: No module named hgext_importfail (no-py3 !)
       
  1162   ImportError: No module named 'hgext_importfail' (py3 no-py36 !)
  1156   ImportError: No module named 'hgext_importfail' (py3 no-py36 !)
  1163   ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
  1157   ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
  1164   Traceback (most recent call last):
  1158   Traceback (most recent call last):
  1165   HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed (no-py3 !)
       
  1166       raise error.HookLoadError( (py38 !)
  1159       raise error.HookLoadError( (py38 !)
  1167   mercurial.error.HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed (py3 !)
  1160   mercurial.error.HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed (py3 !)
  1168   abort: precommit.importfail hook is invalid: import of "importfail" failed
  1161   abort: precommit.importfail hook is invalid: import of "importfail" failed
  1169 
  1162 
  1170 Issue1827: Hooks Update & Commit not completely post operation
  1163 Issue1827: Hooks Update & Commit not completely post operation