comparison mercurial/archival.py @ 31099:b44ab288358e

subrepo: run the repo decoders when archiving The decoders were already run by default for the main repo, so this seemed like an oversight. The extdiff extension has been using 'archive' since 68822b7cdd01 to support -S, and a colleague noticed that after diffing, making changes, and closing it, the line endings were wrong for the diff-tool modified files in the subrepository. (Files in the parent repo were correct, with the same .hgeol settings.) The editor (Visual Studio in this case) reloads the file, but doesn't notice the EOL change. It still adds new lines with the original EOL setting, and the file ends up inconsistent. Without this change, the first file `cat`d in the test prints '\r (esc)' EOL, but the second doesn't on Windows or Linux.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 25 Feb 2017 21:13:59 -0500
parents 798bcb1274dd
children 21fa3d3688f3
comparison
equal deleted inserted replaced
31098:876f08f30ade 31099:b44ab288358e
329 329
330 if subrepos: 330 if subrepos:
331 for subpath in sorted(ctx.substate): 331 for subpath in sorted(ctx.substate):
332 sub = ctx.workingsub(subpath) 332 sub = ctx.workingsub(subpath)
333 submatch = matchmod.subdirmatcher(subpath, matchfn) 333 submatch = matchmod.subdirmatcher(subpath, matchfn)
334 total += sub.archive(archiver, prefix, submatch) 334 total += sub.archive(archiver, prefix, submatch, decode)
335 335
336 if total == 0: 336 if total == 0:
337 raise error.Abort(_('no files match the archive pattern')) 337 raise error.Abort(_('no files match the archive pattern'))
338 338
339 archiver.done() 339 archiver.done()