D5907: copy: respect ui.relative-paths in copy/rename

Yuya Nishihara yuya at tcha.org
Sun Feb 10 21:03:42 EST 2019

>   > It might
>   >  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
>   >  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.
>   Did that commit change any behavior on Windows?

Probably. `pathto(f, cwd='')` would return backslash path on Windows.

> I was trying to figure out where the conversion to Windows paths was done and thought it seemed like it was mostly just done in `util.pathto()`, so e.g. `m.rel()` would use backslashes and `m.abs()` would use slashes. (I just learned that there is a deprecated ui.slash config too, but that doesn't seem to change much.)

Correct. Path handling on Windows seemed inconsistent from the start. Some
commands used to use `dirstate.pathto()` which always returns backslash/slash
paths depending on ui.slash, and the others using `m.rel|abs|uipath()` don't.

Since we have `scmutil.getuipathfn()` now, maybe we can fix the inconsistency?

More information about the Mercurial-devel mailing list