comparison tests/test-win32text.out @ 5675:a5fe27b83a4a

Issue 882: add standard hook to reject text files with CRLF. While the win32text extension does LF <-> CRLF conversion, and will issue a warning in case a file already in the repository uses CRLF, it provides no mechanism for verifying that incoming changes use LF. In a large development team with some Windows users, it is virtually guaranteed that someone will forget to set up the encode filter correctly and accidentally check in a file using CRLF, which can cause warnings for other Windows users when they next fetch changes. Since this is a general problem it is desirable to have a pre-commit (or -push) hook available to reject such accidents earlier rather than trying to fix them up after the fact.
author Jesse Glick <jesse.glick@sun.com>
date Wed, 19 Dec 2007 17:02:31 -0500
parents
children 963c516bb38c
comparison
equal deleted inserted replaced
5674:659955e2e366 5675:a5fe27b83a4a
1 [hooks]
2 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
3 pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
4
5
6 Attempt to commit or push text file(s) using CRLF line endings
7 in b1aa5cde7ff4: f
8 transaction abort!
9 rollback completed
10 abort: pretxncommit.crlf hook failed
11 reverting f
12
13 Attempt to commit or push text file(s) using CRLF line endings
14 in 88b17af74937: d/f2
15 transaction abort!
16 rollback completed
17 abort: pretxncommit.crlf hook failed
18 forgetting d/f2
19
20
21 changeset: 2:a55cab36df04
22 tag: tip
23 user: test
24 date: Thu Jan 01 00:00:00 1970 +0000
25 files: bin
26 description:
27 5
28
29
30 changeset: 1:c72a7d1d0907
31 user: test
32 date: Thu Jan 01 00:00:00 1970 +0000
33 files: f
34 description:
35 4
36
37
38 changeset: 0:fcf06d5c4e1d
39 user: test
40 date: Thu Jan 01 00:00:00 1970 +0000
41 files: f
42 description:
43 1
44
45
46
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48
49 adding dupe/a
50 adding dupe/b
51 adding dupe/c
52 adding dupe/d
53 changeset: 5:81c49ee61396
54 tag: tip
55 user: test
56 date: Thu Jan 01 00:00:00 1970 +0000
57 files: d
58 description:
59 d
60
61
62 changeset: 4:02184785bcac
63 user: test
64 date: Thu Jan 01 00:00:00 1970 +0000
65 files: b c
66 description:
67 b/c
68
69
70 changeset: 3:36e70ffe2c3d
71 user: test
72 date: Thu Jan 01 00:00:00 1970 +0000
73 files: a
74 description:
75 a
76
77
78 changeset: 2:a55cab36df04
79 user: test
80 date: Thu Jan 01 00:00:00 1970 +0000
81 files: bin
82 description:
83 5
84
85
86 changeset: 1:c72a7d1d0907
87 user: test
88 date: Thu Jan 01 00:00:00 1970 +0000
89 files: f
90 description:
91 4
92
93
94 changeset: 0:fcf06d5c4e1d
95 user: test
96 date: Thu Jan 01 00:00:00 1970 +0000
97 files: f
98 description:
99 1
100
101
102
103 pulling from dupe
104 searching for changes
105 adding changesets
106 adding manifests
107 adding file changes
108 added 3 changesets with 4 changes to 4 files
109 Attempt to commit or push text file(s) using CRLF line endings
110 in 02184785bcac: b
111 in 02184785bcac: c
112 in 81c49ee61396: d
113
114 To prevent this mistake in your local repository,
115 add to Mercurial.ini or .hg/hgrc:
116
117 [hooks]
118 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
119
120 and also consider adding:
121
122 [extensions]
123 hgext.win32text =
124 [encode]
125 ** = cleverencode:
126 [decode]
127 ** = cleverdecode:
128 transaction abort!
129 rollback completed
130 abort: pretxnchangegroup.crlf hook failed
131
132 changeset: 2:a55cab36df04
133 tag: tip
134 user: test
135 date: Thu Jan 01 00:00:00 1970 +0000
136 files: bin
137 description:
138 5
139
140
141 changeset: 1:c72a7d1d0907
142 user: test
143 date: Thu Jan 01 00:00:00 1970 +0000
144 files: f
145 description:
146 4
147
148
149 changeset: 0:fcf06d5c4e1d
150 user: test
151 date: Thu Jan 01 00:00:00 1970 +0000
152 files: f
153 description:
154 1
155
156
157