Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 May 2017 13:32:07 +0200] rev 32390
perf: allow to clear the obsstore in 'perfvolatilesets'
Loading the obsstore can become a large part of the time necessary to compute
the important volatile set. We add a flag purging all known obsstore related
data.
For example, computing the 'bumped' set currently requires reading the full
obsstore, so timing greatly differ with or without that flag:
Without:
! bumped
! wall 0.005047 comb 0.000000 user 0.000000 sys 0.000000 (best of 446)
With:
! bumped
! wall 0.512367 comb 0.510000 user 0.480000 sys 0.030000 (best of 15)
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 21 May 2017 13:49:48 +0200] rev 32389
obsolete: test an important corner case
Receiving markers affecting changeset we'll receives later is legitimate and
not so uncommon case. Working on cache highlighted that this was only testing
in the evolve extension. We add a test for this case in core.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 18 May 2017 22:47:42 -0700] rev 32388
largefiles: replace always() method, not _always field
We will soon have matchers that don't have an _always field, so
largefiles needs to stop assuming that they do. _always is only used
by always(), so we safely replace that method instead.
Augie Fackler <augie@google.com> [Sun, 21 May 2017 02:45:32 -0400] rev 32387
merge with stable
Yuya Nishihara <yuya@tcha.org> [Sun, 21 May 2017 13:41:01 +0900] rev 32386
cext: mark constant variables
Yuya Nishihara <yuya@tcha.org> [Sun, 21 May 2017 13:35:19 +0900] rev 32385
cext: move util.h to cext tree
Since util.h isn't useful in plain C module, it should be placed in CPython
extension directory.
Yuya Nishihara <yuya@tcha.org> [Sun, 21 May 2017 13:31:27 +0900] rev 32384
cext: move back finalization of dirstateTupleType where it should be
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 23 May 2017 03:29:23 +0900] rev 32383
dispatch: setup color before pager for correct console information on windows
Before this patch, "hg CMD --pager on" on Windows shows output
unintentionally decorated with ANSI color escape sequences, if color
mode is "auto". This issue occurs in steps below.
1. dispatch() invokes ui.pager() at detection of "--pager on"
2. stdout of hg process is redirected into stdin of pager process
3. "ui.formatted" = True, because isatty(stdout) is so before (2)
4. color module is loaded for colorization
5. color.w32effects = None, because GetConsoleScreenBufferInfo()
fails on stdout redirected at (2)
6. "ansi" color mode is chosen, because of "not w32effects"
7. output is colorized in "ansi" mode because of "ui.formatted" = True
Even if "ansi" color mode is chosen, ordinarily redirected stdout
makes ui.formatted() return False, and colorization is avoided. But in
this issue case, "ui.formatted" = True at (3) forces output to be
colorized.
For correct console information on win32, it is needed to ensure that
color module is loaded before redirection of stdout for pagination.
BTW, if any of enabled extensions has "colortable" attribute, this
issue is avoided even before this patch, because color module is
imported as a part of loading such extension, and extension loading
occurs before setting up pager. For example, mq and keyword have
"colortable".
Martin von Zweigbergk <martinvonz@google.com> [Sat, 20 May 2017 22:27:52 -0700] rev 32382
cleanup: reuse existing wctx variables instead of calling repo[None]
Incidentally, this apparently means we load .hgsub one time less as
well, which affects a test case.
Augie Fackler <augie@google.com> [Thu, 18 May 2017 16:43:56 -0400] rev 32381
localrepo: extract bookmarkheads method to bookmarks.py
This method is only used internally by destutil, and it's obscure
enough I'm willing to just move it without a deprecation warning,
especially since the new method has more constrained functionality.
Design-wise I'd also like to get active bookmark handling folded into
the bookmark store, so that we don't squirrel away an extra attribute
for the active bookmark on the repository object.
Augie Fackler <augie@google.com> [Sat, 20 May 2017 20:50:29 -0400] rev 32380
tests: avoid renamed files triggering check-commit failures
I had to flag some revisions to not undergo check-commit scrutiny
today to get the tests to pass, because they renamed files that had
existing failures which we're not cleaning up. Let's prevent that in
the future by using the extended git diff format to elide moved code.
Jun Wu <quark@fb.com> [Sat, 29 Apr 2017 21:39:47 -0700] rev 32379
dispatch: make request accept additional reposetups
chg needs special logic around repo object creation (like, collecting and
reporting repo path to the master server). Adding "reposetup" to
dispatch.request seems to be an easy and reasonably clean way to allow that.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 20 May 2017 14:01:05 -0700] rev 32378
cext: extract revlog/index parsing code to own C file
parsers.c is ~3000 lines and ~2/3 of it is related to the revlog
index type.
We already have separate C source files for directory utilities
and manifest parsing. I think the quite unwieldy revlog/index
parsing code should be self-contained as well.
I performed the extraction as a file copy then removed content
from both sides in order to preserve file history and blame.
As part of this, I also had to move the hexdigit table and
function to a shared header since it is used by both parsers.c
and revlog.c
# no-check-commit
Yuya Nishihara <yuya@tcha.org> [Thu, 04 May 2017 17:13:12 +0900] rev 32377
debugcommands: use temporary dict for its command table
Instead, load the table by commands.py so the debug commands should always
be populated. The table in debugcommands.py is unnamed so extension authors
wouldn't be confused to wrap debugcommands.table in place of commands.table.
Yuya Nishihara <yuya@tcha.org> [Sun, 14 May 2017 16:42:16 +0900] rev 32376
commands: move debugcommands and debugcomplete back to commands module
These commands depend heavily on the commands table, so it doesn't make
much sense to isolate them to debugcommands.py. This helps eliminating
the future import cycle.
Yuya Nishihara <yuya@tcha.org> [Sun, 14 May 2017 16:19:47 +0900] rev 32375
commands: move templates of common command options to cmdutil (API)
The goal is to get rid of the debugcommands -> commands dependency.
Since globalopts is the property of the commands, it's kept in the commands
module.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Aug 2016 12:29:53 +0900] rev 32374
import-checker: drop workaround for pure modules
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Aug 2016 12:28:52 +0900] rev 32373
policy: drop custom importer for pure modules
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Aug 2016 12:23:56 +0900] rev 32372
parsers: switch to policy importer
# no-check-commit
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Aug 2016 12:18:58 +0900] rev 32371
mpatch: switch to policy importer
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Aug 2016 12:15:49 +0900] rev 32370
diffhelpers: switch to policy importer
# no-check-commit
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Aug 2016 12:12:50 +0900] rev 32369
bdiff: switch to policy importer
# no-check-commit
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Aug 2016 12:08:23 +0900] rev 32368
base85: switch to policy importer
Yuya Nishihara <yuya@tcha.org> [Fri, 12 Aug 2016 11:35:17 +0900] rev 32367
osutil: switch to policy importer
"make clean" is recommended to test this change, though C API compatibility
should be preserved.
Yuya Nishihara <yuya@tcha.org> [Fri, 12 Aug 2016 11:30:17 +0900] rev 32366
policy: add helper to import cext/pure module
These functions are sysstr API since __import__() and getattr() hate byte
strings on Python 3.
There's a minor BC, which is ImportError will be raised if invalid
HGMODULEPOLICY is specified. I think this is more desired behavior.
We're planning to add strict checking for C API compatibility. This patch
includes the stub for it.
Yuya Nishihara <yuya@tcha.org> [Sat, 20 May 2017 15:09:14 +0900] rev 32365
demandimport: strictly check missing locals argument
locals may be an empty dict.
Augie Fackler <augie@google.com> [Thu, 18 May 2017 18:01:48 -0400] rev 32364
localrepo: mark walk convenience method as deprecated (API)
Augie Fackler <augie@google.com> [Thu, 18 May 2017 18:01:01 -0400] rev 32363
debugcommands: use repo[None].walk instead of repo.walk
Augie Fackler <augie@google.com> [Thu, 18 May 2017 18:00:52 -0400] rev 32362
cmdutil: use repo[None].walk instead of repo.walk
Augie Fackler <augie@google.com> [Thu, 18 May 2017 18:00:38 -0400] rev 32361
largefiles: use repo[None].walk instead of repo.walk
Jun Wu <quark@fb.com> [Tue, 25 Apr 2017 17:43:30 -0700] rev 32360
parsers: add version to help detect breaking binary changes
Jun Wu <quark@fb.com> [Tue, 25 Apr 2017 17:36:59 -0700] rev 32359
osutil: add version to help detect breaking binary changes
See the previous patch for why.
Jun Wu <quark@fb.com> [Tue, 25 Apr 2017 17:38:36 -0700] rev 32358
mpatch: add version to help detect breaking binary changes
Jun Wu <quark@fb.com> [Tue, 25 Apr 2017 17:40:13 -0700] rev 32357
diffhelpers: add version to help detect breaking binary changes
Jun Wu <quark@fb.com> [Tue, 25 Apr 2017 17:45:48 -0700] rev 32356
base85: add version to help detect breaking binary changes
Jun Wu <quark@fb.com> [Tue, 25 Apr 2017 17:34:41 -0700] rev 32355
bdiff: add version to help detect breaking binary changes
Previously, we have no way to detect if a compiled .so file could be used or
not, and blindly load it if it exists. Usually we carefully maintain
compatibility of .so and fallback to pure code gracefully. But if we stick
to the rules, certain nice changes will be impossible to make in a clean
way.
This patch adds a "version" constant to the module so we can detect
inconsistency and take appropriate actions (warn, abort, fallback to pure,
run make automatically) in module loader.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 20 May 2017 03:10:23 +0200] rev 32354
obsmarker: add an experimental flag controlling "operation" recording
It seems better to introduce the experiment behind a flag for now as there are
multiple concerns around the feature:
* Storing operation increase the size of obsolescence markers significantly
(+10-20%).
* It performs poorly when exchanging markers (cannot combine command names,
command name might be unknown remotely, etc)
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 19 May 2017 19:46:45 -0700] rev 32353
run-tests: remove references to Python 2.6
These are the obvious ones. There is tons of code in this file
implementing features from unittest that weren't present in
Python 2.6. But that's for other patches.
Augie Fackler <augie@google.com> [Thu, 18 May 2017 17:13:32 -0400] rev 32352
dirstate: mark {begin,end}parentchange as deprecated (API)
Augie Fackler <augie@google.com> [Thu, 18 May 2017 17:11:24 -0400] rev 32351
merge: migrate to context manager for changing dirstate parents
Augie Fackler <augie@google.com> [Thu, 18 May 2017 17:11:14 -0400] rev 32350
localrepo: migrate to context manager for changing dirstate parents
Augie Fackler <augie@google.com> [Thu, 18 May 2017 17:11:07 -0400] rev 32349
context: migrate to context manager for changing dirstate parents
Augie Fackler <augie@google.com> [Thu, 18 May 2017 17:11:01 -0400] rev 32348
rebase: migrate to context manager for changing dirstate parents
Augie Fackler <augie@google.com> [Thu, 18 May 2017 17:10:53 -0400] rev 32347
mq: migrate to context manager for changing dirstate parents
Augie Fackler <augie@google.com> [Thu, 18 May 2017 17:10:30 -0400] rev 32346
dirstate: introduce new context manager for marking dirstate parent changes
Kostia Balytskyi <ikostia@fb.com> [Fri, 19 May 2017 17:01:34 -0700] rev 32345
contrib: make editmergeps able to work with notepad++
Notepad++ has a different FIRSTLINE argument, so needs special handling.
Kostia Balytskyi <ikostia@fb.com> [Fri, 19 May 2017 17:00:55 -0700] rev 32344
contrib: make editmergeps able to work with Windows GUI editors
Using Start-Process -Wait makes it wait until the process finishes,
which is necesssary for Windows GUI applications. My short testing
also demonstrated that it does not hurt with command line vim.
Yuya Nishihara <yuya@tcha.org> [Sat, 09 Jan 2016 23:24:52 +0900] rev 32343
extensions: show deprecation warning for the use of cmdutil.command
Since this is a fundamental API for extensions, we set 1-year period until
actually removing it.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 May 2017 15:41:50 +0900] rev 32342
extensions: prohibit registration of command without using @command (API)
Detect the problem earlier for better error indication. I'm tired of teaching
users that the mq extension is not guilty but the third-party extension is.
https://bitbucket.org/tortoisehg/thg/issues?q=%27norepo%27
Yuya Nishihara <yuya@tcha.org> [Sun, 14 May 2017 15:46:45 +0900] rev 32341
extensions: optionally print hint on import failure
Test will be added by the next patch.
Yuya Nishihara <yuya@tcha.org> [Sun, 14 May 2017 15:41:27 +0900] rev 32340
error: add hint to ProgrammingError
As the hint isn't shown by the default exception handler, we need to print
it manually. I've copied the "** " style from _exceptionwarning().
Yuya Nishihara <yuya@tcha.org> [Mon, 08 May 2017 22:14:56 +0900] rev 32339
registrar: unindent superfluous "if True" block
Yuya Nishihara <yuya@tcha.org> [Mon, 08 May 2017 22:08:40 +0900] rev 32338
registrar: switch @command decorator to class
It overrides _funcregistrarbase._doregister() since the structure of the
command table is quite different.
Yuya Nishihara <yuya@tcha.org> [Sat, 09 Jan 2016 23:07:20 +0900] rev 32337
registrar: move cmdutil.command to registrar module (API)
cmdutil.command wasn't a member of the registrar framework only for a
historical reason. Let's make that happen. This patch keeps cmdutil.command
as an alias for extension compatibility.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 May 2017 17:53:55 +0900] rev 32336
gendoc: make sure locale path is set before loading any modules
Otherwise some messages wouldn't be translated depending on when the util
was loaded.
Wez Furlong <wez@fb.com> [Thu, 18 May 2017 12:49:10 -0700] rev 32335
fsmonitor: don't attempt state-leave if we didn't state-enter
The state-enter command may not have been successful; for example, the watchman
client session may have timed out if the user was busy/idle for a long period
during a merge conflict resolution earlier in processing a rebase for a stack
of diffs.
It's cleaner (from the perspective of the watchman logs) to avoid issuing the
state-leave command in these cases.
Test Plan:
ran
`hg rebase --tool :merge -r '(draft() & date(-14)) - master::' -d master`
and didn't observe any errors in the watchman logs or in the output from
`watchman -p -j <<<'["subscribe", "/data/users/wez/fbsource", "wez", {"expression": ["name", ".hg/updatestate"]}]'`
Wez Furlong <wez@fb.com> [Thu, 18 May 2017 12:48:07 -0700] rev 32334
fsmonitor: acquire localrepo.wlock prior to emitting hg.update state
we see some weird things in the watchman logs where the mercurial
process is seemingly confused about which hg.update state it is publishing
through watchman.
On closer examination, we're seeing conflicting pids for the clients involved
and this implies a race.
To resolve this, we extend the wlock around the state-enter/state-leave
events that are emitted to watchman.
Test Plan:
Some manual testing:
In one window, run this, and then checkout a different rev:
```
$ watchman -p -j <<<'["subscribe", "/data/users/wez/fbsource", "wez", {"expression": ["name", ".hg/updatestate"]}]'
{
"version": "4.9.0",
"subscribe": "wez",
"clock": "c:
1495034090:814028:1:312576"
}
{
"state-enter": "hg.update",
"version": "4.9.0",
"clock": "c:
1495034090:814028:1:312596",
"unilateral": true,
"subscription": "wez",
"metadata": {
"status": "ok",
"distance": 125,
"rev": "
a1275d79ffa6c58b53116c8ec401c275ca6c1e2a",
"partial": false
},
"root": "/data/users/wez/fbsource"
}
{
"root": "/data/users/wez/fbsource",
"metadata": {
"status": "ok",
"distance": 125,
"rev": "
a1275d79ffa6c58b53116c8ec401c275ca6c1e2a",
"partial": false
},
"subscription": "wez",
"unilateral": true,
"version": "4.9.0",
"clock": "c:
1495034090:814028:1:312627",
"state-leave": "hg.update"
}
```
Tailed the watchman log file and looked for invalid state assertion errors,
then ran my `rebase-all` script to update/rebase all of my heads.
Didn't trigger the error condition (but couldn't reliably trigger it previously
anyway), and the output captured above shows that the states are being emitted
correctly.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 19 May 2017 13:12:42 +0200] rev 32333
obsolete: move the 'isenabled' function at the top of the file
That is a simple and important function so having it at the top next to the
related constant seems better.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 19 May 2017 13:09:23 +0200] rev 32332
cache: make the cache updated callback easily accessible to extension
This will help extension to benefit from this new logic. As a side effect this
clarify the 'transaction' method a little bit.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 19 May 2017 12:35:14 +0200] rev 32331
obscheckhead: skip context creation to test phase
On repository with many many heads, this is called often enough to show an
overhead to appears in some profile. So we skip the 'changectx' creation to test
the node phases.