##// END OF EJS Templates
eol: stop after first matched rule in hook (issue2660)...
Antoine Pitrou -
r13501:50b825c1 stable
parent child Browse files
Show More
@@ -144,6 +144,8 b' def hook(ui, repo, node, hooktype, **kwa'
144 elif target == "to-crlf" and singlelf.search(data):
144 elif target == "to-crlf" and singlelf.search(data):
145 raise util.Abort(_("%s should not have LF line endings")
145 raise util.Abort(_("%s should not have LF line endings")
146 % f)
146 % f)
147 # Ignore other rules for this file
148 break
147
149
148
150
149 def preupdate(ui, repo, hooktype, parent1, parent2):
151 def preupdate(ui, repo, hooktype, parent1, parent2):
@@ -21,6 +21,7 b' Create repo'
21 $ cat > .hgeol <<EOF
21 $ cat > .hgeol <<EOF
22 > [patterns]
22 > [patterns]
23 > mixed.txt = BIN
23 > mixed.txt = BIN
24 > crlf.txt = CRLF
24 > **.txt = native
25 > **.txt = native
25 > EOF
26 > EOF
26 $ hg add .hgeol
27 $ hg add .hgeol
@@ -61,3 +62,29 b' Create repo'
61 adding manifests
62 adding manifests
62 adding file changes
63 adding file changes
63 added 2 changesets with 2 changes to 1 files
64 added 2 changesets with 2 changes to 1 files
65
66 $ printf "first\nsecond\nthird\n" > crlf.txt
67 $ hg add crlf.txt
68 $ hg commit -m 'LF crlf.txt'
69 $ hg push ../main
70 pushing to ../main
71 searching for changes
72 adding changesets
73 adding manifests
74 adding file changes
75 added 1 changesets with 1 changes to 1 files
76 error: pretxnchangegroup hook failed: crlf.txt should not have LF line endings
77 transaction abort!
78 rollback completed
79 abort: crlf.txt should not have LF line endings
80 [255]
81
82 $ printf "first\r\nsecond\r\nthird\r\n" > crlf.txt
83 $ hg commit -m 'CRLF crlf.txt (fixed)'
84 $ hg push ../main
85 pushing to ../main
86 searching for changes
87 adding changesets
88 adding manifests
89 adding file changes
90 added 2 changesets with 2 changes to 1 files
General Comments 0
You need to be logged in to leave comments. Login now