Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Mar 2017 12:23:56 -0700] rev 31473
exchange: reject new compression engines for v1 bundles (
issue5506)
Version 1 bundles only support a fixed set of compression engines.
Before this change, we would accept any compression engine for v1
bundles, even those that may not work on v1. This could lead to
an error.
We define a fixed set of compression engines known to work with v1
bundles and we add checking to ensure a newer engine (like zstd)
won't work with v1 bundles.
I also took the liberty of adding test coverage for unknown compression
names because I noticed we didn't have coverage of it before.
Martijn Pieters <mjpieters@fb.com> [Sun, 12 Mar 2017 11:43:31 -0700] rev 31472
config: honour the trusted flag in ui.configbytes
Jun Wu <quark@fb.com> [Wed, 15 Mar 2017 20:43:12 -0700] rev 31471
osutil: fix potential wrong fd close
According to POSIX closedir [1]:
If a file descriptor is used to implement type DIR, that file descriptor
shall be closed.
According to POSIX fdopendir [2]:
Upon calling closedir() the file descriptor shall be closed.
So we should avoid "close(dfd)" after "closedir(dir)". With threads, there
could be a race where an innocent fd gets closed. But Python GIL seems to
help hiding the issue well.
[1]: http://pubs.opengroup.org/onlinepubs/
009695399/functions/closedir.html
[2]: http://pubs.opengroup.org/onlinepubs/
9699919799/functions/fdopendir.html
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Mar 2017 12:09:31 -0800] rev 31470
parsers: use Python memory allocator for indexObject->offsets
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Mar 2017 12:02:59 -0800] rev 31469
parsers: use Python memory allocator in commonancestorsheads()
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Mar 2017 11:56:47 -0800] rev 31468
osutil: use Python memory allocator in _listdir
The Python memory allocator has performance advantages
for small allocations.
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Mar 2017 11:54:25 -0800] rev 31467
bdiff: use Python memory allocator in fixws
Python has its own memory allocation APIs. For allocations
<= 512 bytes, it allocates memory from arenas. This means that
average small allocations don't call the system allocator, which
makes them faster. Also, arena allocations cut down on memory
fragmentation, which can matter for performance in long-running
processes.
Another advantage of using the Python memory allocator is that
allocations are tracked by Python. This is a bigger deal in
Python 3, as modern versions of Python have some decent built-in
tools for examining memory usage, leaks, etc.
This patch converts a trivial malloc() + free() in the bdiff code
to use the Python allocator APIs. Since the object being
operated on is a line, chances are it will use an arena. So,
this could have a net positive impact on performance (although
I didn't measure it).
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 16 Mar 2017 11:17:55 -0700] rev 31466
localrepo: fix deprecation warning version of wfile
The patch lingered a bit too long in my local clone and I messed up when I
updated the version number. Since nobody caught it, I'm fixing the version after
the fact.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:07:14 -0700] rev 31465
util: explicitly tests for None
Changeset
8b6927eb7efd removed the mutable default value, but did not explicitly
tested for None. Such implicit checking can introduce semantic and performance
issue. We move to an explicit check for None as recommended by PEP8:
https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:38:02 -0700] rev 31464
context: simplify call to icase matcher in 'match()'
The two function takes the very same arguments. We make this clearer and less
error prone by dispatching on the function only and having a single call point
in the code.
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 16 Mar 2017 09:13:13 +0530] rev 31463
py3: make sure using bytes status char rather than ascii values
'MAR!?IC' is converted to their ascii values when slicing through it. This
patch uses pycompat.iterbytestr() to get bytes value.
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:27:41 -0700] rev 31462
shelve: get rid of ui.backupconfig
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:40:34 -0700] rev 31461
rebase: get rid of ui.backupconfig
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:39:18 -0700] rev 31460
mq: get rid of ui.backupconfig
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:36:35 -0700] rev 31459
histedit: get rid of ui.backupconfig
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:34:35 -0700] rev 31458
record: get rid of ui.backupconfig
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:23:49 -0700] rev 31457
import: get rid of ui.backupconfig
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:18:50 -0700] rev 31456
clone: get rid of ui.backupconfig
Jun Wu <quark@fb.com> [Thu, 16 Mar 2017 14:15:20 -0700] rev 31455
commit: get rid of ui.backupconfig
Durham Goode <durham@fb.com> [Wed, 15 Mar 2017 15:48:57 -0700] rev 31454
branchmap: handle nullrev in setcachedata
906be86990 recently changed to switch from:
self._rbcrevs[rbcrevidx:rbcrevidx + _rbcrecsize] = rec
to
pack_into(_rbcrecfmt, self._rbcrevs, rbcrevidx, node, branchidx)
This causes an exception if rbcrevidx is -1 (i.e. the nullrev). The old code
handled this because python handles out of bound sets to arrays gracefully. The
new code throws because the self._rbcrevs buffer isn't long enough to write 8
bytes to. Normally it would've been resized by the immediately preceding line,
but because the 0 length buffer is greater than the idx (-1) times the size, no
resize happens.
Setting the branch for the nullrev doesn't make sense anyway, so let's skip it.
This was caught by external tests in the Facebook extensions repo, but I've
added a test here that catches the issue.
Yuya Nishihara <yuya@tcha.org> [Wed, 15 Mar 2017 23:28:39 +0900] rev 31453
py3: call codecs.escape_encode() directly
string_escape doesn't exist on Python 3, but fortunately the undocumented
codecs.escape_encode() function exists on CPython 2.6, 2.7, 3.5 and PyPy 5.6.
So let's use it for now.
http://stackoverflow.com/a/
23151714
Yuya Nishihara <yuya@tcha.org> [Wed, 15 Mar 2017 23:21:30 +0900] rev 31452
templatekw: make join() escape values of extras (BC) (
issue5504)
Since extras may contain blob, the default template escapes its values:
'extra': '{key}={value|stringescape}'
join() should follow the output style of the default template.
Yuya Nishihara <yuya@tcha.org> [Wed, 15 Mar 2017 23:06:50 +0900] rev 31451
util: wrap s.encode('string_escape') call for future py3 compatibility
Yuya Nishihara <yuya@tcha.org> [Mon, 13 Mar 2017 09:24:53 -0700] rev 31450
py3: prove hg tip works
Yuya Nishihara <yuya@tcha.org> [Mon, 13 Mar 2017 09:19:07 -0700] rev 31449
py3: call strftime() with native str type
Since strftime() may contain non-ascii character if locale set, we use
strfrom/tolocal().
Now "hg tip" works.
Yuya Nishihara <yuya@tcha.org> [Mon, 13 Mar 2017 09:12:56 -0700] rev 31448
encoding: add converter between native str and byte string
This kind of encoding conversion is unavoidable on Python 3.
Yuya Nishihara <yuya@tcha.org> [Mon, 13 Mar 2017 09:11:08 -0700] rev 31447
encoding: factor out unicode variants of from/tolocal()
Unfortunately, these functions will be commonly used on Python 3.
Yuya Nishihara <yuya@tcha.org> [Mon, 13 Mar 2017 08:53:31 -0700] rev 31446
py3: use next() to obtain next item from inner generator of generatorset
.next attribute does not exist on Python 3. As this function seems to really
care about the overhead of the Python interpreter, I follow the way of micro
optimization.
Yuya Nishihara <yuya@tcha.org> [Mon, 13 Mar 2017 08:44:57 -0700] rev 31445
py3: rewrite itervalues() as values() by importer
I'm not a great fan of these importer magics, but this should be okay since
"itervalues" seems as unique name as "iteritems".
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 17:20:42 -0700] rev 31444
py3: use portable way to stringify cache key of repoview