Page MenuHomePhabricator

Recent Activity

Today

mharbison72 added a comment to D8337: pycompat: change argv conversion semantics.

This looks like it also fixes the phabricator test on Windows, which diverged by creating a different hash for the create alpha for phabricator test € commit.

Mon, Mar 30, 1:09 AM
mharbison72 added a comment to D8345: tests: look for CRLF on Windows.

The test harness *should* match existing \n output as a fallback, which got me to wondering if it was the (esc) at the end screwing it up. I tried this patch:

Mon, Mar 30, 12:51 AM

Yesterday

indygreg added a comment to D8340: dispatch: force \n for newlines on sys.std* streams (BC).

This is a dupe of D8339.

Sun, Mar 29, 9:32 PM
indygreg created D8344: extensions: refactor function for obtaining disabled extension help.
Sun, Mar 29, 9:30 PM
indygreg created D8348: tests: force newlines to LF in inline Python script.
Sun, Mar 29, 9:30 PM
indygreg created D8345: tests: look for CRLF on Windows.
Sun, Mar 29, 9:30 PM
indygreg created D8347: encoding: use special dictionary type for env variables on Windows.
Sun, Mar 29, 9:30 PM
indygreg created D8346: tests: force newlines to LF in tinyproxy.py.
Sun, Mar 29, 9:30 PM
indygreg created D8342: tests: prevent printing \r to stdout.
Sun, Mar 29, 9:30 PM
indygreg created D8343: tests: perform grep manually in test-doctest.py.
Sun, Mar 29, 9:30 PM
indygreg created D8340: dispatch: force \n for newlines on sys.std* streams (BC).
Sun, Mar 29, 9:30 PM
indygreg created D8341: tests: force \n newlines when writing to sys.stdout.
Sun, Mar 29, 9:30 PM
indygreg added a comment to D8339: dispatch: force \n for newlines on sys.std* streams (BC).

As scary as this patch sounds, I'm pretty sure it is safe, as I believe it restores compatibility with Python 2. Changing sys.std* to be binary streams instead of text streams would be a bigger BC break. And that is not a change I want to make, as this would invalidate assumptions in 3rd party code about the behavior of these streams on Python 3!

Sun, Mar 29, 4:35 PM
indygreg added a comment to D8338: hook: move stdio redirection to context manager.

This commit isn't strictly required. I performed this refactoring anticipating needing to add sys.std* fixups as part of this function. But it turns out that the SSH protocol server handles I/O redirection via a different mechanism. There actually appear to be redundant mechanisms for intercepting stdio as part of the wire protocol. This is potentially an area that we could clean up. But I'm not inclined to do so at this time.

Sun, Mar 29, 4:33 PM
indygreg created D8339: dispatch: force \n for newlines on sys.std* streams (BC).
Sun, Mar 29, 4:31 PM
indygreg created D8338: hook: move stdio redirection to context manager.
Sun, Mar 29, 4:31 PM
marmoute accepted D8172: notify: optional mail threading based on obsmarker.
Sun, Mar 29, 1:33 PM
yuja added a comment to D8337: pycompat: change argv conversion semantics.
  • # Since Python 3 converts argv to wchar_t type by Py_DecodeLocale() on Unix,
  • # we can use os.fsencode() to get back bytes argv.
  • #
  • # https://hg.python.org/cpython/file/v3.5.1/Programs/python.c#l55
  • #
  • # On Windows, the native argv is unicode and is converted to MBCS bytes
  • # since we do enable the legacy filesystem encoding. if getattr(sys, 'argv', None) is not None:
  • sysargv = list(map(os.fsencode, sys.argv))

+ # On POSIX, the char argv array is converted to Python str using
+ # Py_DecodeLocale(). The inverse of this is Py_EncodeLocale(), which isn't
+ # directly callable from Python code. So, we need to emulate it.
+ # Py_DecodeLocale() calls mbstowcs() and falls back to mbrtowc() with
+ # surrogateescape error handling on failure. These functions take the
+ # current system locale into account. So, the inverse operation is to
+ # .encode() using the system locale's encoding and using the
+ # surrogateescape error handler. The only tricky part here is getting
+ # the system encoding correct, since locale.getlocale() can return
+ # None. We fall back to the filesystem encoding if lookups via locale
+ # fail, as this seems like a reasonable thing to do.
+ #
+ # On Windows, the wchar_t
argv is passed into the interpreter as-is.
+ # Like POSIX, we need to emulate what Py_EncodeLocale() would do. But
+ # there's an additional wrinkle. What we really want to access is the
+ # ANSI codepage representation of the arguments, as this is what
+ # int main() would receive if Python 3 didn't define int wmain()
+ # (this is how Python 2 worked). To get that, we encode with the mbcs
+ # encoding, which will pass CP_ACP to the underlying Windows API to
+ # produce bytes.
+ if os.name == r'nt':
+ sysargv = [a.encode("mbcs", "ignore") for a in sys.argv]

Sun, Mar 29, 6:52 AM
mharbison72 updated the diff for D8314: phabricator: add an option to fold several commits into one review (issue6244).
Sun, Mar 29, 12:58 AM
mharbison72 updated the diff for D8313: phabricator: extract logic to print the status when posting a commit.
Sun, Mar 29, 12:57 AM
mharbison72 updated the diff for D8311: phabricator: teach `getoldnodedrevmap()` to handle folded reviews.
Sun, Mar 29, 12:57 AM
mharbison72 updated the diff for D8312: phabricator: extract the logic to amend diff properties to a function.
Sun, Mar 29, 12:57 AM
mharbison72 updated the diff for D8310: phabricator: teach createdifferentialrevision() to allow a folded commit range.
Sun, Mar 29, 12:57 AM
mharbison72 updated the diff for D8309: phabricator: combine commit messages into the review when folding commits.
Sun, Mar 29, 12:57 AM
mharbison72 updated the diff for D8308: phabricator: record all local commits used to create a Differential revision.
Sun, Mar 29, 12:57 AM
mharbison72 added a comment to D8311: phabricator: teach `getoldnodedrevmap()` to handle folded reviews.

Could you add a comment about what happens if you hg split either the base or the tip of the range?

I think what happens is each newnode key maps to a single precursor, so it's like a regular amend case. It just happens that multiple newnode keys have the same oldnode in their value tuple. But all we care about is the first and last newnode in the range.
That said, I tried creating a simple test where I amended in a new file to the last commit of the last test, split it with the internal extension, and... Somehow I ended up with a weird state where the first half of the split is pruned...

Sun, Mar 29, 12:53 AM

Sat, Mar 28

indygreg updated subscribers of D8337: pycompat: change argv conversion semantics.

@yuja I'd appreciate your eyes on this since you have a firm grasp on Windows/Unicode matters...

Sat, Mar 28, 9:42 PM
indygreg created D8336: tests: use `f --hexdump` to print file content.
Sat, Mar 28, 9:41 PM
indygreg created D8337: pycompat: change argv conversion semantics.
Sat, Mar 28, 9:41 PM
indygreg created D8335: url: pass str to pathname2url.
Sat, Mar 28, 9:40 PM
indygreg created D8334: tests: pass str to matchoutput().
Sat, Mar 28, 9:40 PM

Fri, Mar 27

jeffpc committed rHG11f284c8c5e4: pathutil: document that dirs map type implies manifest/dirstate processing.
pathutil: document that dirs map type implies manifest/dirstate processing
Fri, Mar 27, 1:02 PM
jeffpc committed rHGe9e7156a8d6c: git: pass a list to pathutil.dirs to indicate that it is a manifest.
git: pass a list to pathutil.dirs to indicate that it is a manifest
Fri, Mar 27, 1:02 PM
jeffpc committed rHG7cab8dbd0497: git: implement basic bookmark activation.
git: implement basic bookmark activation
Fri, Mar 27, 12:57 PM
jeffpc committed rHGbb3e05ca21ca: git: implement a basic checkconflict bookmark store method.
git: implement a basic checkconflict bookmark store method
Fri, Mar 27, 12:57 PM
jeffpc committed rHG7bbb83e4e8de: git: abort when attempting to set a branch.
git: abort when attempting to set a branch
Fri, Mar 27, 12:57 PM
jeffpc committed rHGc5653cf2811d: git: remove obsolete todo item.
git: remove obsolete todo item
Fri, Mar 27, 12:56 PM
joerg.sonnenberger updated the diff for D8172: notify: optional mail threading based on obsmarker.
Fri, Mar 27, 10:12 AM
marmoute added a comment to D8172: notify: optional mail threading based on obsmarker.

Looks good to me, thanks for the update. Sorry for the delay, it totally fell into the cracks.

Fri, Mar 27, 10:09 AM

Thu, Mar 26

durin42 created D8333: tests: handle new error string from FreeBSD for dns entry not resolving.
Thu, Mar 26, 11:13 AM