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.
share: use defaultdest to compute unspecified destination
This harmonizes with clone, and avoids creating a .hg in the current directory if
the source ends with a /
glog: fix "incompatible option" error message.
Options like 'only_branch' should be presented to the user as
'--only-branch'.