Thu, 03 May 2018 11:53:56 +0900 templater: add function to look up symbols used in template
Yuya Nishihara <yuya@tcha.org> [Thu, 03 May 2018 11:53:56 +0900] rev 38355
templater: add function to look up symbols used in template Formatter can use this information to enable slow paths such as loading ctx object only when necessary.
Thu, 03 May 2018 11:17:52 +0900 templater: parse template string to tree by templater class
Yuya Nishihara <yuya@tcha.org> [Thu, 03 May 2018 11:17:52 +0900] rev 38354
templater: parse template string to tree by templater class The parsed tree could be cached, but it isn't for now. We can add a cache later if that matters.
Thu, 03 May 2018 10:58:56 +0900 templater: drop extension point of engine classes (API)
Yuya Nishihara <yuya@tcha.org> [Thu, 03 May 2018 10:58:56 +0900] rev 38353
templater: drop extension point of engine classes (API) I don't think this would ever be used by third-party extensions, as we've heavily changed both the templater internals and the syntax since then. The main reason of removing this API is that I want to move the parsing function from the engine to the templater class so that we can peek keywords and functions used in a user template. This change also removes reference cycle between the templater and the engine.
Thu, 03 May 2018 11:09:27 +0900 templater: make it clearer that parsing doesn't cause recursion
Yuya Nishihara <yuya@tcha.org> [Thu, 03 May 2018 11:09:27 +0900] rev 38352
templater: make it clearer that parsing doesn't cause recursion Only compileexp() may recurse into _load().
Thu, 03 May 2018 10:53:29 +0900 templater: mark most attributes as private
Yuya Nishihara <yuya@tcha.org> [Thu, 03 May 2018 10:53:29 +0900] rev 38351
templater: mark most attributes as private
Sun, 17 Jun 2018 06:23:29 -0700 setdiscovery: use progress helper
Martin von Zweigbergk <martinvonz@google.com> [Sun, 17 Jun 2018 06:23:29 -0700] rev 38350
setdiscovery: use progress helper Differential Revision: https://phab.mercurial-scm.org/D3770
Sat, 16 Jun 2018 00:37:44 -0700 streamclone: use progress helper
Martin von Zweigbergk <martinvonz@google.com> [Sat, 16 Jun 2018 00:37:44 -0700] rev 38349
streamclone: use progress helper Differential Revision: https://phab.mercurial-scm.org/D3769
Sat, 16 Jun 2018 00:25:13 -0700 similar: use progress helper
Martin von Zweigbergk <martinvonz@google.com> [Sat, 16 Jun 2018 00:25:13 -0700] rev 38348
similar: use progress helper Note that a functional change here is that we now show the progress position *before* we start working on the item. This is consistent with how we do it elsewhere. Differential Revision: https://phab.mercurial-scm.org/D3768
Sat, 16 Jun 2018 00:03:23 -0700 remove: use progress helper
Martin von Zweigbergk <martinvonz@google.com> [Sat, 16 Jun 2018 00:03:23 -0700] rev 38347
remove: use progress helper Differential Revision: https://phab.mercurial-scm.org/D3767
Fri, 15 Jun 2018 23:04:44 -0700 changegroup: use progress helper in apply() (API)
Martin von Zweigbergk <martinvonz@google.com> [Fri, 15 Jun 2018 23:04:44 -0700] rev 38346
changegroup: use progress helper in apply() (API) Differential Revision: https://phab.mercurial-scm.org/D3766
Fri, 15 Jun 2018 22:37:01 -0700 progress: create helper class for incrementing progress
Martin von Zweigbergk <martinvonz@google.com> [Fri, 15 Jun 2018 22:37:01 -0700] rev 38345
progress: create helper class for incrementing progress When using ui.progress(), there's a clear pattern that is followed: * Pass the same topic and unit * Usually pass the same total * Call with pos=None to close the progress bar * Often keep track of the current position and increment it This patch creates a simple helper class for this. I'll probably make it implement the context manager protocol later (calling update(None) on __exit__). Progress is used in low-level modules like changegroup, so I also exposed it via a method on the ui object. Perhaps the class itself should also live in ui.py? This patch also makes merge.oy use it to show that it works. Differential Revision: https://phab.mercurial-scm.org/D3765
Sun, 17 Jun 2018 18:01:49 +0900 extensions: use context manger for open()
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Jun 2018 18:01:49 +0900] rev 38344
extensions: use context manger for open()
Sun, 17 Jun 2018 17:59:12 +0900 py3: open extension source in binary mode to read docstring as bytes
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Jun 2018 17:59:12 +0900] rev 38343
py3: open extension source in binary mode to read docstring as bytes
Wed, 13 Jun 2018 16:22:54 +0530 grep: adds allfiles mode
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com> [Wed, 13 Jun 2018 16:22:54 +0530] rev 38342
grep: adds allfiles mode Adds an allfiles flag that lets you grep on all files in the revision and not just the one that were modified in that changeset. This would work on a single revision and get all the files that were there in that revision. So it's like grepping on a previous state. Using this with wdir() :: `hg grep -r "wdir()" --allfiles` is what the default behavior is desired for grep. Support for multiple revisions to be added later. Differential Revision: https://phab.mercurial-scm.org/D3728
Wed, 13 Jun 2018 22:50:32 +0530 morestatus: remove some extra spaces
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 13 Jun 2018 22:50:32 +0530] rev 38341
morestatus: remove some extra spaces The information about unfinished states in `hg status -v` had a lot of spaces which are not required and feels weird. Let's limit the spacing to four spaces. Differential Revision: https://phab.mercurial-scm.org/D3730
Fri, 15 Jun 2018 16:32:31 -0700 graph: improve graph output by using Unicode characters
John Stiles <johnstiles@gmail.com> [Fri, 15 Jun 2018 16:32:31 -0700] rev 38340
graph: improve graph output by using Unicode characters This extension beautifies log -G output by using Unicode characters. A terminal with UTF-8 support and a monospace Unicode font are required. Differential Revision: https://phab.mercurial-scm.org/D3665
Sat, 16 Jun 2018 17:07:47 -0400 py3: whitelist another 5 passing tests thanks to the ratchet
Augie Fackler <augie@google.com> [Sat, 16 Jun 2018 17:07:47 -0400] rev 38339
py3: whitelist another 5 passing tests thanks to the ratchet Differential Revision: https://phab.mercurial-scm.org/D3762
Mon, 28 May 2018 16:55:11 +0200 shelve: wider check for successful abort in test
Boris Feld <boris.feld@octobus.net> [Mon, 28 May 2018 16:55:11 +0200] rev 38338
shelve: wider check for successful abort in test The test was previously focusing on checking that the "sub-rebase" aborted properly. Since rebase is an implementation details we should also check for other messages. Differential Revision: https://phab.mercurial-scm.org/D3686
Tue, 29 May 2018 18:01:35 +0200 shelve: use full hash in tests
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 18:01:35 +0200] rev 38337
shelve: use full hash in tests Using revision number is fragile. Moving to full hash to help with further development. Differential Revision: https://phab.mercurial-scm.org/D3685
Thu, 14 Jun 2018 12:35:04 -0400 phabricator: preserve the phase when amending in the Differential fields
Matt Harbison <matt_harbison@yahoo.com> [Thu, 14 Jun 2018 12:35:04 -0400] rev 38336
phabricator: preserve the phase when amending in the Differential fields I have no idea if it's better to change scmutil.cleanupnodes() so that it has the option to either apply a specific phase (e.g. for various --secret switches) or carry over the phase of the old node. The benefit would be that the caller doesn't have to remember to do this. The con is maybe inefficiency? I wrote this up as issue5918. I'm leaving that open since Yuya flagged it as an API bug. Since most other callers already do this, it's the simplest fix. (It's not obvious that `split`, `fix` and `rebase` are doing this, but there is test coverage for `fix` and `rebase`, and experimenting with `split` shows it does the right thing.)
Fri, 15 Jun 2018 22:16:58 +0900 manifest: fix possible SEGV caused by uninitialized lazymanifest fields stable
Yuya Nishihara <yuya@tcha.org> [Fri, 15 Jun 2018 22:16:58 +0900] rev 38335
manifest: fix possible SEGV caused by uninitialized lazymanifest fields Before, uninitialized self->pydata would be passed to lazymanifest_dealloc() on OOM, and Py_DECREF(self->pydata) would crash if we were unlucky. It's still wrong to do malloc() thingy in tp_init because __init__() may be called more than once [1], but I don't want to go a step further in stable branch. [1]: https://docs.python.org/2/c-api/typeobj.html#c.PyTypeObject.tp_new "The tp_new function should ... do only as much further initialization as is absolutely necessary. Initialization that can safely be ignored or repeated should be placed in the tp_init handler."
Fri, 15 Jun 2018 10:14:32 -0400 tests: replace `echo -n` with `printf` per check-code stable
Augie Fackler <augie@google.com> [Fri, 15 Jun 2018 10:14:32 -0400] rev 38334
tests: replace `echo -n` with `printf` per check-code Differential Revision: https://phab.mercurial-scm.org/D3749
Thu, 14 Jun 2018 14:04:26 -0700 crecord: fix line number in hunk header (issue5917) stable
Jun Wu <quark@fb.com> [Thu, 14 Jun 2018 14:04:26 -0700] rev 38333
crecord: fix line number in hunk header (issue5917) `@@ -1,1 +-1,0 @@` is not a valid patch hunk header. Change it to `@@ -1,1 +0,0 @@`. Differential Revision: https://phab.mercurial-scm.org/D3737
Sat, 16 Jun 2018 19:31:07 +0900 py3: ditch email.parser.BytesParser which appears to be plain crap
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 19:31:07 +0900] rev 38332
py3: ditch email.parser.BytesParser which appears to be plain crap As I said before, BytesParser is a thin wrapper over the unicode Parser, and it's too thin to return bytes back. Today, I found it does normalize newline characters to '\n's thanks to the careless use of TextIOWrapper. So, this patch replaces BytesParser with Parser + TextIOWrapper, and fix newline handling. Since I don't know what's the least bad encoding strategy here, I just copied it from BytesParser. I've moved new parse() function from pycompat, as it is no longer a trivial wrapper.
Sat, 16 Jun 2018 17:56:37 +0900 py3: remove b'' from error message of disallowed filename
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 17:56:37 +0900] rev 38331
py3: remove b'' from error message of disallowed filename
Sat, 16 Jun 2018 17:54:29 +0900 py3: remove b'' from output of test-eol.t
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 17:54:29 +0900] rev 38330
py3: remove b'' from output of test-eol.t
Sat, 16 Jun 2018 17:53:51 +0900 py3: replace s[-1] with s.endswith() in eol handling
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 17:53:51 +0900] rev 38329
py3: replace s[-1] with s.endswith() in eol handling
Sat, 16 Jun 2018 17:36:44 +0900 py3: fix loop over byte string in wireprotov1peer
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 17:36:44 +0900] rev 38328
py3: fix loop over byte string in wireprotov1peer Before, it would always return [True]s on Python 3 because list(b"0") == [48].
Sat, 16 Jun 2018 17:04:03 +0900 py3: glob out some error messages in test-fileset.t
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 17:04:03 +0900] rev 38327
py3: glob out some error messages in test-fileset.t Python3 provides more detailed messages, which is fine.
Sat, 16 Jun 2018 17:00:05 +0900 fileset: raise ProgrammingError for bad existing() calls
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 17:00:05 +0900] rev 38326
fileset: raise ProgrammingError for bad existing() calls And glob out Py2/3 difference.
Sat, 16 Jun 2018 16:56:38 +0900 py3: cast bytes encoding name to str in fileset.py
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 16:56:38 +0900] rev 38325
py3: cast bytes encoding name to str in fileset.py
Thu, 14 Jun 2018 15:12:28 -0700 import: use context manager for wlock
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:12:28 -0700] rev 38324
import: use context manager for wlock Differential Revision: https://phab.mercurial-scm.org/D3747
Thu, 14 Jun 2018 15:08:32 -0700 tag: use context manager for locks
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:08:32 -0700] rev 38323
tag: use context manager for locks Differential Revision: https://phab.mercurial-scm.org/D3746
Thu, 14 Jun 2018 15:05:14 -0700 commit: use context manager for locks
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:05:14 -0700] rev 38322
commit: use context manager for locks Differential Revision: https://phab.mercurial-scm.org/D3745
Thu, 14 Jun 2018 15:08:19 -0700 backout: use context manager for locks
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:08:19 -0700] rev 38321
backout: use context manager for locks Differential Revision: https://phab.mercurial-scm.org/D3744
Thu, 14 Jun 2018 15:28:32 -0700 backout: use context manager for dirstateguard
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:28:32 -0700] rev 38320
backout: use context manager for dirstateguard Differential Revision: https://phab.mercurial-scm.org/D3743
Thu, 14 Jun 2018 15:26:18 -0700 backout: use context manager for config override
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:26:18 -0700] rev 38319
backout: use context manager for config override Differential Revision: https://phab.mercurial-scm.org/D3742
Thu, 14 Jun 2018 15:46:31 -0700 update: use context manager for config override (API)
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:46:31 -0700] rev 38318
update: use context manager for config override (API) Note that update wasn't resetting the value before, so any extensions that called commands.update() and relied on ui.forcemerge being set after it returned would now have to set it themselves. (There technically a small API change in all of the patches in this series, I believe: If extensions relied on the methods to *clear* ui.forcemerge, then they would have to do that themselves now, because ui.configoverride() actually restores the previous config, it doesn't just clear it like these functions did before.) Differential Revision: https://phab.mercurial-scm.org/D3741
Thu, 14 Jun 2018 15:46:17 -0700 resolve: use context manager for config override
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:46:17 -0700] rev 38317
resolve: use context manager for config override Differential Revision: https://phab.mercurial-scm.org/D3740
Thu, 14 Jun 2018 15:45:45 -0700 merge: use context manager for config override
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:45:45 -0700] rev 38316
merge: use context manager for config override Differential Revision: https://phab.mercurial-scm.org/D3739
Thu, 14 Jun 2018 15:45:16 -0700 graft: use context manager for config override
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jun 2018 15:45:16 -0700] rev 38315
graft: use context manager for config override Differential Revision: https://phab.mercurial-scm.org/D3738
Thu, 14 Jun 2018 11:49:10 -0400 tests: suppress read(-1) -> '' calls in fileobjectobserver
Augie Fackler <augie@google.com> [Thu, 14 Jun 2018 11:49:10 -0400] rev 38314
tests: suppress read(-1) -> '' calls in fileobjectobserver This stabilizes the test output of the low-level wireproto tests between Python 2 and 3. I don't feel great about this change, but otherwise we get a ton of extra read(-1) output on Python 3, and this feels like a more sustainable solution. Bonus: test-ssh-proto-unbundle.t now passes on Python 3. Differential Revision: https://phab.mercurial-scm.org/D3733
Thu, 14 Jun 2018 11:47:51 -0400 debugcommands: work around logiofd being a pipe and unseekable
Augie Fackler <augie@google.com> [Thu, 14 Jun 2018 11:47:51 -0400] rev 38313
debugcommands: work around logiofd being a pipe and unseekable This was breaking in our Python 3 build, but not Python 2. I don't know how it ever worked in Python 2, but this passes on both. Differential Revision: https://phab.mercurial-scm.org/D3732
Wed, 13 Jun 2018 22:51:08 +0530 py3: replace `unicode` with pycompat.unicode
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 13 Jun 2018 22:51:08 +0530] rev 38312
py3: replace `unicode` with pycompat.unicode unicode() is not available on Python 3 and throws a NameError because unicodes are now default str() on py3. Differential Revision: https://phab.mercurial-scm.org/D3708
Fri, 15 Jun 2018 02:07:39 +0530 cmdutil: say that `graft --stop` stops the graft instead of aborting
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 15 Jun 2018 02:07:39 +0530] rev 38311
cmdutil: say that `graft --stop` stops the graft instead of aborting I am going to add a --abort flag to graft soon, so we make sure we differentiate between the what --stop flag does and what --abort does and don't use the words interchangeably. Differential Revision: https://phab.mercurial-scm.org/D3735
Thu, 14 Jun 2018 16:51:39 -0400 py3: two more passing tests from the ratchet in buildbot
Augie Fackler <augie@google.com> [Thu, 14 Jun 2018 16:51:39 -0400] rev 38310
py3: two more passing tests from the ratchet in buildbot Differential Revision: https://phab.mercurial-scm.org/D3736
Thu, 14 Jun 2018 20:25:51 +0900 bdiff: one more safe call of bdiff_freehunks(NULL)
Yuya Nishihara <yuya@tcha.org> [Thu, 14 Jun 2018 20:25:51 +0900] rev 38309
bdiff: one more safe call of bdiff_freehunks(NULL)
Thu, 14 Jun 2018 20:25:16 +0900 bdiff: document that bdiff_freehunks() accepts NULL
Yuya Nishihara <yuya@tcha.org> [Thu, 14 Jun 2018 20:25:16 +0900] rev 38308
bdiff: document that bdiff_freehunks() accepts NULL blocks() of cext/bdiff.c may pass NULL on OOM.
Thu, 14 Jun 2018 13:44:42 +0200 hgweb: propagate http headers from ErrorResponse for web interface commands
Sune Foldager <cryo@cyanite.org> [Thu, 14 Jun 2018 13:44:42 +0200] rev 38307
hgweb: propagate http headers from ErrorResponse for web interface commands This makes it possible for e.g. authorization hooks to provide appropriate headers to make the web browser ask for credentials. It's done in the same way as the existing code in wireprotoserver.py.
Thu, 14 Jun 2018 20:29:27 +0900 py3: fix map() use in templatekw.showpredecessors()
Yuya Nishihara <yuya@tcha.org> [Thu, 14 Jun 2018 20:29:27 +0900] rev 38306
py3: fix map() use in templatekw.showpredecessors() Now it matters since hybrid.tobool() no longer consumes the generator.
Thu, 14 Jun 2018 20:09:54 +0900 merge with stable
Yuya Nishihara <yuya@tcha.org> [Thu, 14 Jun 2018 20:09:54 +0900] rev 38305
merge with stable
Wed, 13 Jun 2018 14:28:39 -0700 templatefilters: rename commonprefix to commondir
Martin von Zweigbergk <martinvonz@google.com> [Wed, 13 Jun 2018 14:28:39 -0700] rev 38304
templatefilters: rename commonprefix to commondir Two reasons: * It makes it clearer that it's not a generic common string prefix (e.g. commonprefix(["bar", "baz"]) is not "ba", but "") * If we ever want a filter for generic common string prefix, then the name is now available for that. "commondir" does not describe the prefix-ness, however. I'm happy to rename it "commondirprefix" or "commonprefixdir" if others prefer. Differential Revision: https://phab.mercurial-scm.org/D3731
Wed, 13 Jun 2018 10:24:44 -0400 bitmanipulation: fix undefined behavior in bit shift in getbe32
Augie Fackler <augie@google.com> [Wed, 13 Jun 2018 10:24:44 -0400] rev 38303
bitmanipulation: fix undefined behavior in bit shift in getbe32 OSS-Fuzz caught this in its ubsan mode[0]. I'm not worried about a security issue here because in practice this should work out the way we naively expected, we're just making things explicit to the compiler with the casts. 0: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8876 Differential Revision: https://phab.mercurial-scm.org/D3729
Wed, 13 Jun 2018 10:41:20 -0400 lazymanifest: don't crash when out of memory (issue5916) stable
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Wed, 13 Jun 2018 10:41:20 -0400] rev 38302
lazymanifest: don't crash when out of memory (issue5916) self->lines can be NULL if we failed to allocate memory for it.
Wed, 13 Jun 2018 10:37:39 -0400 cext: stop worrying and love the free(NULL) stable
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Wed, 13 Jun 2018 10:37:39 -0400] rev 38301
cext: stop worrying and love the free(NULL) There is no need to check for a NULL pointer before calling free since free(NULL) is defined by C standards as a no-op. Lots of software relies on this behavior so it is completely safe to call even on the most obscure of systems.
Wed, 13 Jun 2018 21:58:42 +0900 templatefilters: undeprecate hgdate
Yuya Nishihara <yuya@tcha.org> [Wed, 13 Jun 2018 21:58:42 +0900] rev 38300
templatefilters: undeprecate hgdate See the previous patch for why. Backed out changeset 0fe65bb7e160
Wed, 13 Jun 2018 21:57:24 +0900 templater: restore the original string format of {date}
Yuya Nishihara <yuya@tcha.org> [Wed, 13 Jun 2018 21:57:24 +0900] rev 38299
templater: restore the original string format of {date} Unfortunately, python-hglib relies on that. I could fix python-hglib, but there would be other tools that take a decimal separator as the separator of unixtime and tzoffset. The showfmt is set per instance since new code uses '%d %d' format by default.
Tue, 12 Jun 2018 20:43:56 -0400 hgweb: insist http_status value is a sysstr
Augie Fackler <augie@google.com> [Tue, 12 Jun 2018 20:43:56 -0400] rev 38298
hgweb: insist http_status value is a sysstr My previous change was extremely confusing to figure out, because I thought I was looking at a client-side problem. For the low cost of an isinstance assert, we can make those errors not happen in the future. Differential Revision: https://phab.mercurial-scm.org/D3727
Tue, 12 Jun 2018 20:42:42 -0400 hgweb: pass a sysstr to low-level _start_response method
Augie Fackler <augie@google.com> [Tue, 12 Jun 2018 20:42:42 -0400] rev 38297
hgweb: pass a sysstr to low-level _start_response method This fixes a regression in Python 3 support introduced in 7de7bd407251 on the stable branch. We're so early in do_hgweb that I don't see any especially better choices than this. Differential Revision: https://phab.mercurial-scm.org/D3726
Tue, 12 Jun 2018 18:49:35 -0400 tests: fix printenv script on Python 3
Augie Fackler <augie@google.com> [Tue, 12 Jun 2018 18:49:35 -0400] rev 38296
tests: fix printenv script on Python 3 Differential Revision: https://phab.mercurial-scm.org/D3725
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 +3000 +10000 tip