comparison mercurial/commands.py @ 8810:ac92775b3b80

Add patch.eol to ignore EOLs when patching (issue1019) The intent is to fix many issues involving patching when win32ext is enabled. With win32ext, the working directory and repository files EOLs are not the same which means that patches made on a non-win32ext host do not apply cleanly because of EOLs discrepancies. A theorically correct approach would be transform either the patched file or the patch content with the encoding/decoding filters used by win32ext. This solution is tricky to implement and invasive, instead we prefer to address the win32ext case, by offering a way to ignore input EOLs when patching and rewriting them when saving the patched result.
author Patrick Mezard <pmezard@gmail.com>
date Mon, 15 Jun 2009 00:03:26 +0200
parents 14a0bdd59848
children 859f841937d0
comparison
equal deleted inserted replaced
8809:6fce36336e42 8810:ac92775b3b80
1762 repo.dirstate.setbranch(branch or 'default') 1762 repo.dirstate.setbranch(branch or 'default')
1763 1763
1764 files = {} 1764 files = {}
1765 try: 1765 try:
1766 patch.patch(tmpname, ui, strip=strip, cwd=repo.root, 1766 patch.patch(tmpname, ui, strip=strip, cwd=repo.root,
1767 files=files) 1767 files=files, eolmode=None)
1768 finally: 1768 finally:
1769 files = patch.updatedir(ui, repo, files, similarity=sim/100.) 1769 files = patch.updatedir(ui, repo, files, similarity=sim/100.)
1770 if not opts.get('no_commit'): 1770 if not opts.get('no_commit'):
1771 m = cmdutil.matchfiles(repo, files or []) 1771 m = cmdutil.matchfiles(repo, files or [])
1772 n = repo.commit(message, opts.get('user') or user, 1772 n = repo.commit(message, opts.get('user') or user,