Jun Wu <quark@fb.com> [Mon, 02 Jan 2017 14:57:14 +0000] rev 30693
chg: add procutil.h
This patch adds a formal header procutil.h for procutil.c, and changes
Makefile to build procutil.c independently.
Jun Wu <quark@fb.com> [Mon, 02 Jan 2017 14:43:37 +0000] rev 30692
chg: let procutil maintain its own pagerpid
Previously, chg.c maintains the pagerpid. Let's move it to procutil.c.
Note: chg.c still have a pagerpid to decide whether to call attachio or not.
In the future, attachio may be moved from hgc_open to hgc_runcommand, and
hgc_runcommand handles both pager and attachio so we don't need to run
attachio twice. And chg.c will be free of pagerpid.
Jun Wu <quark@fb.com> [Mon, 02 Jan 2017 14:10:32 +0000] rev 30691
chg: decouple hgclient from setuppager
procutil should not depend on hgclient. This patch makes the pager handling
part independent from hgclient.
Jun Wu <quark@fb.com> [Mon, 02 Jan 2017 14:04:35 +0000] rev 30690
chg: decouple hgclient from setupsignalhandler
procutil should not depend on hgclient. This patch makes the signal handling
part independent from hgclient.
Jun Wu <quark@fb.com> [Mon, 02 Jan 2017 14:02:47 +0000] rev 30689
chg: move signal and pager handling to a separate file
In the future hgclient will deal with pager directly inside runcommand, so
related signal handling stuff needs to be decoupled from chg.c.
The signal handling and pager logic are coupled because we need to forward
SIGPIPE when pager exits. So they are moved together, otherwise a global
variable (pagerpid) is inevitable.
This patch moves related functions from chg.c to procutil.c, which was
marked as copied to maintain annotate history.
The move is done without code modification for easy review, therefore
`#include "procutil.c"` was introduced temporarily.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Oct 2015 16:02:45 -0700] rev 30688
keepalive: rewrite readline()
The old method was performing string concatenation, which is slower than
collecting raw chunks in a list and joining at the end.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Oct 2015 15:53:58 -0700] rev 30687
keepalive: remove limit argument from readline()
It is unused and adds complexity.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 07 Oct 2015 15:33:52 -0700] rev 30686
keepalive: don't concatenate strings when reading chunked transfer
Surprisingly, this didn't appear to speed up HTTP-based stream cloning
on my machine. I suspect this has more to do with the fact we're using
small HTTP chunks and string concatenation overhead isn't so bad.
However, the reasons for this change are solid: we know string
concatenation can be a performance sink.
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Dec 2016 12:11:29 -0700] rev 30685
exchange: use rich class for sorting clone bundle entries
Python 3 removed the "cmp" argument from sorted(). Custom sorting in
Python 3 must be implemented with the dunder comparison methods on
types and/or with a "key" function.
This patch converts our custom "cmp" function to a custom type.
The implementation is very similar to functools.cmp_to_key(). However,
cmp_to_key() doesn't exist in Python 2, so we can't use it.
This was the only use of the "cmp" argument to sorted() in the code
base.
Kevin Bullock <kbullock@ringworld.org> [Wed, 04 Jan 2017 10:51:37 -0600] rev 30684
Added signature for changeset
e69874dc1f4e
Kevin Bullock <kbullock@ringworld.org> [Wed, 04 Jan 2017 10:51:31 -0600] rev 30683
Added tag 4.0.2 for changeset
e69874dc1f4e
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 31 Dec 2016 17:19:09 +0900] rev 30682
i18n-ja: synchronized with
5f33116cd787
Jun Wu <quark@fb.com> [Mon, 26 Dec 2016 00:02:42 +0000] rev 30681
chg: respect XDG_RUNTIME_DIR
$XDG_RUNTIME_DIR [1] is a better place for user daemons. Let's use it and
fallback to $TMPDIR.
After this patch, chg will try socket paths in the following order:
1. $CHGSOCKNAME
2. $XDG_RUNTIME_DIR/chg/server
3. ${TMPDIR:-tmp}/chg$UID/server
[1]: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Jun Wu <quark@fb.com> [Sun, 25 Dec 2016 23:49:54 +0000] rev 30680
chg: make "get default sockdir" a separate method
The logic to get a default socket directory will become longer in the next
patch. So let's move it out.
Jun Wu <quark@fb.com> [Sun, 25 Dec 2016 23:32:11 +0000] rev 30679
chg: handle connect failure before errno gets overridden
This patch moves the error handling logic up so that errno after connect
won't be overridden.
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 25 Dec 2016 03:06:55 +0530] rev 30678
py3: have a bytes version of shlex.split()
shlex.split() only accepts unicodes on Python 3. After this patch we will be
using pycompat.shlexsplit(). This patch also replaces existing occurences of
shlex.split with pycompat.shlexsplit.
Jun Wu <quark@fb.com> [Fri, 23 Dec 2016 16:26:40 +0000] rev 30677
chg: support long socket path
This patch replaces UNIX_PATH_MAX (108) with PATH_MAX (4096) so we can have
long unix path.
Jun Wu <quark@fb.com> [Fri, 23 Dec 2016 16:16:44 +0000] rev 30676
chg: remove sockdirfd
See the previous patch for the reason.
Jun Wu <quark@fb.com> [Fri, 23 Dec 2016 16:37:00 +0000] rev 30675
chg: let hgc_open support long path
"sizeof(sun_path)" is too small. Use the chdir trick to support long socket
path, like "mercurial.util.bindunixsocket".
It's useful for cases where TMPDIR is long. Modern OS X rewrites TMPDIR to a
long value. And we probably want to use XDG_RUNTIME_DIR [2] for Linux.
The approach is a bit different from the previous plan, where we will have
hgc_openat and pass cmdserveropts.sockdirfd to it. That's because the
current change is easier: chg has to pass a full path to "hg" as the
"--address" parameter. There is no "--address-basename" or "--address-dirfd"
flags. The next patch will remove "sockdirfd".
Note: It'd be nice if we can use a native "connectat" implementation.
However, that's not available everywhere. Some platform (namely FreeBSD)
does support it, but the implementation has bugs so it cannot be used [2].
[1]: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
[2]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-April/082892.html
Augie Fackler <raf@durin42.com> [Sat, 24 Dec 2016 15:38:27 -0500] rev 30674
rebase: un-wrap function signature since it fits in 80 columns
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 25 Dec 2016 02:42:46 +0530] rev 30673
py3: exclude pywatchman from test-check-py3-compat.t
Exclude pywatchman from py3 test. They have already worked on Python 3
compatibility https://github.com/facebook/watchman/pull/247
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 25 Dec 2016 02:34:19 +0530] rev 30672
py3: update test-check-py3-compat.t
This part of test runs only on py3. This change was introduced by
16f4b341288d.
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 22 Dec 2016 19:35:30 +0530] rev 30671
shelve: choose a legal shelve name when no name is passed (
issue5112)
Currently if our branch name contains '\' or starts with '.', shelve chooses
an illegal shelve name. This behaviour is not good as it itself is choosing
something which it won't accept further. We can raise errors if user passes
a name which is illegal.
After this patch, if '\' is contained in branch name or bookmark name, it will
be replaced by '_' while choosing a shelve name and if they starts with '.',
the first '.' is replaced by '_'.
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 22 Dec 2016 23:27:32 +0530] rev 30670
shelve: add tests to ensure illegal shelve names are avoided
We avoid '.' as the first letter of shelve name so that we don't create hidden
file. We also avoid slashes in name so that we don't form a new directory
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 20 Dec 2016 00:20:07 +0530] rev 30669
py3: replace sys.executable with pycompat.sysexecutable
sys.executable returns unicodes on Python 3. This patch replaces occurences of
sys.executable with pycompat.sysexecutable.
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 20 Dec 2016 00:02:24 +0530] rev 30668
py3: have bytes version of sys.executable
sys.executable on Python 3 returns unicodes and we want bytes. So this patch
adds a new pycompat.sysexecutable which returns bytes by encoding using
os.fsencode() since it is path variable.
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 22 Dec 2016 01:54:17 +0530] rev 30667
py3: use pycompat.getcwd instead of os.getcwd
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 21 Dec 2016 23:40:38 +0530] rev 30666
py3: use python 3 compatible variables in hgext/fsmontor/__init__.py
Earlier this was left thinking that its part of pywatchman package.
This patch replaces variables os.sep, sys.platform and os.envrion with their
py3 compatible ones.
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 21 Dec 2016 22:42:31 +0530] rev 30665
py3: add warnings in check-code related to py3
We have our own bytes versions of things like, getopt.getopt, os.sep, os.name,
sys.executable, os.environ and few more for python 3 portability. Its better
to come up with warnings if someone breaks the things which we have fixed.
After this patch, check-code will warn us to use our bytes version.
These checks run on mercurial/ and hgext/ and pycompat.py is excluded.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 19 Dec 2016 02:54:49 +0530] rev 30664
py3: replace os.getenv with pycompat.osgetenv
os.getenv deals with unicodes on Python 3, so we have pycompat.osgetenv to
deal with bytes. This patch replaces occurrences on os.getenv with
pycompat.osgetenv