bookmarks: refactor code responsible for updates of bookmarks
introduce _bookmarksupdate for common parts from commitctx and addchangegroup
hook: fix bug (reuse of variable) introduced in
872d49dd577a
For binary installs, the 'name' argument would be reused as a local variable,
destroying its original value. The patch fixes that, and also avoids copying
sys.path when it's not necessary.
patch: implement patch.eol=auto mode
EOLs in patched files are restored to their original value after
patching. We use the first EOL found in the file, files with
inconsistent EOLs will thus be normalized during this process.
patch: propagate eolmode down to patchfile
The old code mapped the value of eolmode ('strict', 'crlf' or 'lf') to
eol (None, '\r\n' or '\n') at the entry point in internalpatch. The
value of eol was then used directly as the desired EOL in patchfile.
We now delay the mapping and let patchfile do it instead. This allows
for more complicated behavior where it does not make sense to map
eolmode directly to the target EOLs.