help: update the color documentation for Windows 10 ANSI support
It looks like only the initial release of Windows 10 lacked support for this
functionality. [1][2] Since that build is no longer supported, I didn't bother
getting very specific, to keep the help text less cluttered.
[1] https://github.com/symfony/symfony/issues/17499#issuecomment-
243481052
[2] https://en.wikipedia.org/wiki/Windows_10_version_history
color: enable ANSI support on Windows 10
This will display color if "color.mode=ansi", and default to 'ansi' if the mode
is set to 'auto'. The 'debugcolor' command also reflects this policy.
Previously, "color.mode=ansi" on Windows printed jibberish around the normal
text. Using ANSI color is better, as it avoids the normal loss of color when
the default pager is enabled on Windows. See also
issue5570.
When the underlying function fails (e.g. when run on older Windows), 'auto'
still falls back to 'win32'. Apparently, Microsoft originally had this feature
turned on by default, and then made it opt-in[1]. Therefore, not enabling it
unconditionally seems safer. Instead, only do it after processing the existing
check for support in a Unix-like environment.
[1] https://github.com/symfony/symfony/issues/17499#issuecomment-
243481052
win32: add a method to enable ANSI color code processing on Windows 10
SetConsoleMode() fails with an invalid parameter error if given this option
prior to Windows 10, so indicate that to the caller instead of doing explicit
version checks.
export: map wctx.node() to 'ff...' node id (
issue5438)
revset: add support for integer and hex wdir identifiers
As I said before, partial 'ff...' hash isn't supported yet.
localrepo: map integer and hex wdir identifiers to workingctx
changectx.__init__() is slightly modified to take str(wdirrev) as a valid
integer revision (and raise WdirUnsupported exception.)
Test will be added by the next patch.
revlog: map rev(wdirid) to WdirUnsupported exception
This will allow us to map repo["ff..."] to workingctx. _partialmatch() will
be updated later. I tried "return wdirrev" in place of raising the exception,
but earlier exception seemed better.
scmutil: introduce binnode(ctx) as paired function with intrev(ctx)
It seemed silly to convert ctx.hex() back to binary to use node.hex/short(),
or to use [:12] instead of node.short() because ctx.node() could be None.
Eventually I want to change wctx.rev() and wctx.node() to return wdirrev and
wdirid respectively, but that's quite big API breakage and can't be achieved
without some compatibility wrappers.
merge: use scmutil.intrev() to sort ctx objects
This moves wctx to the last, but that shouldn't matter. Only the order of
stored revisions is important.
scmutil: pass ctx object to intrev()
This makes it slightly easier to sort basectx objects by key=scmutil.intrev.
We're most likely to have ctx objects where changectx/workingctx abstraction
is necessary, so this won't increase the abstraction overhead.
setup: do not overwrite local __modulepolicy__.py on out-of-source build
Since the default policy is selected depending on setup options, "make install"
shouldn't overwrite in-source __modulepolicy__.py generated by "make local".