Mon, 06 Jul 2020 22:02:50 -0400 merge with stable
Augie Fackler <augie@google.com> [Mon, 06 Jul 2020 22:02:50 -0400] rev 45049
merge with stable
Sun, 05 Jul 2020 13:09:22 +0200 procutil: make mercurial.utils.procutil.stderr unbuffered
Manuel Jacob <me@manueljacob.de> [Sun, 05 Jul 2020 13:09:22 +0200] rev 45048
procutil: make mercurial.utils.procutil.stderr unbuffered For most Mercurial code, it doesn’t make a difference, as the ui object flushes stderr explicitly (after the change, we could get rid of the explicit flush). One example where it makes a observable difference is mercurial.util.timed(). Without the patch, the time is not immediately shown on Python 3. With the patch, it’s shown immediately on all Python versions and platforms.
Sun, 05 Jul 2020 13:05:06 +0200 tests: generalize common test case code in test-stdio.py
Manuel Jacob <me@manueljacob.de> [Sun, 05 Jul 2020 13:05:06 +0200] rev 45047
tests: generalize common test case code in test-stdio.py
Sat, 04 Jul 2020 11:41:39 +0200 procutil: make stdout line-buffered on Windows if connected to TTY
Manuel Jacob <me@manueljacob.de> [Sat, 04 Jul 2020 11:41:39 +0200] rev 45046
procutil: make stdout line-buffered on Windows if connected to TTY Windows doesn’t support line buffering. Previously, we worked around that by setting the stream unbuffered. Instead, we can use our own line buffering we already use on Python 3.
Sat, 04 Jul 2020 11:21:44 +0200 procutil: split import and reassignment
Manuel Jacob <me@manueljacob.de> [Sat, 04 Jul 2020 11:21:44 +0200] rev 45045
procutil: split import and reassignment Besides making the code clearer, it will reduce the diff in the next patch.
Sat, 04 Jul 2020 11:15:58 +0200 procutil: move assignments closer to reassignments
Manuel Jacob <me@manueljacob.de> [Sat, 04 Jul 2020 11:15:58 +0200] rev 45044
procutil: move assignments closer to reassignments Doing reassignments is an anti-pattern IMHO, but I see how it makes sense here. When first looking at this code after jumping here with ctags, I missed the fact that stdout was reassigned. To make the code clearer, the assignments should be as close as possible to the reassignments.
Sat, 04 Jul 2020 12:15:41 +0200 procutil: factor out conditional creation of LineBufferedWrapper
Manuel Jacob <me@manueljacob.de> [Sat, 04 Jul 2020 12:15:41 +0200] rev 45043
procutil: factor out conditional creation of LineBufferedWrapper At the same time, document the logic and generalize it to work on all Python versions.
Thu, 02 Jul 2020 04:37:18 +0200 procutil: define LineBufferedWrapper on all Python versions
Manuel Jacob <me@manueljacob.de> [Thu, 02 Jul 2020 04:37:18 +0200] rev 45042
procutil: define LineBufferedWrapper on all Python versions There’s nothing Python 3-only about LineBufferedWrapper. In the future, we may want to use it on Windows, to work around missing line-buffering support.
Sat, 04 Jul 2020 10:47:04 +0200 tests: add tests for buffering behavior of mercurial.utils.procutil.stdout
Manuel Jacob <me@manueljacob.de> [Sat, 04 Jul 2020 10:47:04 +0200] rev 45041
tests: add tests for buffering behavior of mercurial.utils.procutil.stdout
Thu, 02 Jul 2020 02:51:09 +0200 cleanup: use slightly more meaningful name for temporary variable
Manuel Jacob <me@manueljacob.de> [Thu, 02 Jul 2020 02:51:09 +0200] rev 45040
cleanup: use slightly more meaningful name for temporary variable Not that it makes a big difference, but using `p` instead of `x` is clearer to me.
Thu, 02 Jul 2020 02:46:15 +0200 cleanup: use any() instead of checking truthiness of temporary list
Manuel Jacob <me@manueljacob.de> [Thu, 02 Jul 2020 02:46:15 +0200] rev 45039
cleanup: use any() instead of checking truthiness of temporary list It was not immediately obvious to me, when first seeing this, why a list was created. It needed a second look to understand that the purpose was to check whether the condition is true for any of the parents. Using any() for that is clearer.
Fri, 03 Jul 2020 13:45:59 +0530 chg: suppress OSError in _restoreio() and add some logging (issue6330)
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 03 Jul 2020 13:45:59 +0530] rev 45038
chg: suppress OSError in _restoreio() and add some logging (issue6330) According to issue6330, running chg on heavy loaded systems can lead to following error: ``` Traceback (most recent call last): File "path-to-hg/mercurial/commandserver.py", line 650, in _acceptnewconnection self._runworker(conn) File "path-to-hg/mercurial/commandserver.py", line 701, in _runworker prereposetups=[self._reposetup], File "path-to-hg/mercurial/commandserver.py", line 470, in _serverequest sv.cleanup() File "path-to-hg/mercurial/chgserver.py", line 381, in cleanup self._restoreio() File "path-to-hg/mercurial/chgserver.py", line 444, in _restoreio os.dup2(fd, fp.fileno()) OSError: [Errno 16] Device or resource busy ``` [man dup2] indicates that, on Linux, EBUSY comes from a race condition between open() and dup2(). However it's not clear why open() race occurred for newfd=stdin/out/err. We suppress the OSError in _restoreio() since the forked worker process will finish anyway and add some logging. Thanks to Mitchell Plamann for a detailed bug description and Yuya Nishihara for suggesting the fix.
Thu, 02 Jul 2020 19:54:44 +0200 ui: fix Python 2.7 support for ui.timestamp-output
Joerg Sonnenberger <joerg@bec.de> [Thu, 02 Jul 2020 19:54:44 +0200] rev 45037
ui: fix Python 2.7 support for ui.timestamp-output Differential Revision: https://phab.mercurial-scm.org/D8675
Wed, 01 Jul 2020 14:28:12 -0400 merge with stable
Augie Fackler <augie@google.com> [Wed, 01 Jul 2020 14:28:12 -0400] rev 45036
merge with stable
Thu, 18 Jun 2020 15:13:38 +0200 ui: add option to timestamp status and diagnostic messages
Joerg Sonnenberger <joerg@bec.de> [Thu, 18 Jun 2020 15:13:38 +0200] rev 45035
ui: add option to timestamp status and diagnostic messages Differential Revision: https://phab.mercurial-scm.org/D8640
Mon, 29 Jun 2020 20:53:32 +0900 merge with stable
Yuya Nishihara <yuya@tcha.org> [Mon, 29 Jun 2020 20:53:32 +0900] rev 45034
merge with stable
Sun, 28 Jun 2020 17:52:29 +0200 compat: back out a25343d16ebe (initialize LC_CTYPE locale on all Python ...)
Manuel Jacob <me@manueljacob.de> [Sun, 28 Jun 2020 17:52:29 +0200] rev 45033
compat: back out a25343d16ebe (initialize LC_CTYPE locale on all Python ...) As Yuya Nishihara pointed out, setting LC_CTYPE changes the behavior of some str methods on Python 2.
Sun, 28 Jun 2020 17:49:14 +0200 curses: back out d2227d4c9e6b (do not initialize LC_ALL to user settings)
Manuel Jacob <me@manueljacob.de> [Sun, 28 Jun 2020 17:49:14 +0200] rev 45032
curses: back out d2227d4c9e6b (do not initialize LC_ALL to user settings) The changeset was based on a25343d16ebe, which will be backed out, too. Another fix for the problem will be resubmitted to the stable branch.
Thu, 25 Jun 2020 11:22:34 +0200 test: redirect stderr so warning messages don't change output (issue6237)
Julien Cristau <jcristau@debian.org> [Thu, 25 Jun 2020 11:22:34 +0200] rev 45031
test: redirect stderr so warning messages don't change output (issue6237) clone and commit race for the lock, and if commit has to wait more than a second it prints a warning to stderr. Since this is somewhat expected here, silence it. Differential Revision: https://phab.mercurial-scm.org/D8664
Thu, 25 Jun 2020 12:02:34 -0700 locks: expect repo lock, not wlock, when writing to .hg/strip-backup/
Martin von Zweigbergk <martinvonz@google.com> [Thu, 25 Jun 2020 12:02:34 -0700] rev 45030
locks: expect repo lock, not wlock, when writing to .hg/strip-backup/ There should be no need for a working copy lock when creating (or reading) bundles in `.hg/strip-backup/` since they don't affect the working copy. I noticed this because we have an extension that tries to strip some revisions while holding only a repo lock. I guess we have no such cases in core, which seems a bit surprising. Maybe we always take a wlock at a higher level so the working copy is not updated while the target commit is being stripped. Differential Revision: https://phab.mercurial-scm.org/D8666
Thu, 25 Jun 2020 13:37:56 -0700 graft: leverage cmdutil.check_incompatible_arguments() for --abort/--stop
Martin von Zweigbergk <martinvonz@google.com> [Thu, 25 Jun 2020 13:37:56 -0700] rev 45029
graft: leverage cmdutil.check_incompatible_arguments() for --abort/--stop Differential Revision: https://phab.mercurial-scm.org/D8669
Thu, 25 Jun 2020 13:29:05 -0700 graft: leverage cmdutil.check_incompatible_arguments() for --no-commit
Martin von Zweigbergk <martinvonz@google.com> [Thu, 25 Jun 2020 13:29:05 -0700] rev 45028
graft: leverage cmdutil.check_incompatible_arguments() for --no-commit Differential Revision: https://phab.mercurial-scm.org/D8668
Thu, 25 Jun 2020 13:27:37 -0700 graft: leverage cmdutil.check_at_most_one_arg() for --abort/--stop/--continue
Martin von Zweigbergk <martinvonz@google.com> [Thu, 25 Jun 2020 13:27:37 -0700] rev 45027
graft: leverage cmdutil.check_at_most_one_arg() for --abort/--stop/--continue Differential Revision: https://phab.mercurial-scm.org/D8667
Sat, 27 Jun 2020 21:45:20 -0400 version: sort extensions by name in verbose mode
Matt Harbison <matt_harbison@yahoo.com> [Sat, 27 Jun 2020 21:45:20 -0400] rev 45026
version: sort extensions by name in verbose mode External extensions can be assigned any name, but presumably most enabled extensions will be internal ones and having them sorted makes it easier to find specific ones if the list is long. The lists in `hg help extensions` are already sorted. Differential Revision: https://phab.mercurial-scm.org/D8671
Sat, 27 Jun 2020 20:19:41 +0200 crecord: stop trying to import wcurses
Manuel Jacob <me@manueljacob.de> [Sat, 27 Jun 2020 20:19:41 +0200] rev 45025
crecord: stop trying to import wcurses The original import of crecord in 2008 already said "I have no idea if wcurses works with crecord...". The last reference to a Python package called wcurses is https://web.archive.org/web/20101025073658/http://adamv.com/dev/python/curses/. However, the Python package from there is called "curses" and not "wcurses". I didn’t find any evidence that it ever worked.
Thu, 18 Jun 2020 10:48:27 -0700 debian: support building a single deb for multiple py3 versions
Kyle Lippincott <spectral@google.com> [Thu, 18 Jun 2020 10:48:27 -0700] rev 45024
debian: support building a single deb for multiple py3 versions Around transitions from one python minor version to another (such as 3.7 to 3.8), the current packaging can be slightly problematic - it produces a `control` file that requires that the version of `python3` that's installed be exactly the one that was used on the build machine for the `mercurial` package, by containing a line like: Depends: sensible-utils, libc6 (>= 2.14), python3 (<< 3.8), python3 (>= 3.7~), python3:any (>= 3.5~) This is because it "knows" we only built for v3.7, which is the current default on my system. By building the native components for multiple versions, we can make it produce a line like this, which is compatible with 3.7 AND 3.8: Depends: sensible-utils, libc6 (>= 2.14), python3 (<< 3.9), python3 (>= 3.7~), python3:any (>= 3.5~) This isn't *normally* required, so I'm not making it the default. For those that receive their python3 and mercurial packages from their distro, and/or don't have to worry about a situation where the team that manages the python3 installation isn't the same as the team that manages the mercurial installation, this is probably not necessary. I chose the names `DEB_HG_*` because `DEB_*` is passed through `debuild` automatically (otherwise we'd have to explicitly allow the options through, which is a nuisance), and the `HG` part is to make it clear that this isn't a "standard" debian option that other packages might respect. Test Plan: 1. "nothing changed": - built a deb without these changes - built a deb with these changes but everything at the default - used diffoscope to compare, all differences were due to timestamps 2. "explicit is the same as implicit" (single version) - built a deb with everything at the default - built a deb with DEB_HG_PYTHON_VERSIONS=3.7 - used diffoscope to compare, all differences were due to timestamps 3. "explicit is the same as implicit" (multi version) - built a deb with DEB_HG_MULTI_VERSION=1 - built a deb with DEB_HG_PYTHON_VERSIONS=3.7 - used diffoscope to compare, all differences were due to timestamps 4. (single version, 3.7) doesn't work with python3.8 - `/usr/bin/python3.7 /usr/bin/hg debuginstall` works - `/usr/bin/python3.8 /usr/bin/hg debuginstall` crashes 5. (multi version, 3.7 + 3.8) - `/usr/bin/python3.7 /usr/bin/hg debuginstall` works - `/usr/bin/python3.8 /usr/bin/hg debuginstall` works Differential Revision: https://phab.mercurial-scm.org/D8642
Fri, 26 Jun 2020 11:20:58 -0400 merge with stable
Augie Fackler <augie@google.com> [Fri, 26 Jun 2020 11:20:58 -0400] rev 45023
merge with stable
Fri, 26 Jun 2020 09:37:34 +0200 curses: do not initialize LC_ALL to user settings (issue6358)
Manuel Jacob <me@manueljacob.de> [Fri, 26 Jun 2020 09:37:34 +0200] rev 45022
curses: do not initialize LC_ALL to user settings (issue6358) 701341f57ceb moved the setlocale() call to right before curses was used. This didn’t fully solve the problem it was supposed to solve (locale-dependent functions, like date formatting/parsing), but only postponed it. Initializing LC_CTYPE seems to be sufficient for curses to work correctly. Luckily this is already done at interpreter startup on modern Python versions and, since recently, by Mercurial in the pycompat module in all other cases.
Fri, 26 Jun 2020 04:07:50 +0200 compat: initialize LC_CTYPE locale on all Python versions and platforms
Manuel Jacob <me@manueljacob.de> [Fri, 26 Jun 2020 04:07:50 +0200] rev 45021
compat: initialize LC_CTYPE locale on all Python versions and platforms Previously, the LC_CTYPE locale was not initialized according to user settings on all Python versions (e.g. never on Python 2) and platforms (e.g. not on some Python < 3.8 on Windows). This broke e.g. non-ASCII filenames passed to the Subversion bindings on Python 2, resulting in error messages like "file:///tmp/a%C3%A4 does not look like a Subversion repository to libsvn version 1.14.0". The following command could be used to test this functionality. Adding it to the test suite would be pointless, as the locale is always set to "C" during test runs. @command(b'check_initial_codeset', norepo=True) def check_initial_codeset(ui): codeset1 = locale.nl_langinfo(locale.CODESET) locale.setlocale(locale.LC_ALL, '') codeset2 = locale.nl_langinfo(locale.CODESET) assert codeset1 == codeset2
Thu, 25 Jun 2020 10:32:51 -0700 merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Thu, 25 Jun 2020 10:32:51 -0700] rev 45020
merge with stable
Wed, 24 Jun 2020 23:17:56 -0700 merge: don't grab wlock when merging in memory
Martin von Zweigbergk <martinvonz@google.com> [Wed, 24 Jun 2020 23:17:56 -0700] rev 45019
merge: don't grab wlock when merging in memory I noticed this because we have an internal extension that does an in-memory rebase while holding only a repo lock, which resulted in a developer warning about the working copy lock being taken after the repo lock. Differential Revision: https://phab.mercurial-scm.org/D8665
Wed, 24 Jun 2020 14:44:21 +0200 pycompat: use os.fsencode() to re-encode sys.argv
Manuel Jacob <me@manueljacob.de> [Wed, 24 Jun 2020 14:44:21 +0200] rev 45018
pycompat: use os.fsencode() to re-encode sys.argv Historically, the previous code made sense, as Py_EncodeLocale() and fs.fsencode() could possibly use different encodings. However, this is not the case anymore for Python 3.2, which uses the locale encoding as the filesystem encoding (this is not true for later Python versions, but see below). See https://vstinner.github.io/painful-history-python-filesystem-encoding.html for a source and more background information. Using os.fsencode() is safer, as the documentation for sys.argv says that it can be used to get the original bytes. When doing further changes, the Python developers will take care that this continues to work. One concrete case where os.fsencode() is more correct is when enabling Python's UTF-8 mode. Py_DecodeLocale() will use UTF-8 in this case. Our previous code would have encoded it using the locale encoding (which might be different), whereas os.fsencode() will encode it with UTF-8. Since we don’t claim to support the UTF-8 mode, this is not really a bug and the patch can go to the default branch. It might be a good idea to not commit this to the stable branch, as it could in theory introduce regressions.
Thu, 25 Jun 2020 22:40:04 +0900 merge with stable
Yuya Nishihara <yuya@tcha.org> [Thu, 25 Jun 2020 22:40:04 +0900] rev 45017
merge with stable
Fri, 05 Jun 2020 01:54:13 +0200 perf: make `hg perfwrite` more flexible
Manuel Jacob <me@manueljacob.de> [Fri, 05 Jun 2020 01:54:13 +0200] rev 45016
perf: make `hg perfwrite` more flexible The more flexible command was used recently while finding a solution for a buffering bug (eventually fixed in f9734b2d59cc (the changeset description uses a different benchmark)). In comparison to the previous version, the new version is much more flexible. While using it, the focus was on testing small writes. For this reason, by default it calls ui.write() 100 times with a single byte plus one newline byte, for 100 lines. To get the previous behavior, run `hg perfwrite --nlines=100000 --nitems=1 --item='Testing write performance' --batch-line`.
Tue, 23 Jun 2020 04:55:27 +0200 chg: fix typo
Manuel Jacob <me@manueljacob.de> [Tue, 23 Jun 2020 04:55:27 +0200] rev 45015
chg: fix typo
Fri, 19 Jun 2020 09:27:02 -0700 copies: implement __repr__ on branch_copies for debugging
Martin von Zweigbergk <martinvonz@google.com> [Fri, 19 Jun 2020 09:27:02 -0700] rev 45014
copies: implement __repr__ on branch_copies for debugging Differential Revision: https://phab.mercurial-scm.org/D8650
Sat, 20 Jun 2020 11:10:23 +0900 phases: remove useless lookup of repo[rev].rev() in _retractboundary
Yuya Nishihara <yuya@tcha.org> [Sat, 20 Jun 2020 11:10:23 +0900] rev 45013
phases: remove useless lookup of repo[rev].rev() in _retractboundary changectx object is no longer needed thanks to a54ee130210a.
Thu, 04 Jun 2020 06:44:00 +0200 ui: replace `self._ferr` with identical `dest`
Manuel Jacob <me@manueljacob.de> [Thu, 04 Jun 2020 06:44:00 +0200] rev 45012
ui: replace `self._ferr` with identical `dest` Originally, it was part of a larger change that was abandoned. IMHO it makes the code slightly cleaner and saves one attribute access, so I decided to send it anyway instead of throwing it away.
Sat, 20 Jun 2020 11:51:34 +0530 absorb: make it clear what happens when no input
Sushil khanchi <sushilkhanchi97@gmail.com> [Sat, 20 Jun 2020 11:51:34 +0530] rev 45011
absorb: make it clear what happens when no input Differential Revision: https://phab.mercurial-scm.org/D8643
Wed, 17 Jun 2020 17:46:30 +0530 tests: add hghave rule 'setprocname' to check if osutil.setprocname and use it
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 17 Jun 2020 17:46:30 +0530] rev 45010
tests: add hghave rule 'setprocname' to check if osutil.setprocname and use it setprocname is not present when we build a pure version. This leads to output changes in test-chg.t This should make test suite green on Python 2 pure build with chg. Differential Revision: https://phab.mercurial-scm.org/D8638
Fri, 19 Jun 2020 20:42:14 +0530 util: flush stderr explicitly after using warnings.warn()
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 19 Jun 2020 20:42:14 +0530] rev 45009
util: flush stderr explicitly after using warnings.warn() Due to some unknown reasons, when using chg with python3, the warnings.warn() output is not flushed. Fixes test-devel-warnings.t on py3 with chg.
Thu, 18 Jun 2020 22:23:22 +0200 phases: improve performance of _retractboundary
Joerg Sonnenberger <joerg@bec.de> [Thu, 18 Jun 2020 22:23:22 +0200] rev 45008
phases: improve performance of _retractboundary The old version repeatedly converts nodes to revisions, which is a moderately expensive operation. Mapping all new changes once to revisions and back at the end reduces the time spend in _retractboundary during the unbundling of NetBSD's src from 67s to 17s. Differential Revision: https://phab.mercurial-scm.org/D8641
Thu, 18 Jun 2020 17:54:39 +0530 tests: use proctutil.stdout.write() instead of print() in test-extension.t
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 18 Jun 2020 17:54:39 +0530] rev 45007
tests: use proctutil.stdout.write() instead of print() in test-extension.t I was debugging this test failure on python3 + chg. I get the following hunk as test failure: ``` @@ -206,6 +206,18 @@ Check normal command's load order of ext 4) bar uipopulate 5) foo reposetup 5) bar reposetup + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 5) foo reposetup (chg !) + 5) bar reposetup (chg !) 0:c24b9ac61126 ``` After hours of debugging and head scracthing, I figured out that something is wrong with output flushing. I initially switched the print() statements to ui.warn() but thanks to Yuya who suggested using procutil.stdout.write() instead.
Wed, 08 Jan 2020 11:33:41 -0500 fuzz: tell manifest fuzzer about longer node hashes
Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 11:33:41 -0500] rev 45006
fuzz: tell manifest fuzzer about longer node hashes Differential Revision: https://phab.mercurial-scm.org/D8374
Mon, 01 Jun 2020 20:57:14 +0200 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 20:57:14 +0200] rev 45005
absorb: preserve changesets which were already empty Most commands in Mercurial (commit, rebase, absorb itself) don’t create empty changesets or drop them if they become empty. If there’s a changeset that’s empty, it must be a deliberate choice of the user. At least it shouldn’t be absorb’s responsibility to prune them. The fact that changesets that became empty during absorb are pruned, is unaffected by this. This case was found while writing patches which make it possible to configure absorb and rebase to not drop empty changesets. Even without having such config set, I think it’s valuable to preserve changesets which were already empty.
Mon, 01 Jun 2020 11:07:33 +0200 absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 11:07:33 +0200] rev 45004
absorb: preserve branch-closing changesets even if empty This makes the behavior consistent with 'hg commit', which allows to create otherwise empty changesets if they close the branch. A lost branch closure can inadvertently re-open a branch, so it should be preserved.
Mon, 01 Jun 2020 10:33:00 +0200 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 10:33:00 +0200] rev 45003
absorb: preserve branch-changing changesets even if empty This makes the behavior consistent with 'hg commit', which allows to create otherwise empty changesets if the branch changes compared to the parent. A branch change can denote important information, so it should be preserved.
Mon, 22 Jun 2020 15:19:35 +0530 rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net> [Mon, 22 Jun 2020 15:19:35 +0530] rev 45002
rhg: add Command trait for subcommands implemented by rhg Normalizes the interface of the cli's commands Differential Revision: https://phab.mercurial-scm.org/D8611 Differential Revision: https://phab.mercurial-scm.org/D8648
Fri, 05 Jun 2020 10:28:58 +0200 rhg: add rhg crate
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 05 Jun 2020 10:28:58 +0200] rev 45001
rhg: add rhg crate The goal of rhg is to speedup some of hg's commands when possible by bypassing python entirely for the time being. It is by no means a replacement for hg as it will not support extentions or configuration and implement only a subset of hg's commands and options. Only use rhg if you understand what the tradeoffs are. Differential Revision: https://phab.mercurial-scm.org/D8610
Fri, 05 Jun 2020 08:48:09 +0200 hg-core: add FindRoot operation to find repository root path
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 05 Jun 2020 08:48:09 +0200] rev 45000
hg-core: add FindRoot operation to find repository root path Differential Revision: https://phab.mercurial-scm.org/D8609
Fri, 05 Jun 2020 08:46:35 +0200 hg-core: add Operation interface for high-level hg operations
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 05 Jun 2020 08:46:35 +0200] rev 44999
hg-core: add Operation interface for high-level hg operations A distinction is made between operations and commands. An operation is a high-level function of mercurial whereas a command is what is exposed by the cli. A single command can use several operations to achieve its goal. Differential Revision: https://phab.mercurial-scm.org/D8608
Mon, 15 Jun 2020 18:26:40 +0200 rust: do a clippy pass
Raphaël Gomès <rgomes@octobus.net> [Mon, 15 Jun 2020 18:26:40 +0200] rev 44998
rust: do a clippy pass This is the result of running `cargo clippy` on hg-core/hg-cpython and fixing the lints that do not require too much code churn (and would warrant a separate commit/complete refactor) and only come from our code (a lot of warnings in hg-cpython come from `rust-cpython`). Most of those were good lints, two of them was the linter not being smart enough (or compiler to get up to `clippy`'s level depending on how you see it). Maybe in the future we could have `clippy` be part of the CI. Differential Revision: https://phab.mercurial-scm.org/D8635
Mon, 15 Jun 2020 15:14:16 -0400 fuzz: add config knob for PYTHON_CONFIG_FLAGS
Augie Fackler <augie@google.com> [Mon, 15 Jun 2020 15:14:16 -0400] rev 44997
fuzz: add config knob for PYTHON_CONFIG_FLAGS I'll clean this up once we get oss-fuzz to use Python 3.8 instead of 2.7, but for now we need a way to evolve the flags passed to python-config in lockstep with the Python version. Yuck. Differential Revision: https://phab.mercurial-scm.org/D8637
Mon, 15 Jun 2020 15:13:01 -0400 pyutil: this has taken so long to fix, I'm using 3.8 now
Augie Fackler <augie@google.com> [Mon, 15 Jun 2020 15:13:01 -0400] rev 44996
pyutil: this has taken so long to fix, I'm using 3.8 now Differential Revision: https://phab.mercurial-scm.org/D8636
Mon, 15 Jun 2020 12:00:15 -0400 merge with stable
Augie Fackler <augie@google.com> [Mon, 15 Jun 2020 12:00:15 -0400] rev 44995
merge with stable
Fri, 12 Jun 2020 23:43:56 +0200 tests: remove unused creation of file and outdated text
Manuel Jacob <me@manueljacob.de> [Fri, 12 Jun 2020 23:43:56 +0200] rev 44994
tests: remove unused creation of file and outdated text It was forgotten to remove this in fb0de0bcd297.
Sat, 06 Jun 2020 19:19:27 +0800 tests: skip pyflakes for mercurial/thirdparty/
Anton Shestakov <av6@dwimlabs.net> [Sat, 06 Jun 2020 19:19:27 +0800] rev 44993
tests: skip pyflakes for mercurial/thirdparty/ The current version of pyflakes (2.2.0) correctly detects one issue: mercurial/thirdparty/selectors2.py:335:40 '...'.format(...) has unused arguments at position(s): 1 But we're not interested in fixing lint errors in third-party code, so we need to exclude at least selectors2.py. And in the discussion for this patch it was decided to just skip the entire thirdparty directory. Differential Revision: https://phab.mercurial-scm.org/D8619
Tue, 09 Jun 2020 17:13:26 -0400 git: add debug logging when there's a mismatch in the cached heads list
Augie Fackler <augie@google.com> [Tue, 09 Jun 2020 17:13:26 -0400] rev 44992
git: add debug logging when there's a mismatch in the cached heads list The dag rebuild can be expensive, so let's try and avoid bugs where it transparently rebuilds all the time for no reason. This would have prevented the issue fixed in D8622. Differential Revision: https://phab.mercurial-scm.org/D8625
Wed, 10 Jun 2020 13:02:39 +0200 py3: make stdout line-buffered if connected to a TTY
Manuel Jacob <me@manueljacob.de> [Wed, 10 Jun 2020 13:02:39 +0200] rev 44991
py3: make stdout line-buffered if connected to a TTY Status messages that are to be shown on the terminal should be written to the file descriptor before anything further is done, to keep the user updated. One common way to achieve this is to make stdout line-buffered if it is connected to a TTY. This is done on Python 2 (except on Windows, where libc, which the CPython 2 streams depend on, does not properly support this). Python 3 rolls it own I/O streams. On Python 3, buffered binary streams can't be set line-buffered. The previous code (added in 227ba1afcb65) incorrectly assumed that on Python 3, pycompat.stdout (sys.stdout.buffer) is already line-buffered. However the interpreter initializes it with a block-buffered stream or an unbuffered stream (when the -u option or the PYTHONUNBUFFERED environment variable is set), never with a line-buffered stream. One example where the current behavior is unacceptable is when running `hg pull https://www.mercurial-scm.org/repo/hg` on Python 3, where the line "pulling from https://www.mercurial-scm.org/repo/hg" does not appear on the terminal before the hg process blocks while waiting for the server. Various approaches to fix this problem are possible, including: 1. Weaken the contract of procutil.stdout to not give any guarantees about buffering behavior. In this case, users of procutil.stdout need to be changed to do enough flushes. In particular, 1. either ui must insert enough flushes for ui.write() and friends, or 2. ui.write() and friends get split into flushing and fully buffered methods, or 3. users of ui.write() and friends must flush explicitly. 2. Make stdout unbuffered. 3. Make stdout line-buffered. Since Python 3 does not natively support that for binary streams, we must implement it ourselves. (2.) is problematic because using unbuffered I/O changes the performance characteristics significantly compared to line-buffered (which is used on Python 2) and this would be a regression. (1.2.) and (1.3) are a substantial amount of work. It’s unclear whether the added complexity would be justified, given that raw performance doesn’t matter that much when writing to a terminal much faster than the user could read it. (1.1.) pushes complexity into the ui class instead of separating the concern of how stdout is buffered. Other users of procutil.stdout would still need to take care of the flushes. This patch implements (3.). The general performance considerations are very similar to (1.1.). The extra method invocation and method forwarding add a little more overhead if the class is used. In exchange, it doesn’t add overhead if not used. For the benchmarks, I compared the previous implementation (incorrect on Python 3), (1.1.), (3.) and (2.). The command was chosen so that the streams were configured as if they were writing to a TTY, but actually write to a pager, which is also the default: HGRCPATH=/dev/null python3 ./hg --cwd ~/vcs/mozilla-central --time --pager yes --config pager.pager='cat > /dev/null' status --all previous: time: real 7.880 secs (user 7.290+0.050 sys 0.580+0.170) time: real 7.830 secs (user 7.220+0.070 sys 0.590+0.140) time: real 7.800 secs (user 7.210+0.050 sys 0.570+0.170) (1.1.) using Yuya Nishihara’s patch: time: real 9.860 secs (user 8.670+0.350 sys 1.160+0.830) time: real 9.540 secs (user 8.430+0.370 sys 1.100+0.770) time: real 9.830 secs (user 8.630+0.370 sys 1.180+0.840) (3.) using this patch: time: real 9.580 secs (user 8.480+0.350 sys 1.090+0.770) time: real 9.670 secs (user 8.480+0.330 sys 1.170+0.860) time: real 9.640 secs (user 8.500+0.350 sys 1.130+0.810) (2.) using a previous patch by me: time: real 10.480 secs (user 8.850+0.720 sys 1.590+1.500) time: real 10.490 secs (user 8.750+0.750 sys 1.710+1.470) time: real 10.240 secs (user 8.600+0.700 sys 1.590+1.510) As expected, there’s no difference on Python 2, as exactly the same code paths are used: previous: time: real 6.950 secs (user 5.870+0.330 sys 1.070+0.770) time: real 7.040 secs (user 6.040+0.360 sys 0.980+0.750) time: real 7.070 secs (user 5.950+0.360 sys 1.100+0.760) this patch: time: real 7.010 secs (user 5.900+0.390 sys 1.070+0.730) time: real 7.000 secs (user 5.850+0.350 sys 1.120+0.760) time: real 7.000 secs (user 5.790+0.380 sys 1.170+0.710)
Tue, 02 Jun 2020 21:44:57 +0900 simplemerge: rewrite flag merging loop as expression
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jun 2020 21:44:57 +0900] rev 44990
simplemerge: rewrite flag merging loop as expression I feel binary operations are more readable.
Tue, 02 Jun 2020 21:40:49 +0900 simplemerge: leverage pycompat function to convert byte string to set
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jun 2020 21:40:49 +0900] rev 44989
simplemerge: leverage pycompat function to convert byte string to set
Tue, 02 Jun 2020 21:39:07 +0900 simplemerge: fix function name that tests if ctx is not null revision
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jun 2020 21:39:07 +0900] rev 44988
simplemerge: fix function name that tests if ctx is not null revision
Tue, 09 Jun 2020 13:18:21 -0700 git: decode node IDs back into Python strings (issue6349)
Hollis Blanchard <hollis_blanchard@mentor.com> [Tue, 09 Jun 2020 13:18:21 -0700] rev 44987
git: decode node IDs back into Python strings (issue6349) db.text_factory = bytes, so the database contains only strings. The object IDs we get from pygit2 are Python strings. b'foo' != 'foo' This change allows the "don't reindex" optimization to work by allowing the "cur_cache_heads == cache_heads" comparison a few lines down to succeed. Differential Revision: https://phab.mercurial-scm.org/D8622
Tue, 09 Jun 2020 22:02:09 +0530 phabricator: make it clear what happen when no response
Sushil khanchi <sushilkhanchi97@gmail.com> [Tue, 09 Jun 2020 22:02:09 +0530] rev 44986
phabricator: make it clear what happen when no response Differential Revision: https://phab.mercurial-scm.org/D8621
Mon, 08 Jun 2020 11:43:07 +0530 tests: make it clear what happen when no response entered
Sushil khanchi <sushilkhanchi97@gmail.com> [Mon, 08 Jun 2020 11:43:07 +0530] rev 44985
tests: make it clear what happen when no response entered Differential Revision: https://phab.mercurial-scm.org/D8620
Sat, 18 Jan 2020 10:07:07 -0800 localrepo: handle ValueError during repository opening
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 18 Jan 2020 10:07:07 -0800] rev 44984
localrepo: handle ValueError during repository opening Python 3.8 can raise ValueError on attempt of an I/O operation against an illegal path. This was causing test-remotefilelog-gc.t to fail on Python 3.8. This commit teaches repository opening to handle ValueError and re-raise an Abort on failure. An arguably better solution would be to implement this logic in the vfs layer. But that seems like a bag of worms and I don't want to go down that rabbit hole. Until users report uncaught ValueError exceptions in the wild, I think it is fine to patch this at the only occurrence our test harness is finding it. Differential Revision: https://phab.mercurial-scm.org/D7944
Wed, 27 May 2020 12:56:13 +0200 metadata: filter the `removed` set to only contains relevant data
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 May 2020 12:56:13 +0200] rev 44983
metadata: filter the `removed` set to only contains relevant data The `files` entry can be bogus and contains too many entries. This can badly combines with the computation of `removed` inflating the set size. The can lead to the changesets centric rename computation to process much more data than needed, slowing it down (and increasing space taken by data storage). In practice newer commits already that reduced set, this applies this "fix" to older changeset. Differential Revision: https://phab.mercurial-scm.org/D8589
Wed, 27 May 2020 12:45:39 +0200 files: extract code for extra filtering of the `removed` entry into copies
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 May 2020 12:45:39 +0200] rev 44982
files: extract code for extra filtering of the `removed` entry into copies We want to reduce the set of `removed` files that to the set of files actually removed. That `removed` set is used as of the changeset centric algorithm, having smaller sets means less processing and faster computation. In this changeset we extract the code to be a function of it own. We will make use of it in the next changesets. Differential Revision: https://phab.mercurial-scm.org/D8588
Wed, 27 May 2020 12:26:08 +0200 metadata: move computation related to files touched in a dedicated module
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 May 2020 12:26:08 +0200] rev 44981
metadata: move computation related to files touched in a dedicated module This was suggested by Yuya Nishihara a while back. Since I am about to add more metadata related computation, lets create a new repositories. Differential Revision: https://phab.mercurial-scm.org/D8587
Fri, 05 Jun 2020 11:10:33 -0700 merge: move an inspection of the dirstate from record to calculate phase
Martin von Zweigbergk <martinvonz@google.com> [Fri, 05 Jun 2020 11:10:33 -0700] rev 44980
merge: move an inspection of the dirstate from record to calculate phase The intent is clearly to have `calculateupdates()` figure out what actions need to be taken and `recordupdates()` to make necessary modifications to the dirstate. However, in the `ACTION_PATH_CONFLICT_RESOLVE` case, there was one little inspection of copy information done in `recordupdates()`. This patch moves that to `calculateupdates()`. That will help with the next patch, which makes `merge.update()` work better with `overlayworkingctx` (copies should be recorded there too, even though we skip the `recordupdates()` step). Differential Revision: https://phab.mercurial-scm.org/D8615
Sat, 06 Jun 2020 19:15:11 +0800 tests: adjust to the new format in pyflakes output
Anton Shestakov <av6@dwimlabs.net> [Sat, 06 Jun 2020 19:15:11 +0800] rev 44979
tests: adjust to the new format in pyflakes output According to the pyflakes' NEWS.rst, the default output format changed recently: 2.2.0 (2020-04-08) - Include column information in error messages So the lines now read: contrib/perf.py:149:15 undefined name 'xrange' mercurial/hgweb/server.py:427:13 undefined name 'reload' mercurial/util.py:2862:24 undefined name 'file' Differential Revision: https://phab.mercurial-scm.org/D8618
Sat, 06 Jun 2020 19:12:49 +0800 tests: consistently use pyflakes as a Python module
Anton Shestakov <av6@dwimlabs.net> [Sat, 06 Jun 2020 19:12:49 +0800] rev 44978
tests: consistently use pyflakes as a Python module We check availability of pyflakes as a module, and also running it for real as a module. Only fair to test filterpyflakes.py working correctly when using pyflakes as a module too. Differential Revision: https://phab.mercurial-scm.org/D8617
Wed, 26 Feb 2020 00:31:23 +0100 heptapod-ci: also run tests for chg on python 2
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 26 Feb 2020 00:31:23 +0100] rev 44977
heptapod-ci: also run tests for chg on python 2 I am not aware of any regular effort to run test with chg. So let's at least do it here. Differential Revision: https://phab.mercurial-scm.org/D8178
Tue, 02 Jun 2020 17:24:37 +0200 rust-dependencies: upgrade `micro-timer` dependency
Raphaël Gomès <rgomes@octobus.net> [Tue, 02 Jun 2020 17:24:37 +0200] rev 44976
rust-dependencies: upgrade `micro-timer` dependency I wanted to to a tour of dependencies to upgrade, but only `micro-timer` has a new release which does not print when the function panics, which should be less misleading. Differential Revision: https://phab.mercurial-scm.org/D8605
Wed, 03 Jun 2020 12:04:38 -0700 context: fix creation of ProgrammingError to not use non-existent field
Martin von Zweigbergk <martinvonz@google.com> [Wed, 03 Jun 2020 12:04:38 -0700] rev 44975
context: fix creation of ProgrammingError to not use non-existent field Differential Revision: https://phab.mercurial-scm.org/D8606
Wed, 03 Jun 2020 22:07:26 -0700 help: explain in `hg help flags` that unambiguous prefixes are allowed
Martin von Zweigbergk <martinvonz@google.com> [Wed, 03 Jun 2020 22:07:26 -0700] rev 44974
help: explain in `hg help flags` that unambiguous prefixes are allowed I used `hg commit --amend` as an example because that's the most frequently used flag I could think of that doesn't yet have a short form. Differential Revision: https://phab.mercurial-scm.org/D8607
Wed, 03 Jun 2020 11:28:57 -0400 git: add coverage for manifest.diff() so we don't regress
Augie Fackler <augie@google.com> [Wed, 03 Jun 2020 11:28:57 -0400] rev 44973
git: add coverage for manifest.diff() so we don't regress
Mon, 01 Jun 2020 11:12:25 -0400 git: implement diff manifest method
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Mon, 01 Jun 2020 11:12:25 -0400] rev 44972
git: implement diff manifest method This makes 'hg diff' work.
Mon, 01 Jun 2020 09:49:47 -0400 git: properly visit child tree objects when resolving a path
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Mon, 01 Jun 2020 09:49:47 -0400] rev 44971
git: properly visit child tree objects when resolving a path
Mon, 01 Jun 2020 09:40:18 -0400 git: don't yield paths for directories when walking
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Mon, 01 Jun 2020 09:40:18 -0400] rev 44970
git: don't yield paths for directories when walking
Mon, 01 Jun 2020 09:22:53 -0400 git: correctly check for type of object when walking
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Mon, 01 Jun 2020 09:22:53 -0400] rev 44969
git: correctly check for type of object when walking
Mon, 01 Jun 2020 08:59:48 -0400 git: implement stub prefetch_parents dirstate method
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Mon, 01 Jun 2020 08:59:48 -0400] rev 44968
git: implement stub prefetch_parents dirstate method A recent change (35b255e474d9) introduced this new required dirstate method but didn't update the git extension.
Mon, 25 May 2020 23:06:50 +0900 rust: leverage .expect() in place of .unwrap() + inline comment
Yuya Nishihara <yuya@tcha.org> [Mon, 25 May 2020 23:06:50 +0900] rev 44967
rust: leverage .expect() in place of .unwrap() + inline comment For a better error indication in case we made a mistake.
Mon, 25 May 2020 23:02:07 +0900 rust: fix false comment about mpsc::Sender
Yuya Nishihara <yuya@tcha.org> [Mon, 25 May 2020 23:02:07 +0900] rev 44966
rust: fix false comment about mpsc::Sender We need Sync to share the Sender reference across threads.
Wed, 03 Jun 2020 19:20:18 +0900 merge with stable
Yuya Nishihara <yuya@tcha.org> [Wed, 03 Jun 2020 19:20:18 +0900] rev 44965
merge with stable
Sat, 30 May 2020 12:36:00 -0400 relnotes: advertize the possibility to use rust
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sat, 30 May 2020 12:36:00 -0400] rev 44964
relnotes: advertize the possibility to use rust I think the rust work may have been mentioned in the release notes, but if so only in passing, and not as an invitation to try it out. I think the next version is a decent time to do this, because the rust doesn't come with performance regressions AFAIK, speeds up status noticeably when it applies, which is the case for most invocations of status, and doesn't have the undesirable restriction of regex around empty patterns anymore. I am cheating a bit, because I'm giving numbers for `hg status` in mozilla-central, but they have one hgignore pattern that uses lookaround, ".vscode/(?!extensions\.json|tasks\.json", which I took out as it would cause a fallback to python when unknown files are requested. But it seems that they could express their hgignore differently if they were so inclined. Not sure if there are limitation other than linux-only that I am not thinking of but would be worth mentioning upfront, to avoid disappointing users? Differential Revision: https://phab.mercurial-scm.org/D8604
Sat, 30 May 2020 11:36:30 -0400 rust: add a pointer for profiling to the README
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sat, 30 May 2020 11:36:30 -0400] rev 44963
rust: add a pointer for profiling to the README As figuring out how to get useful profiles is not obvious. Differential Revision: https://phab.mercurial-scm.org/D8603
Sat, 30 May 2020 10:28:46 -0400 rust: update the mention of hgcli in rust/README.rst
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sat, 30 May 2020 10:28:46 -0400] rev 44962
rust: update the mention of hgcli in rust/README.rst This may not be exactly right, but it's better than before. Differential Revision: https://phab.mercurial-scm.org/D8602
Mon, 01 Jun 2020 15:22:31 +0200 sslutil: fix comment to use inclusive or instead of exclusive or
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 15:22:31 +0200] rev 44961
sslutil: fix comment to use inclusive or instead of exclusive or The incorrect "either" was introduced by one of my recent patches.
Mon, 01 Jun 2020 14:34:22 +0200 sslutil: propagate return value ssl.PROTOCOL_SSLv23 from protocolsettings()
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 14:34:22 +0200] rev 44960
sslutil: propagate return value ssl.PROTOCOL_SSLv23 from protocolsettings() Also, protocolsettings() was renamed to commonssloptions() to reflect that only the options are returned.
Mon, 01 Jun 2020 14:20:13 +0200 sslutil: stop storing protocol and options for SSLContext in settings dict
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 14:20:13 +0200] rev 44959
sslutil: stop storing protocol and options for SSLContext in settings dict Call protocolsettings() where its return values are needed.
Mon, 01 Jun 2020 14:07:06 +0200 sslutil: rename 'minimumprotocolui' -> 'minimumprotocol'
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 14:07:06 +0200] rev 44958
sslutil: rename 'minimumprotocolui' -> 'minimumprotocol' Before, both 'minimumprotocolui' and 'minimumprotocol' were used, but meaning the same.
Mon, 01 Jun 2020 03:51:54 +0200 sslutil: properly detect which TLS versions are supported by the ssl module
Manuel Jacob <me@manueljacob.de> [Mon, 01 Jun 2020 03:51:54 +0200] rev 44957
sslutil: properly detect which TLS versions are supported by the ssl module For the record, I contacted the CPython developers to remark that unconditionally defining ssl.PROTOCOL_TLSv1_1 / ssl.PROTOCOL_TLSv1_2 is problematic: https://github.com/python/cpython/commit/6e8cda91d92da72800d891b2fc2073ecbc134d98#r39569316
Sun, 31 May 2020 22:31:49 +0200 sslutil: remove dead code (that failed if only TLS 1.0 is available)
Manuel Jacob <me@manueljacob.de> [Sun, 31 May 2020 22:31:49 +0200] rev 44956
sslutil: remove dead code (that failed if only TLS 1.0 is available) We ensure in setup.py that TLS 1.1 or TLS 1.2 is present.
Sun, 31 May 2020 00:30:49 +0200 config: remove unused hostsecurity.disabletls10warning config
Manuel Jacob <me@manueljacob.de> [Sun, 31 May 2020 00:30:49 +0200] rev 44955
config: remove unused hostsecurity.disabletls10warning config
Sun, 31 May 2020 22:15:35 +0200 sslutil: remove dead code (that downgraded default minimum TLS version)
Manuel Jacob <me@manueljacob.de> [Sun, 31 May 2020 22:15:35 +0200] rev 44954
sslutil: remove dead code (that downgraded default minimum TLS version) We ensure in setup.py that TLS 1.1 or TLS 1.2 is present.
(0) -30000 -10000 -3000 -1000 -300 -100 -96 +96 +100 +300 +1000 +3000 tip