##// END OF EJS Templates
match: make 'listfile:' split on LF and CRLF...
Patrick Mezard -
r14248:25c68ac2 default
parent child Browse files
Show More
@@ -273,9 +273,12 b' def _normalize(names, default, root, cwd'
273 elif kind in ('relglob', 'path'):
273 elif kind in ('relglob', 'path'):
274 name = util.normpath(name)
274 name = util.normpath(name)
275 elif kind in ('listfile', 'listfile0'):
275 elif kind in ('listfile', 'listfile0'):
276 delimiter = kind == 'listfile0' and '\0' or '\n'
277 try:
276 try:
278 files = util.readfile(name).split(delimiter)
277 files = util.readfile(name)
278 if kind == 'listfile0':
279 files = files.split('\0')
280 else:
281 files = files.splitlines()
279 files = [f for f in files if f]
282 files = [f for f in files if f]
280 except EnvironmentError:
283 except EnvironmentError:
281 raise util.Abort(_("unable to read file list (%s)") % name)
284 raise util.Abort(_("unable to read file list (%s)") % name)
@@ -295,6 +295,18 b' Test patterns:'
295 $ hg debugwalk ignored/file
295 $ hg debugwalk ignored/file
296 f ignored/file ignored/file exact
296 f ignored/file ignored/file exact
297
297
298 Test listfile and listfile0
299
300 $ python -c "file('../listfile0', 'wb').write('fenugreek\0new\0')"
301 $ hg debugwalk -I 'listfile0:../listfile0'
302 f fenugreek fenugreek
303 f new new
304 $ python -c "file('../listfile', 'wb').write('fenugreek\nnew\r\nmammals/skunk\n')"
305 $ hg debugwalk -I 'listfile:../listfile'
306 f fenugreek fenugreek
307 f mammals/skunk mammals/skunk
308 f new new
309
298 $ cd ..
310 $ cd ..
299 $ hg debugwalk -R t t/mammals/skunk
311 $ hg debugwalk -R t t/mammals/skunk
300 f mammals/skunk t/mammals/skunk exact
312 f mammals/skunk t/mammals/skunk exact
General Comments 0
You need to be logged in to leave comments. Login now