##// END OF EJS Templates
fix: correctly parse the :metadata subconfig...
Danny Hooper -
r43002:2d70b111 default
parent child Browse files
Show More
@@ -171,7 +171,7 b' FIXER_ATTRS = {'
171 'linerange': None,
171 'linerange': None,
172 'pattern': None,
172 'pattern': None,
173 'priority': 0,
173 'priority': 0,
174 'metadata': False,
174 'metadata': 'false',
175 'skipclean': 'true',
175 'skipclean': 'true',
176 }
176 }
177
177
@@ -724,6 +724,7 b' def getfixers(ui):'
724 setattr(fixers[name], pycompat.sysstr('_' + key),
724 setattr(fixers[name], pycompat.sysstr('_' + key),
725 attrs.get(key, default))
725 attrs.get(key, default))
726 fixers[name]._priority = int(fixers[name]._priority)
726 fixers[name]._priority = int(fixers[name]._priority)
727 fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)
727 fixers[name]._skipclean = stringutil.parsebool(fixers[name]._skipclean)
728 fixers[name]._skipclean = stringutil.parsebool(fixers[name]._skipclean)
728 # Don't use a fixer if it has no pattern configured. It would be
729 # Don't use a fixer if it has no pattern configured. It would be
729 # dangerous to let it affect all files. It would be pointless to let it
730 # dangerous to let it affect all files. It would be pointless to let it
@@ -43,6 +43,9 b' processing phase stable.'
43 > [extensions]
43 > [extensions]
44 > fix =
44 > fix =
45 > [fix]
45 > [fix]
46 > metadatafalse:command=cat $TESTTMP/missing
47 > metadatafalse:pattern=metadatafalse
48 > metadatafalse:metadata=false
46 > missing:command=cat $TESTTMP/missing
49 > missing:command=cat $TESTTMP/missing
47 > missing:pattern=missing
50 > missing:pattern=missing
48 > missing:metadata=true
51 > missing:metadata=true
@@ -65,6 +68,7 b' some write back to the file.'
65 $ hg init repo
68 $ hg init repo
66 $ cd repo
69 $ cd repo
67
70
71 $ printf "old content\n" > metadatafalse
68 $ printf "old content\n" > invalid
72 $ printf "old content\n" > invalid
69 $ printf "old content\n" > missing
73 $ printf "old content\n" > missing
70 $ printf "old content\n" > valid
74 $ printf "old content\n" > valid
@@ -72,15 +76,20 b' some write back to the file.'
72
76
73 $ hg fix -w
77 $ hg fix -w
74 ignored invalid output from fixer tool: invalid
78 ignored invalid output from fixer tool: invalid
79 fixed metadatafalse in revision 2147483647 using metadatafalse
75 ignored invalid output from fixer tool: missing
80 ignored invalid output from fixer tool: missing
76 fixed valid in revision 2147483647 using valid
81 fixed valid in revision 2147483647 using valid
77 saw "key" 1 times
82 saw "key" 1 times
78 fixed 1 files with valid
83 fixed 1 files with valid
79 fixed the working copy
84 fixed the working copy
80
85
81 $ cat missing invalid valid
86 $ cat metadatafalse
87 new content
88 $ cat missing
82 old content
89 old content
90 $ cat invalid
83 old content
91 old content
92 $ cat valid
84 new content
93 new content
85
94
86 $ cd ..
95 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now