Tue, 21 Mar 2017 22:39:52 -0700 bugzilla: use util.urlreq.urlparse
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 21 Mar 2017 22:39:52 -0700] rev 31570
bugzilla: use util.urlreq.urlparse And stop saving a module variable because it shouldn't be necessary.
Tue, 21 Mar 2017 22:34:17 -0700 pycompat: define urlreq.urlparse and urlreq.unparse aliases
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 21 Mar 2017 22:34:17 -0700] rev 31569
pycompat: define urlreq.urlparse and urlreq.unparse aliases Currently, we export urlparse via util.urlparse then call util.urlparse.urlparse() and util.urlparse.urlunparse() in a few places. This is the only url* module exported from pycompat, making it a one-off. So let's transition to urlreq to match everything else. Yes, we double import "urlparse" now on Python 2. This will be cleaned up in a subsequent patch. Also, the Python 3 functions trade in str/unicode not bytes. So we'll likely need to write a custom implementation that speaks bytes. But moving everyone to an abstracted API is a good first step.
Tue, 21 Mar 2017 22:28:16 -0700 pycompat: remove urlunquote alias
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 21 Mar 2017 22:28:16 -0700] rev 31568
pycompat: remove urlunquote alias It is duplicated by urlreq.unquote and is unused. Kill it. We retain the imports because it is re-exported via util.urlparse, which is used elsewhere. Since we no longer access attributes of urlparse at module load time, this change /should/ result in that module reverting to a lazy module.
Tue, 21 Mar 2017 22:23:11 -0700 util: use urlreq.unquote
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 21 Mar 2017 22:23:11 -0700] rev 31567
util: use urlreq.unquote pycompat.urlreq.unquote and pycompat.urlunquote effectively alias the same thing. pycompat.urlunquote is only used once in the code base. So let's switch to urlreq.unquote. "Effectively" in the above paragraph is because pycompat.urlreq.unquote aliases urllib.unquote and pycompat.urlunquote aliases urlparse.unquote on Python 2. You might think one of urllib.unquote and urlparse.unquote is an alias to the other, but you would be incorrect. In fact, these functions are copies of each other. There is even a comment in the CPython source code saying to keep them in sync. You can't make this up.
Tue, 21 Mar 2017 22:20:11 -0700 pycompat: alias urlreq.unquote to unquote_to_bytes
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 21 Mar 2017 22:20:11 -0700] rev 31566
pycompat: alias urlreq.unquote to unquote_to_bytes Previously, urlreq.unquote aliased to urllib.parse.unquote, which returned a str/unicode. We like bytes, so switch urlreq.unquote to dispatch to urllib.parse.unquote_to_bytes. This required a minor helper function to register an alias under a different name from which it points. If this turns into a common pattern, we could likely teach _registeralias to accept tuple values defining the mapping. Until then, I didn't feel like adding complexity to _registeralias.
Sun, 19 Mar 2017 01:03:53 -0400 revsetlang: portably turn int into bytestring
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:03:53 -0400] rev 31565
revsetlang: portably turn int into bytestring
Mon, 20 Mar 2017 16:34:12 -0700 osutil: export a "getfstype" method
Jun Wu <quark@fb.com> [Mon, 20 Mar 2017 16:34:12 -0700] rev 31564
osutil: export a "getfstype" method This patch exports the "getfstype" method. So we can use it to enable hardlinks for known safe filesystems. The patch was tested manually via debugshell on a Linux system. "mercurial.osutil.getfstype" works as expected. It's hard to mount filesystem on user-space easily. I will add a test for real hardlink support to indirectly test this patch, after turning on real hardlinks support for certain whitelisted filesystems.
Mon, 20 Mar 2017 16:24:59 -0700 osutil: add a C function getting filesystem type
Jun Wu <quark@fb.com> [Mon, 20 Mar 2017 16:24:59 -0700] rev 31563
osutil: add a C function getting filesystem type Currently it only has Linux filesystems, according to my Linux manpage, built at 2016-03-15. The code uses "if" instead of "switch" because there could be some duplicated values.
Mon, 20 Mar 2017 15:43:27 -0700 setup: test some header files
Jun Wu <quark@fb.com> [Mon, 20 Mar 2017 15:43:27 -0700] rev 31562
setup: test some header files The next patch will use "statfs", which requires different header files on different platforms. Linux: sys/vfs.h or sys/statfs.h FreeBSD or OSX: sys/param.h and sys/mount.h Therefore test them so we can include the correct ones.
Mon, 20 Mar 2017 15:11:18 -0700 setup: detect statfs
Jun Wu <quark@fb.com> [Mon, 20 Mar 2017 15:11:18 -0700] rev 31561
setup: detect statfs statfs is not defined by POSIX but is available in various systems to help decide filesystem type. Let's detect it and set the macro HAVE_STATFS.
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip