tests/test-eol-hook.t
changeset 13617 9cb1a42cd4b3
parent 13616 e6f93ca9ce86
child 13649 328ce8a405ac
equal deleted inserted replaced
13616:e6f93ca9ce86 13617:9cb1a42cd4b3
   114   error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings
   114   error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings
   115   transaction abort!
   115   transaction abort!
   116   rollback completed
   116   rollback completed
   117   abort: b.txt should not have CRLF line endings
   117   abort: b.txt should not have CRLF line endings
   118   [255]
   118   [255]
       
   119 
       
   120 Test checkheadshook alias
       
   121 
       
   122   $ cat > ../main/.hg/hgrc <<EOF
       
   123   > [hooks]
       
   124   > pretxnchangegroup = python:hgext.eol.checkheadshook
       
   125   > EOF
       
   126   $ hg push -f ../main
       
   127   pushing to ../main
       
   128   searching for changes
       
   129   adding changesets
       
   130   adding manifests
       
   131   adding file changes
       
   132   added 2 changesets with 2 changes to 2 files (+1 heads)
       
   133   error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings
       
   134   transaction abort!
       
   135   rollback completed
       
   136   abort: b.txt should not have CRLF line endings
       
   137   [255]
       
   138 
       
   139 We can fix the head and push again
       
   140 
       
   141   $ hg up 6
       
   142   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   143   $ printf "first\nsecond" > b.txt
       
   144   $ hg ci -m "remove CRLF from b.txt"
       
   145   $ hg push -f ../main
       
   146   pushing to ../main
       
   147   searching for changes
       
   148   adding changesets
       
   149   adding manifests
       
   150   adding file changes
       
   151   added 3 changesets with 3 changes to 2 files (+1 heads)
       
   152   $ hg -R ../main rollback
       
   153   repository tip rolled back to revision 5 (undo push)
       
   154   working directory now based on revision -1
       
   155 
       
   156 Test it still fails with checkallhook
       
   157 
       
   158   $ cat > ../main/.hg/hgrc <<EOF
       
   159   > [hooks]
       
   160   > pretxnchangegroup = python:hgext.eol.checkallhook
       
   161   > EOF
       
   162   $ hg push -f ../main
       
   163   pushing to ../main
       
   164   searching for changes
       
   165   adding changesets
       
   166   adding manifests
       
   167   adding file changes
       
   168   added 3 changesets with 3 changes to 2 files (+1 heads)
       
   169   error: pretxnchangegroup hook failed: b.txt should not have CRLF line endings
       
   170   transaction abort!
       
   171   rollback completed
       
   172   abort: b.txt should not have CRLF line endings
       
   173   [255]
       
   174 
       
   175 But we can push the clean head
       
   176 
       
   177   $ hg push -r7 -f ../main
       
   178   pushing to ../main
       
   179   searching for changes
       
   180   adding changesets
       
   181   adding manifests
       
   182   adding file changes
       
   183   added 1 changesets with 1 changes to 1 files
       
   184