Sun, 18 Mar 2018 21:46:20 +0900 hgweb: fix {diff} expansion in JSON template
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 21:46:20 +0900] rev 37402
hgweb: fix {diff} expansion in JSON template The same sort of bug as the previous patch. In this case, I decided to fix the JSON template since we aren't ready to fix the {diff} keyword without BC. I'll rework it later.
Sun, 18 Mar 2018 21:35:43 +0900 hgweb: fix summary {tags} and {shortlog} to not forcibly expand template
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 21:35:43 +0900] rev 37401
hgweb: fix summary {tags} and {shortlog} to not forcibly expand template The same sort of bug as the previous patch. In this case, JSON template was wrong.
Sun, 18 Mar 2018 20:51:39 +0900 hgweb: fix search {entries} to not return results of template expansion
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 20:51:39 +0900] rev 37400
hgweb: fix search {entries} to not return results of template expansion "{entries%changelogentry}" in raw/search.tmpl was utterly wrong because "{entries}" here was a generator yielding results of template expansion. That's why we have a weird hack in runmap(), which I'm going to get rid of. https://www.mercurial-scm.org/repo/hg/file/4.5.2/mercurial/templater.py#l469 We have two choices: a) drop "%changelogentry" from raw/search.tmpl b) fix "{entries}" to yield mappings I take (b) because that's what the other log-like "{entries}" do. The "entries" keyword is wrapped by mappinggenerator so "{entries}" without "%searchentry" still works.
Sat, 17 Mar 2018 22:47:02 +0900 templater: add class representing a nested mappings
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 22:47:02 +0900] rev 37399
templater: add class representing a nested mappings The mappinggenerator class is necessary to fix hgweb bugs without BC. The mappinglist is for nested formatter items. They are similar, so factored out the base class. The mappinglist could be implemented by using the mappinggenerator, but we'll probably need a direct access to the raw list, so they are implemented as separate classes. Note that tovalue() isn't conforming to the spec yet in that it may return a list of dicts containing unprintable resources. This problem will be fixed later. Tests will be added by subsequent patches.
Sat, 17 Mar 2018 22:56:49 +0900 templater: add function that expands internal literal templates
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 22:56:49 +0900] rev 37398
templater: add function that expands internal literal templates This will be used when rendering nested formatter items with the default template, e.g. fm.nested('parents', tmpl='{rev}:{node|formatnode}', sep=' ') ^^^^^^^^^^^^^^^^^^^^^^^ the default item template
Fri, 06 Apr 2018 11:28:26 -0700 bookmarks: use isrevsymbol() for detecting collision with existing symbol
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 11:28:26 -0700] rev 37397
bookmarks: use isrevsymbol() for detecting collision with existing symbol Differential Revision: https://phab.mercurial-scm.org/D3167
Fri, 06 Apr 2018 11:26:50 -0700 debugwhyunstable: add support for revsets
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 11:26:50 -0700] rev 37396
debugwhyunstable: add support for revsets Differential Revision: https://phab.mercurial-scm.org/D3166
Fri, 06 Apr 2018 10:46:24 -0700 convert: look up branch only among branches
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 10:46:24 -0700] rev 37395
convert: look up branch only among branches repo[<branch name>] can find something that's not a branch, which is not good. Differential Revision: https://phab.mercurial-scm.org/D3161
Thu, 05 Apr 2018 16:10:52 -0700 convert: remove unused/unnecessary variable "parentctx"
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 16:10:52 -0700] rev 37394
convert: remove unused/unnecessary variable "parentctx" Differential Revision: https://phab.mercurial-scm.org/D3160
Sat, 24 Mar 2018 17:57:22 +0100 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de> [Sat, 24 Mar 2018 17:57:22 +0100] rev 37393
wireproto: provide accessors for client capabilities For HTTP, this refactors the existing logic, including the parsing of the compression engine capability. For SSH, this adds a ssh-only capability "protocaps" and a command for informing the server on what the client supports. Since SSH is stateful, keep track of the capabilities in the server instance. Differential Revision: https://phab.mercurial-scm.org/D1944
Thu, 05 Apr 2018 17:51:10 +0200 copies: clean up _related logic
Gábor Stefanik <gabor.stefanik@nng.com> [Thu, 05 Apr 2018 17:51:10 +0200] rev 37392
copies: clean up _related logic The limit parameter was never actually used, since the only way the 4th case could be reached was if f1r and f2r converged. The new code makes this clear, and additionally reduces the conditional block to just 3 cases.
Fri, 06 Apr 2018 09:34:44 -0700 context: stop catching RepoLookupError from namespace.singlenode()
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 09:34:44 -0700] rev 37391
context: stop catching RepoLookupError from namespace.singlenode() As pointed out by Yuya, the RepoLookupError was there for catching errors from repo.branchtip(). However, since 885c0290f7d5 (localrepo: add ignoremissing parameter to branchtip, 2014-10-16), that should no longer happen. I think it should now be an error if a namespace raises a RepoLookupError, so we propagate the exception up and and make it easy to fix, rather than trying to interpret the changeid as nodeid prefix and raise a general "unknown revision '...'" error. I also don't think we should catch FilteredLookupError and LookupError from the changelog.rev() call, for the same reason as above: If a namespace returns a node that doesn't exist, we should provide a more helpful exception than "unknown revision '...'". Differential Revision: https://phab.mercurial-scm.org/D3145
Thu, 05 Apr 2018 18:02:42 +0200 histedit: simplify desthistedit
Boris Feld <boris.feld@octobus.net> [Thu, 05 Apr 2018 18:02:42 +0200] rev 37390
histedit: simplify desthistedit Instead of sorting the revset and take the first one, take the minimum revision. Differential Revision: https://phab.mercurial-scm.org/D3137
Thu, 05 Apr 2018 17:58:58 +0200 stack: follow-up on the stack revset
Boris Feld <boris.feld@octobus.net> [Thu, 05 Apr 2018 17:58:58 +0200] rev 37389
stack: follow-up on the stack revset Follow good-practice for defining the stack revset. Differential Revision: https://phab.mercurial-scm.org/D3136
Thu, 05 Apr 2018 23:23:48 -0700 githelp: use revsymbol() for looking up symbol
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 23:23:48 -0700] rev 37388
githelp: use revsymbol() for looking up symbol I don't know if we should be using revsingle() here, so I was conservative and switched to revsymbol(). Differential Revision: https://phab.mercurial-scm.org/D3156
Thu, 05 Apr 2018 21:32:59 -0700 hgweb: use revsymbol() to determine if query is a revision
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 21:32:59 -0700] rev 37387
hgweb: use revsymbol() to determine if query is a revision repo.__getitem__ is about to get dumber. Differential Revision: https://phab.mercurial-scm.org/D3155
Thu, 05 Apr 2018 14:03:33 -0700 context: make repo[<filtered binary nodeid>] match node
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 14:03:33 -0700] rev 37386
context: make repo[<filtered binary nodeid>] match node If you pass in a binary nodeid of a filtered node to repo.__getitem__, it would run through this code: try: self._node = changeid self._rev = repo.changelog.rev(changeid) return except error.FilteredLookupError: raise except LookupError: pass However, repo.changelog.rev() would raise a FilteredLookupError, not FilteredRepoLookupError. Instead, we would hit the "except LookupError" and continue, trying to interpret the nodeid as a bookmark etc. The end result would be an error like this: abort: unknown revision 'ddadbd7c40ef8b8ad6d0d01a7a842092fc431798'! After this patch, it would instead be: abort: 00changelog.i@ddadbd7c40ef8b8ad6d0d01a7a842092fc431798: filtered node! This only happens when we get a binary nodeid, which means it's not string directly from the user, so it would be a programming error if it happened. It's therefore a little hard to test (I checked test-context.py, but it doesn't use obsmarkers). It looks like this has been wrong ever since dc25ed84bee8 (changectx: issue a FilteredRepoLookupError when applicable, 2014-10-15). Differential Revision: https://phab.mercurial-scm.org/D3144
Thu, 05 Apr 2018 00:04:09 -0700 context: move handling of filtering error to revsymbol() (API)
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 00:04:09 -0700] rev 37385
context: move handling of filtering error to revsymbol() (API) When changectx's constructor runs into various Filtered*Error, it creates an exception with a hint about using --hidden. This only makes sense when the revision was provided by the user (if we get e.g. a FilteredLookupError from repo[p1], then it's instead a programming error). Thus, I'm moving the handling into revsymbol(). Also changed "unfilteredrepo[changeid]" to "revsymbol(unfilteredrepo, changeid)" as part of the move. Differential Revision: https://phab.mercurial-scm.org/D3143
Thu, 05 Apr 2018 17:56:24 +0530 py3: whitelist 13 new passing tests
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:56:24 +0530] rev 37384
py3: whitelist 13 new passing tests Some tests were passing before the series too. Differential Revision: https://phab.mercurial-scm.org/D3133
Thu, 05 Apr 2018 16:47:44 +0530 py3: convert user value to bytes by b'' prefix
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:47:44 +0530] rev 37383
py3: convert user value to bytes by b'' prefix This makes test-journal* pass on Python 3.5. # skip-blame beacuse just b'' prefix Differential Revision: https://phab.mercurial-scm.org/D3125
Thu, 05 Apr 2018 10:13:01 -0400 util: whitelist apfs for hardlink support
Augie Fackler <augie@google.com> [Thu, 05 Apr 2018 10:13:01 -0400] rev 37382
util: whitelist apfs for hardlink support Seems to work fine for me. Differential Revision: https://phab.mercurial-scm.org/D3134
Thu, 05 Apr 2018 11:33:36 -0700 mq: avoid a silly conversion from binary nodeid to hex
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 11:33:36 -0700] rev 37381
mq: avoid a silly conversion from binary nodeid to hex We generally deal with binary nodeids in code. In this case the hex nodeid was passed to strip.checksubstate() where it was passed to repo.__getitem__, which of course accepts a binary nodeid. Differential Revision: https://phab.mercurial-scm.org/D3141
Thu, 05 Apr 2018 12:36:44 -0700 narrow: remove unused "cacheprop" stuff
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 12:36:44 -0700] rev 37380
narrow: remove unused "cacheprop" stuff This is unused since D3046. I didn't even notice it then, but tests still pass so I hope it's still handled safely. Differential Revision: https://phab.mercurial-scm.org/D3142
Tue, 03 Apr 2018 14:11:43 -0700 tests: disable infinitepush tests for simple store
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 14:11:43 -0700] rev 37379
tests: disable infinitepush tests for simple store Infinitepush relies heavily on bundles and bundlerepo. As such, it won't be easy to make compatible with alternate storage backends at this time. Let's disable the tests when running with our simple store. Differential Revision: https://phab.mercurial-scm.org/D3062
Thu, 05 Apr 2018 11:01:42 -0700 rebase: remove unnecessary and incorrect handling of nullid
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 11:01:42 -0700] rev 37378
rebase: remove unnecessary and incorrect handling of nullid We used to write a nullid as hex to the rebase state file and interpret it as the "todo" state (value -1). However, when reading it, we compared the string value to (binary) nullid, which would of course not match. AFAICT, it still worked because when the read nodeid did not match nullid (which, again, it didn't), we'd use the normal path which did repo[<hex nullid>].rev(), and that also happens to return -1. It seems to have been this way ever since 9972758ab4c5 (rebase: handle revtodo as a special value when storing/restoring state, 2014-12-02). Differential Revision: https://phab.mercurial-scm.org/D3140
Thu, 05 Apr 2018 10:13:45 -0700 rebase: convert "oldrev" to revnum earlier
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 10:13:45 -0700] rev 37377
rebase: convert "oldrev" to revnum earlier It was done in 3 places before, now just 1. Differential Revision: https://phab.mercurial-scm.org/D3139
Thu, 05 Apr 2018 10:12:10 -0700 rebase: make "destnode" consistently a revnum and rename it to "destrev"
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 10:12:10 -0700] rev 37376
rebase: make "destnode" consistently a revnum and rename it to "destrev" Differential Revision: https://phab.mercurial-scm.org/D3138
Thu, 05 Apr 2018 08:28:12 -0700 bookmarks: drop always-None argument from calculateupdate()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 08:28:12 -0700] rev 37375
bookmarks: drop always-None argument from calculateupdate() Thanks to Yuya for noticing. Differential Revision: https://phab.mercurial-scm.org/D3135
Tue, 03 Apr 2018 09:58:16 -0700 narrow: move manifestlog overrides to core
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 09:58:16 -0700] rev 37374
narrow: move manifestlog overrides to core With this and the previous patch, I couldn't measure any significant difference from `hg files -r .` in a FireFox repo with 65k files. I tried with both a flat-manifest and a tree-manifest version of it. Neither had the narrow extension enabled. Differential Revision: https://phab.mercurial-scm.org/D3046
Mon, 02 Apr 2018 23:46:04 -0700 narrow: move manifestrevlog overrides to core
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 23:46:04 -0700] rev 37373
narrow: move manifestrevlog overrides to core Differential Revision: https://phab.mercurial-scm.org/D3045
Tue, 03 Apr 2018 00:13:02 -0700 narrow: move excludeddir and related classes to core
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 00:13:02 -0700] rev 37372
narrow: move excludeddir and related classes to core Differential Revision: https://phab.mercurial-scm.org/D3044
Thu, 05 Apr 2018 17:29:32 +0530 py3: add missing b'' prefix in mdiff.py
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:29:32 +0530] rev 37371
py3: add missing b'' prefix in mdiff.py Transformer won't add b'' prefix because that value is already have a r'' prefix. # skip-blame because just b'' prefix Differential Revision: https://phab.mercurial-scm.org/D3132
Thu, 05 Apr 2018 17:15:52 +0530 py3: fix error string with bytestr() on repr()d value
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:15:52 +0530] rev 37370
py3: fix error string with bytestr() on repr()d value Differential Revision: https://phab.mercurial-scm.org/D3131
Thu, 05 Apr 2018 17:14:11 +0530 py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:14:11 +0530] rev 37369
py3: suppress output from f.write() function class We need to suppress them because the output is not present on Python 2 Differential Revision: https://phab.mercurial-scm.org/D3130
Thu, 05 Apr 2018 17:13:09 +0530 py3: use pycompat.byteskwargs() in tests/autodiff.py
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:13:09 +0530] rev 37368
py3: use pycompat.byteskwargs() in tests/autodiff.py Differential Revision: https://phab.mercurial-scm.org/D3129
Thu, 05 Apr 2018 17:00:15 +0530 py3: suppress the output of open() using `and None`
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:00:15 +0530] rev 37367
py3: suppress the output of open() using `and None` This patch suppresses the output of open() on Python 3 as it does not return any output on Python 2. This makes test-diffstat.t pass on Python 3.5 Differential Revision: https://phab.mercurial-scm.org/D3128
Thu, 05 Apr 2018 16:56:34 +0530 py3: return bytes from util.removeauth()
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:56:34 +0530] rev 37366
py3: return bytes from util.removeauth() util.hidepassword() also returns bytes and we should deal in bytes as much as possible. This makes test-logexchange.t pass on Python 3.5 Differential Revision: https://phab.mercurial-scm.org/D3127
Thu, 05 Apr 2018 16:54:56 +0530 py3: use bytes instead of str in instance()
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:54:56 +0530] rev 37365
py3: use bytes instead of str in instance() We deal internally with bytes, so we should check whether the remote is a bytes or not. Differential Revision: https://phab.mercurial-scm.org/D3126
Thu, 05 Apr 2018 16:46:34 +0530 py3: use pycompat.bytestr in test-journal.t
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:46:34 +0530] rev 37364
py3: use pycompat.bytestr in test-journal.t Differential Revision: https://phab.mercurial-scm.org/D3124
Wed, 04 Apr 2018 23:55:47 -0700 hgweb: don't include hidden revisions in /filelog/ view
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 23:55:47 -0700] rev 37363
hgweb: don't include hidden revisions in /filelog/ view This is a very crude way of doing it, but it seems to be working well enough. The number of entries on the page won't be the usual maximum number per page, but this is good enough for me. Differential Revision: https://phab.mercurial-scm.org/D3122
Thu, 05 Apr 2018 00:00:48 -0700 tests: show that hgweb contains hidden revisions in /filelog/ view
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 00:00:48 -0700] rev 37362
tests: show that hgweb contains hidden revisions in /filelog/ view Note that these entries contain the summary line of the hidden commit, which is a bit a privacy issue to display. Also note that the links from the entries take you to a page that says: An error occurred while processing your request: filtered revision '2d32257e1109' (not in 'served' subset) Differential Revision: https://phab.mercurial-scm.org/D3121
Wed, 04 Apr 2018 09:03:17 -0700 convert: use repo.lookup() for converting to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 09:03:17 -0700] rev 37361
convert: use repo.lookup() for converting to nodeid This is a list of revs that come from the CLI (opts['rev']). Perhaps we should allow any revset, but I'll leave that for someone else to improve if they care. Differential Revision: https://phab.mercurial-scm.org/D3089
Wed, 04 Apr 2018 22:36:21 -0700 extdatasource: use revsymbol() for converting to node
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 22:36:21 -0700] rev 37360
extdatasource: use revsymbol() for converting to node It's unclear what we want to support here. Perhaps it should just be nodeids? It doesn't make much sense to share revnums between repos, and bookmarks are probably too unstable. I used scmutil.revsymbol() to preserve the current behavior. We can change later if we want to. Differential Revision: https://phab.mercurial-scm.org/D3088
Wed, 04 Apr 2018 15:13:32 -0700 bookmarks: calculateupdate() returns a bookmark, not a rev
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:13:32 -0700] rev 37359
bookmarks: calculateupdate() returns a bookmark, not a rev This changes the inaccurate/unclear documentation and also changes the code so "node" now contains a binary nodeid. Differential Revision: https://phab.mercurial-scm.org/D3087
Wed, 04 Apr 2018 10:13:08 -0700 pull: pass rev to check out as integer to postincoming()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 10:13:08 -0700] rev 37358
pull: pass rev to check out as integer to postincoming() I don't know if there's ever been a need for it to be a string (it's been like that since 02f40b2ece3f (commands: use rev from remote repo when updating as part of a pull, 2009-10-21)). I'm soon going to require it to be an integer, so let's fix this first. Differential Revision: https://phab.mercurial-scm.org/D3086
Thu, 05 Apr 2018 14:21:37 +0530 children: support specifying revision by revset
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 14:21:37 +0530] rev 37357
children: support specifying revision by revset Same reason as the previous patch. Differential Revision: https://phab.mercurial-scm.org/D3085
Wed, 04 Apr 2018 15:08:26 -0700 heads: add support for specifying branches by revset
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:08:26 -0700] rev 37356
heads: add support for specifying branches by revset Before this commit, e.g. "hg heads .^" would fail with: abort: unknown revision '.^'! Like the previous patch, I don't care about the command itself (I don't think I had ever used it before), I'm just cleaning up uses of repo[<string>]. Differential Revision: https://phab.mercurial-scm.org/D3084
Wed, 04 Apr 2018 15:06:32 -0700 perf: make perfmanifest and perfnodelookup work with revsets
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:06:32 -0700] rev 37355
perf: make perfmanifest and perfnodelookup work with revsets They were using repo[rev], which only works with a single symbol (e.g. "." or "my-bookmark"), not general revsets. Switch them to scmutil.revsingle() so they can also be used with e.g. ".^". I don't actually care about these commands, but I want to remove uses of repo[<string>]. Differential Revision: https://phab.mercurial-scm.org/D3083
Tue, 03 Apr 2018 23:47:01 -0700 context: use revsymbol() in "merge.preferancestor" code
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 23:47:01 -0700] rev 37354
context: use revsymbol() in "merge.preferancestor" code Differential Revision: https://phab.mercurial-scm.org/D3082
Wed, 04 Apr 2018 15:11:43 -0700 wireproto: use repo.lookup() for lookup command
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:11:43 -0700] rev 37353
wireproto: use repo.lookup() for lookup command I'm trying to reduce use of repo[<string>] and this seems like an obvious place to use repo.lookup(). Differential Revision: https://phab.mercurial-scm.org/D3081
Wed, 04 Apr 2018 14:57:58 -0700 localrepo: use revsymbol in lookupbranch() too
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 14:57:58 -0700] rev 37352
localrepo: use revsymbol in lookupbranch() too lookupbranch() takes a string that comes from the CLI, so scmutil.revsymbol() is appropriate for looking it up. Differential Revision: https://phab.mercurial-scm.org/D3080
Wed, 04 Apr 2018 14:31:09 -0700 localrepo: drop "remote" argument from lookupbranch() (API)
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 14:31:09 -0700] rev 37351
localrepo: drop "remote" argument from lookupbranch() (API) According to `hg grep --all lookupbranch`, the "remote" argument has never been used ever since it was introduced in ca739acf1a98 (commands: add more robust support for 'hg log -b' (issue2078), 2010-04-12). Differential Revision: https://phab.mercurial-scm.org/D3079
Sun, 01 Apr 2018 22:48:32 -0700 revset: use revsymbol() for checking if a symbol is valid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 22:48:32 -0700] rev 37350
revset: use revsymbol() for checking if a symbol is valid Differential Revision: https://phab.mercurial-scm.org/D3078
Tue, 03 Apr 2018 15:08:14 -0700 tests: disable tests for advanced clone features with simple store
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 15:08:14 -0700] rev 37349
tests: disable tests for advanced clone features with simple store There are a handful of test failures in the simple store with regards to stream clones. Fixing them will require a lot of conditional output. Disabling the tests wholesale is easier at this juncture. Differential Revision: https://phab.mercurial-scm.org/D3064
Tue, 03 Apr 2018 14:24:14 -0700 tests: skip largefiles and lfs tests when using simple store
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 14:24:14 -0700] rev 37348
tests: skip largefiles and lfs tests when using simple store Getting these tests to pass is more work than it is worth right now. Let's punt on it. Differential Revision: https://phab.mercurial-scm.org/D3063
Tue, 03 Apr 2018 18:23:33 -0700 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 18:23:33 -0700] rev 37347
tests: conditionalize test output for simple store Differential Revision: https://phab.mercurial-scm.org/D3061
Wed, 04 Apr 2018 11:44:38 -0700 tests: disallow using simple store repo with bundlerepo
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 11:44:38 -0700] rev 37346
tests: disallow using simple store repo with bundlerepo bundlerepo is... going to be difficult to port to an alternate store because it assumes revlogs for storage and essentially overlays the contents of a bundle onto a fake revlog-like primitive. It will be a good test case for our eventual new storage interface. Refactoring bundlerepo to make it work with non-revlog storage is going to be a bit of work. So for now, let's refuse to use the simple store repo when a bundlerepo is in play. A new test requirement advertising support for treating bundle files as repo instances has been added. Some tests have been made conditional on this feature. Additional tests will be annotated in subsequent commits. Having positive opt-in to repo features will be simpler in the long run because it will allow multiple storage backends to declare feature support and we won't have to annotate each test with the set of repo backends that are supported. Again, we'll probably want better integration between repo features and tests. But this is the easiest we can do at the moment. Differential Revision: https://phab.mercurial-scm.org/D3060
Wed, 04 Apr 2018 11:31:35 -0700 tests: disable test-revlog-v2 when using simple store
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 11:31:35 -0700] rev 37345
tests: disable test-revlog-v2 when using simple store Because the simple store has nothing to do with revlogs. Differential Revision: https://phab.mercurial-scm.org/D3056
Tue, 03 Apr 2018 18:16:04 -0700 tests: skip filelog damage tests when not using revlogs
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 18:16:04 -0700] rev 37344
tests: skip filelog damage tests when not using revlogs Differential Revision: https://phab.mercurial-scm.org/D3042
Tue, 03 Apr 2018 10:04:30 -0700 tests: skip some tests when using simple store
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 10:04:30 -0700] rev 37343
tests: skip some tests when using simple store generaldelta is a revlog implementation detail. We don't need to test it with the simple store. union repos are heavily revlog based. It should be possible to run them with alternate stores. But it's not worth the trouble at this juncture. Differential Revision: https://phab.mercurial-scm.org/D3040
Wed, 04 Apr 2018 13:21:34 -0700 tests: conditionalize tests based on presence of custom extensions
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 13:21:34 -0700] rev 37342
tests: conditionalize tests based on presence of custom extensions The test harness supports injecting extensions via --extra-config-opt. However, if you do this, various tests that print state about loaded extensions fail. This commit teaches the test harness to recognize when custom extensions are loaded so that tests can use feature sniffing to conditionalize tests based on that. Differential Revision: https://phab.mercurial-scm.org/D3039
Wed, 04 Apr 2018 12:16:50 -0700 simplestorerepo: avoid shadowing dict in list comprehension over dict
Augie Fackler <augie@google.com> [Wed, 04 Apr 2018 12:16:50 -0700] rev 37341
simplestorerepo: avoid shadowing dict in list comprehension over dict Caught by pyflakes. Differential Revision: https://phab.mercurial-scm.org/D3077
Tue, 03 Apr 2018 09:54:20 -0700 narrow: pass node into revlog.revision()
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 09:54:20 -0700] rev 37340
narrow: pass node into revlog.revision() This is one of the few (possibly only) places where we pass an int in for filelogs. Other revlogs (notably changelog) are very heavy on int usage. But filelogs are surprisingly node centric. I'd like to formalize the interface around the use of nodes (at least for filelogs). So let's switch to a node. We can't inline revlog.node() because of a check-code rule. I think that rule is suspect. But it may be for performance reasons with changelog code. I'd rather not touch it at this time. Differential Revision: https://phab.mercurial-scm.org/D3043
Tue, 03 Apr 2018 10:15:21 -0700 changegroup: remove "revlog" from error message
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 10:15:21 -0700] rev 37339
changegroup: remove "revlog" from error message The previous message leaked an implementation detail. Differential Revision: https://phab.mercurial-scm.org/D3041
Tue, 03 Apr 2018 18:15:24 -0700 tests: conditionalize tests based on presence of revlogs for files
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 18:15:24 -0700] rev 37338
tests: conditionalize tests based on presence of revlogs for files ~85 tests don't like our non-revlog file store for various reasons. This commit introduces hghave functionality for declaring and querying repository features. By default, we assume repositories have revlog-based file storage. But if the HGREPOFEATURES environment variable is set, we can override the default set of repository features. If you run the test harness with our simplestorerepo extension and an environment variable set to the proper value, you can override the hghave defaults to agree with simplestorerepo's version of reality. Various tests have been modified so behavior dependent on revlog-based file storage is marked as such. This fixes a handful of test failures with our custom file storage extension. But dozens remain. The point of this commit is to demonstrate how tests will need to be modified to account for custom storage implementations. TBH, I'm not convinced hghave is the proper layer for repository feature detection. I /think/ we'll eventually want something in run-tests.py itself. But that would require inventing a new primitive in the test harness. This is all very alpha at the moment. So I think hghave is an acceptable place to hang this feature detection. I think the right time to be thinking about integrating this into run-tests.py is *after* we have a stable alternate storage implementation in core. For now, let's try to make progress towards the idea of an alternate storage backend. Differential Revision: https://phab.mercurial-scm.org/D3030
Wed, 04 Apr 2018 11:37:07 -0700 tests: add test extension implementing custom filelog storage
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 11:37:07 -0700] rev 37337
tests: add test extension implementing custom filelog storage In order to better support partial clones, we'll need alternate repository storage mechanisms that aren't based on revlogs. Today, the interface for repository storage isn't very well defined. And there are various layering violations and assumptions made throughout the code that storage is backed by revlogs. In order to support alternate storage mechanisms, we'll need to formally declare and adhere to interfaces for storage. This will be a long, arduous process. This commit creates an extension that implements non-revlog storage for files. It defines a custom type that quacks like the existing revlog/filelog API but isn't backed by a revlog. The backing storage is - for simplicity reasons - a CBOR index and per-node files representing fulltext data. The localrepository class is modified so file(f) returns instances of this class instead of filelog instances. The purpose of this extension is to tease out what the actual filelog interface is - based on running the test harness - so we can formalize that interface and then implement a *real* alternate storage backend. Using `run-tests.py --extra-config-opt` to run the test harness with this extension enabled yields 83 failures out of 634 ran tests. The most common test failures are due to: * Issues with `hg verify` * LFS and largefiles (probably flags processing related) * Narrow. * Any test touching or inspecting individual filelog paths. * help and error output that is confused by the presence of an extension. * `hg debug*` commands doing low-level, revlog-y things. An 88% pass rate is pretty good for an initial implementation if you ask me! There is a bit of duplicate code in the new extension. That's by design: a point of this code is to tease out dependencies on revlog. That being said, there is opportunity to consolidate code by moving things out of the revlog API. For example, DAG traversal operations don't necessarily need to be implemented at the storage level. (Although for performance reasons they probably do.) Once we have a more well-defined interface, we could probably define the default implementations in terms of the base interface, pull those in via class inheritance, and have implementations override with faster versions if they so choose. (Or something like that.) But for now, the duplicate code should be acceptable. Differential Revision: https://phab.mercurial-scm.org/D3029
Tue, 03 Apr 2018 13:56:09 -0700 tests: use `hg unbundle` instead of `hg pull` in some tests
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 13:56:09 -0700] rev 37336
tests: use `hg unbundle` instead of `hg pull` in some tests `hg pull <bundle>` uses the special "bundlerepo" repository. The bundlerepo code makes many assumptions about the storage of repositories. It will be difficult to teach bundlerepo to use non-revlog storage before a better storage interface is established. Many test failures using our "simple store" are related to bundlerepo: the simple store just isn't compatible with bundlerepo because of storage assumptions in bundlerepo. In order to mitigate the impact of bundlerepo on our code base, this commit changes various tests to use `hg unbundle` instead of `hg pull`. This bypasses the bundlerepo code. Tests exercising exchange functionality have not been altered, as they should be using `hg pull` and going through the bundlerepo code paths. Differential Revision: https://phab.mercurial-scm.org/D3059
Wed, 04 Apr 2018 09:41:18 -0700 hgweb: use revsymbol() for creating context from changeid
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 09:41:18 -0700] rev 37335
hgweb: use revsymbol() for creating context from changeid These seem to be for looking up a revision that can come from the user, so revsymbol() is the right method to call (0194dac7 has more information about my plans for repo[x]). Differential Revision: https://phab.mercurial-scm.org/D3075
Tue, 03 Apr 2018 23:00:41 -0700 hgweb: inline changeidctx()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 23:00:41 -0700] rev 37334
hgweb: inline changeidctx() Differential Revision: https://phab.mercurial-scm.org/D3074
Tue, 03 Apr 2018 21:50:42 -0700 hgweb: drop support for "manifest" parameter
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 21:50:42 -0700] rev 37333
hgweb: drop support for "manifest" parameter AFAICT (but note that this is the first time I look at hgweb code), the "mercurial" query parameter was removed from rendered pages in 36fa5db79dd5 (hgweb: convert gitweb to NWI, 2006-10-05). Search for "manifest=" in that diff to see why I think it was removed. It's about time we stop looking for the parameter in requests. Differential Revision: https://phab.mercurial-scm.org/D3073
Wed, 04 Apr 2018 10:32:48 -0700 rebase: use single transaction when running in memory
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 10:32:48 -0700] rev 37332
rebase: use single transaction when running in memory rebase.singletransaction make rebase noticeably faster (~20% in a test I just ran). It is not enabled by default because it risks losing information if it aborts (see `hg help rebase`). When running rebase with the experimental in-memory option on, rebase is first attempted in memory, and if any conflicts occur, it restarts, this time writing to disk. Thus, it should be safe to turn on single-transaction mode for the in-memory phase. Differential Revision: https://phab.mercurial-scm.org/D3076
Tue, 03 Apr 2018 13:16:12 -0700 bundlerepo: use super() when calling file()
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 13:16:12 -0700] rev 37331
bundlerepo: use super() when calling file() We should be calling the default method, not reimplementing it. Differential Revision: https://phab.mercurial-scm.org/D3058
Tue, 03 Apr 2018 18:20:10 -0700 tests: remove superfluous config setting
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 18:20:10 -0700] rev 37330
tests: remove superfluous config setting format.usegeneraldelta defaults to true. Differential Revision: https://phab.mercurial-scm.org/D3057
Sat, 17 Mar 2018 22:30:25 +0900 templater: mark .joinfmt as a private attribute
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 22:30:25 +0900] rev 37329
templater: mark .joinfmt as a private attribute
Mon, 19 Mar 2018 20:32:06 +0900 obsutil: make obsfateprinter() less dependent on templater
Yuya Nishihara <yuya@tcha.org> [Mon, 19 Mar 2018 20:32:06 +0900] rev 37328
obsutil: make obsfateprinter() less dependent on templater joinfmt() is defined as 'lambda x: scmutil.formatchangeid(repo[x])' in showsuccsandmarkers(). Function arguments are reordered so they look more normal.
Sat, 17 Mar 2018 22:06:31 +0900 templater: abstract away from joinfmt
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 22:06:31 +0900] rev 37327
templater: abstract away from joinfmt Future patches will add a wrapper for a list of template mappings, which will implement a custom join() something like {join(mappings % template)}. The original join() function is broken down as follows: if hasattr(joinset, 'joinfmt'): # hybrid.join() where values must be a list or a dict joinitems((joinfmt(x) for x in values), sep) elif isinstance(joinset, templateutil.wrapped): # mappable.join() show() else: # a plain list, a generator, or a byte string; joinfmt was identity() joinset = templateutil.unwrapvalue(context, joinset) joinitems(pycompat.maybebytestr(joinset), joiner)
Tue, 20 Mar 2018 23:16:28 +0900 templater: micro-optimize join() with empty separator
Yuya Nishihara <yuya@tcha.org> [Tue, 20 Mar 2018 23:16:28 +0900] rev 37326
templater: micro-optimize join() with empty separator
Sat, 17 Mar 2018 21:42:27 +0900 templater: factor out generator of join()-ed items
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 21:42:27 +0900] rev 37325
templater: factor out generator of join()-ed items Prepares for defining join() behavior per wrapped types and getting rid of the public joinfmt attribute.
Sun, 18 Mar 2018 23:24:50 +0900 templater: pass context to itermaps() for future extension
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 23:24:50 +0900] rev 37324
templater: pass context to itermaps() for future extension Unlike show() and tovalue(), a base mapping isn't passed to itermaps() since it is the function to generate a partial mapping.
Sat, 17 Mar 2018 21:21:50 +0900 templater: define interface for objects which act as iterator of mappings
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 21:21:50 +0900] rev 37323
templater: define interface for objects which act as iterator of mappings
Wed, 04 Apr 2018 23:26:49 +0900 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org> [Wed, 04 Apr 2018 23:26:49 +0900] rev 37322
stringutil: drop escapedata() in favor of escapestr() They are quite similar. Let's choose one that uses standard Python escape.
Fri, 30 Mar 2018 18:57:13 -0700 peer: make ui an attribute
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 30 Mar 2018 18:57:13 -0700] rev 37321
peer: make ui an attribute With abc interfaces, instance attributes could not satisfy @abc.abstractproperty requirements because interface conformance was tested at type creation time. When we created the abc peer interfaces, we had to make "ui" a @property to satisfy abc. Now that peer interfaces are using zope.interface and there is no import time validation (but there are tests validating instances conform to the interface), we can go back to using regular object attributes. Differential Revision: https://phab.mercurial-scm.org/D3069
Fri, 30 Mar 2018 18:53:17 -0700 repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 30 Mar 2018 18:53:17 -0700] rev 37320
repository: port peer interfaces to zope.interface zope.interface is superior. Let's switch to it. Unlike abc, which defines interfaces through a base class, zope.interface uses different types for interfaces and for implementations. So, we had to invent some new types to hold the interfaces in order to separate the interface from its default implementation. The names here could probably be better. I've been wanting to overhaul the peer interface for a while. And wire protocol version 2 will force that work. So anticipate a refactoring of these interfaces in later commits. With this commit, we no longer test abc interfaces in test-check-interfaces.py, so code for that has been removed. Differential Revision: https://phab.mercurial-scm.org/D3068 # no-check-commit because of stream_out()
Fri, 30 Mar 2018 14:52:32 -0700 wireproto: convert human output frames to CBOR
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 30 Mar 2018 14:52:32 -0700] rev 37319
wireproto: convert human output frames to CBOR This is easier than rolling our own encoding format. As a bonus, some of our artificial limits around lengths of things went away because we are no longer using fixed length fields to hold sizes. Differential Revision: https://phab.mercurial-scm.org/D3067
Mon, 02 Apr 2018 17:06:42 +0530 py3: use pycompat.bytestr() intsead of str
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 02 Apr 2018 17:06:42 +0530] rev 37318
py3: use pycompat.bytestr() intsead of str Differential Revision: https://phab.mercurial-scm.org/D3071
Mon, 19 Mar 2018 12:46:56 +0530 py3: use print as a function in tests/test-walk.t
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 19 Mar 2018 12:46:56 +0530] rev 37317
py3: use print as a function in tests/test-walk.t Differential Revision: https://phab.mercurial-scm.org/D3070
Tue, 03 Apr 2018 13:19:35 -0700 repo: remove now-unused changectx() method (API)
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 13:19:35 -0700] rev 37316
repo: remove now-unused changectx() method (API) repo.changectx(x) was just a synonym for repo[x], so any extensions that fail due to this commit should switch over to that form. Differential Revision: https://phab.mercurial-scm.org/D3037
Tue, 03 Apr 2018 15:08:09 -0700 localrepo: use revsymbol() in lookup()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 15:08:09 -0700] rev 37315
localrepo: use revsymbol() in lookup() lookup() seems to be about looking up a revision based on a symbol that may come from the user (via the wire protocol), so revsymbol() is appropriate here. Differential Revision: https://phab.mercurial-scm.org/D3055
Sun, 01 Apr 2018 23:29:51 -0700 histedit: avoid repo.lookup() for converting revnum to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 23:29:51 -0700] rev 37314
histedit: avoid repo.lookup() for converting revnum to nodeid Differential Revision: https://phab.mercurial-scm.org/D3054
Sun, 01 Apr 2018 23:27:50 -0700 outgoing: avoid repo.lookup() for converting revnum to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 23:27:50 -0700] rev 37313
outgoing: avoid repo.lookup() for converting revnum to nodeid Differential Revision: https://phab.mercurial-scm.org/D3053
Sun, 01 Apr 2018 23:21:17 -0700 bisect: avoid repo.lookup() for converting revnum to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 23:21:17 -0700] rev 37312
bisect: avoid repo.lookup() for converting revnum to nodeid Differential Revision: https://phab.mercurial-scm.org/D3052
Sun, 01 Apr 2018 23:19:37 -0700 transplant: avoid repo.lookup() for converting revnum to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 23:19:37 -0700] rev 37311
transplant: avoid repo.lookup() for converting revnum to nodeid Differential Revision: https://phab.mercurial-scm.org/D3051
Sun, 01 Apr 2018 23:10:25 -0700 tests: avoid repo.lookup() for converting revnum to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 23:10:25 -0700] rev 37310
tests: avoid repo.lookup() for converting revnum to nodeid Differential Revision: https://phab.mercurial-scm.org/D3050
Mon, 02 Apr 2018 15:14:31 -0700 bundle: consistently keep a list of stringified revisions in "revs"
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 15:14:31 -0700] rev 37309
bundle: consistently keep a list of stringified revisions in "revs" Before this patch, "revs", in the "not base" branch, would be a list of mixed integral revnums, hex nodeids, and branch names. After this patch, they're all strings. They can still be a mix of hex nodeids and branch names, but the important thing for my future patches is that they're consistently in string form. Differential Revision: https://phab.mercurial-scm.org/D3049
Mon, 02 Apr 2018 15:10:41 -0700 bundle: avoid repo.lookup() for converting revnum to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 15:10:41 -0700] rev 37308
bundle: avoid repo.lookup() for converting revnum to nodeid Differential Revision: https://phab.mercurial-scm.org/D3048
Tue, 03 Apr 2018 14:39:21 -0700 push: avoid using repo.lookup() for converting to nodeid
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 14:39:21 -0700] rev 37307
push: avoid using repo.lookup() for converting to nodeid repo.lookup(x) currently simply does repo[x].node(), which supports various types of inputs. As I explained in 0194dac77c93 (scmutil: add method for looking up a context given a revision symbol, 2018-04-02), I'd like to split that up so we use the new scmutil.revsymbol() for string inputs repo[x] for integer revnums and binary nodeids. Since repo.lookup() seems to exist in order to serve peer.lookup(), I think it should be calling revsymbol. However, we have several callers that use repo.lookup() with something that's not a string, so we need to remove those first. This patch starts doing that. Many more will follow. Differential Revision: https://phab.mercurial-scm.org/D3047
Tue, 03 Apr 2018 22:24:50 +0900 addremove: pass command-level similarity value down to scmutil.addremove()
Yuya Nishihara <yuya@tcha.org> [Tue, 03 Apr 2018 22:24:50 +0900] rev 37306
addremove: pass command-level similarity value down to scmutil.addremove() Since we've changed to carry a similarity value by opts dict, it makes sense to leave a string '0'-'100' value unmodified.
Tue, 03 Apr 2018 13:37:57 -0400 setup: add overlooked hgext.infinitepush package declaration
Augie Fackler <augie@google.com> [Tue, 03 Apr 2018 13:37:57 -0400] rev 37305
setup: add overlooked hgext.infinitepush package declaration Will fix infinitepush tests that have been failing when run without --local. Differential Revision: https://phab.mercurial-scm.org/D3038
Tue, 03 Apr 2018 09:12:15 -0700 tests: remove dependence on repo.changectx()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 09:12:15 -0700] rev 37304
tests: remove dependence on repo.changectx() This was one of few remaining uses of repo.changectx() in core. Differential Revision: https://phab.mercurial-scm.org/D3036
Tue, 03 Apr 2018 08:55:49 -0700 log: remove dependence on repo.changectx()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 08:55:49 -0700] rev 37303
log: remove dependence on repo.changectx() This was one of few remaining uses of repo.changectx() in core. Differential Revision: https://phab.mercurial-scm.org/D3035
Tue, 03 Apr 2018 08:55:16 -0700 verify: remove dependence on repo.changectx()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 08:55:16 -0700] rev 37302
verify: remove dependence on repo.changectx() This was one of few remaining uses of repo.changectx() in core. Differential Revision: https://phab.mercurial-scm.org/D3034
Tue, 03 Apr 2018 08:46:58 -0700 bookmarks: switch from repo.changectx('.') to repo['.']
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 08:46:58 -0700] rev 37301
bookmarks: switch from repo.changectx('.') to repo['.'] The two forms are synonymous and the new form is by far the more common form. Differential Revision: https://phab.mercurial-scm.org/D3033
Wed, 28 Mar 2018 14:52:57 -0700 stringutil: add function to pretty print an object
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 14:52:57 -0700] rev 37300
stringutil: add function to pretty print an object This is inspired by the pprint() module/function (which we can't use because the output is different on Python 2 and 3 - namely the use of b'' literals). We hook it up to `hg debugwireproto` for printing the response to a wire protocol command. This foreshadows future peer work, which will support decoding CBOR responses into rich data structures. Differential Revision: https://phab.mercurial-scm.org/D2987
Wed, 28 Mar 2018 13:30:24 -0700 wireproto: add frame flag to denote payloads as CBOR
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 13:30:24 -0700] rev 37299
wireproto: add frame flag to denote payloads as CBOR We may eventually want a separate frame type for this. But for now this is the easiest to implement. Differential Revision: https://phab.mercurial-scm.org/D2986
Wed, 28 Mar 2018 13:01:28 -0700 wireproto: implement custom __repr__ for frame
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 13:01:28 -0700] rev 37298
wireproto: implement custom __repr__ for frame This version won't print the full payload (which could be large). It also prints human friendly values for types and flags. Differential Revision: https://phab.mercurial-scm.org/D2985
Wed, 28 Mar 2018 12:44:35 -0700 keepalive: implement readinto()
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 12:44:35 -0700] rev 37297
keepalive: implement readinto() This is part of the standard I/O interface. It is used by the framing protocol. So we need to implement it so frames can be decoded. Differential Revision: https://phab.mercurial-scm.org/D2984
Fri, 23 Mar 2018 16:24:53 -0700 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 23 Mar 2018 16:24:53 -0700] rev 37296
wireproto: port protocol handler to zope.interface zope.interface is superior to the abc module. Let's port to it. As part of this, we add tests for interface conformance for classes implementing the interface. Differential Revision: https://phab.mercurial-scm.org/D2983
Wed, 28 Mar 2018 10:40:41 -0700 wireproto: separate commands tables for version 1 and 2 commands
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 10:40:41 -0700] rev 37295
wireproto: separate commands tables for version 1 and 2 commands We can't easily reuse existing command handlers for version 2 commands because the response types will be different. e.g. many commands return nodes encoded as hex. Our new wire protocol is binary safe, so we'll wish to encode nodes as binary. We /could/ teach each command handler to look at the protocol handler and change behavior based on the version in use. However, this would make logic a bit unwieldy over time and would make it harder to design a unified protocol handler interface. I think it's better to create a clean break between version 1 and version 2 of commands on the server. What I imagine happening is we will have separate @wireprotocommand functions for each protocol generation. Those functions will parse the request, dispatch to a common function to process it, then generate the response in its own, transport-specific manner. This commit establishes a separate table for tracking version 1 commands from version 2 commands. The HTTP server pieces have been updated to use this new table. Most commands are marked as both version 1 and version 2, so there is little practical impact to this change. A side-effect of this change is we now rely on transport registration in wireprototypes.TRANSPORTS and certain properties of the protocol interface. So a test had to be updated to conform. Differential Revision: https://phab.mercurial-scm.org/D2982
Wed, 28 Mar 2018 10:12:02 -0700 wireproto: mark SSHv2 as a version 1 transport
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 10:12:02 -0700] rev 37294
wireproto: mark SSHv2 as a version 1 transport The version component is used for filtering/routing wire protocol commands to their proper handler. The actual version 2 of the wire protocol commands will use a different encoding of responses. We already have tests using the version 2 SSH transport and version 2 of the wire protocol commands won't be implemented atomically. This commit marks the SSHv2 transport as version 1 so it will still invoke the version 1 commands. Once the commands are all implemented in version 2, we can restore its proper behavior. Some tests had to be disabled as a result of this change. Differential Revision: https://phab.mercurial-scm.org/D2981
Wed, 28 Mar 2018 14:05:29 -0700 wireproto: stop aliasing wire protocol types (API)
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 14:05:29 -0700] rev 37293
wireproto: stop aliasing wire protocol types (API) We generally shy away from aliasing module symbols. I think I was keeping this around for API compatibility. We've already made tons of other API breaks in the wire protocol code this release. What's one more? .. api:: ``wireproto`` module no longer re-exports various types used to define responses to wire protocol commands. Access these types from the ``wireprototypes`` module. Differential Revision: https://phab.mercurial-scm.org/D2979
Mon, 26 Mar 2018 14:34:32 -0700 wireproto: use CBOR for command requests
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 14:34:32 -0700] rev 37292
wireproto: use CBOR for command requests Now that we're using CBOR in the new wire protocol, let's convert command requests to it. Before I wrote this patch and was even thinking about CBOR, I was thinking about how commands should be issued and came to the conclusion that we didn't need separate frames to represent the command name from its arguments. I already had a partially completed patch prepared to merge the frames. But with CBOR, it makes the implementation a bit simpler because we don't need to roll our own serialization. The changes here are a bit invasive. I tried to split this into multiple commits to make it easier to review. But it was just too hard. * "command name" and "command argument" frames have been collapsed into a "command request" frame. * The flags for this new frame are totally different. * Frame processing has been overhauled to reflect the new order of things. * Test fallout was significant. A handful of tests were removed. Altogether, I think the new code is simpler. We don't have complicated state around receiving commands. We're either receiving command request frames or command data frames. We /could/ potentially collapse command data frames into command request frames. Although I'd have to think a bit more about this before I do it. Differential Revision: https://phab.mercurial-scm.org/D2951
Mon, 26 Mar 2018 10:50:36 -0700 wireproto: define frame to represent progress updates
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 10:50:36 -0700] rev 37291
wireproto: define frame to represent progress updates Today, a long-running operation on a server may run without any sign of progress on the client. This can lead to the conclusion that the server has hung or the connection has dropped. In fact, connections can and do time out due to inactivity. And a long-running server operation can result in the connection dropping prematurely because no data is being sent! While we're inventing the new wire protocol, let's provide a mechanism for communicating progress on potentially expensive server-side events. We introduce a new frame type that conveys "progress" updates. This frame type essentially holds the data required to formulate a ``ui.progress()`` call. We only define the frame right now. Implementing it will be a bit of work since there is no analog to progress frames in the existing wire protocol. We'll need to teach the ui object to write to the wire protocol, etc. The use of a CBOR map may seem wasteful, as this will encode key names in every frame. This *is* wasteful. However, maps are extensible. And the intent is to always use compression via streams. Compression will make the overhead negligible since repeated strings will be mostly eliminated over the wire. Differential Revision: https://phab.mercurial-scm.org/D2902
Wed, 28 Mar 2018 15:05:39 -0700 wireproto: syntax for encoding CBOR into frames
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 15:05:39 -0700] rev 37290
wireproto: syntax for encoding CBOR into frames We just vendored a library for encoding and decoding the CBOR data format. While the intent of that vendor was to support state files, CBOR is really a nice data format. It is extensible and compact. I've been feeling dirty inventing my own data formats for frame payloads. While custom formats can always beat out a generic format, there is a cost to be paid in terms of implementation, comprehension, etc. CBOR is compact enough that I'm not too worried about efficiency loss. I think the benefits of using a standardized format outweigh rolling our own formats. So I plan to make heavy use of CBOR in the wire protocol going forward. This commit introduces support for encoding CBOR data in frame payloads to our function to make a frame from a human string. We do need to employ some low-level Python code in order to evaluate a string as a Python expression. But other than that, this should hopefully be pretty straightforward. Unit tests for this function have been added. Differential Revision: https://phab.mercurial-scm.org/D2948
Mon, 26 Mar 2018 13:59:56 -0700 wireproto: explicit API to create outgoing streams
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 13:59:56 -0700] rev 37289
wireproto: explicit API to create outgoing streams It is better to create outgoing streams through the reactor so the reactor knows about what streams are active and can track them accordingly. Test output changes slightly because frames from subsequent responses no longer have the "stream begin" stream flag set because the stream is now used across all responses. Differential Revision: https://phab.mercurial-scm.org/D2947
Mon, 26 Mar 2018 11:00:16 -0700 wireproto: add streams to frame-based protocol
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 11:00:16 -0700] rev 37288
wireproto: add streams to frame-based protocol Previously, the frame-based protocol was just a series of frames, with each frame associated with a request ID. In order to scale the protocol, we'll want to enable the use of compression. While it is possible to enable compression at the socket/pipe level, this has its disadvantages. The big one is it undermines the point of frames being standalone, atomic units that can be read and written: if you add compression above the framing protocol, you are back to having a stream-based protocol as opposed to something frame-based. So in order to preserve frames, compression needs to occur at the frame payload level. Compressing each frame's payload individually will limit compression ratios because the window size of the compressor will be limited by the max frame size, which is 32-64kb as currently defined. It will also add CPU overhead, as it is more efficient for compressors to operate on fewer, larger blocks of data than more, smaller blocks. So compressing each frame independently is out. This means we need to compress each frame's payload as if it is part of a larger stream. The simplest approach is to have 1 stream per connection. This could certainly work. However, it has disadvantages (documented below). We could also have 1 stream per RPC/command invocation. (This is the model HTTP/2 goes with.) This also has disadvantages. The main disadvantage to one global stream is that it has the very real potential to create CPU bottlenecks doing compression. Networks are only getting faster and the performance of single CPU cores has been relatively flat. Newer compression formats like zstandard offer better CPU cycle efficiency than predecessors like zlib. But it still all too common to saturate your CPU with compression overhead long before you saturate the network pipe. The main disadvantage with streams per request is that you can't reap the benefits of the compression context for multiple requests. For example, if you send 1000 RPC requests (or HTTP/2 requests for that matter), the response to each would have its own compression context. The overall size of the raw responses would be larger because compression contexts wouldn't be able to reference data from another request or response. The approach for streams as implemented in this commit is to support N streams per connection and for streams to potentially span requests and responses. As explained by the added internals docs, this facilitates servers and clients delegating independent streams and compression to independent threads / CPU cores. This helps alleviate the CPU bottleneck of compression. This design also allows compression contexts to be reused across requests/responses. This can result in improved compression ratios and less overhead for compressors and decompressors having to build new contexts. Another feature that was defined was the ability for individual frames within a stream to declare whether that individual frame's payload uses the content encoding (read: compression) defined by the stream. The idea here is that some servers may serve data from a combination of caches and dynamic resolution. Data coming from caches may be pre-compressed. We want to facilitate servers being able to essentially stream bytes from caches to the wire with minimal overhead. Being able to mix and match with frames are compressed within a stream enables these types of advanced server functionality. This commit defines the new streams mechanism. Basic code for supporting streams in frames has been added. But that code is seriously lacking and doesn't fully conform to the defined protocol. For example, we don't close any streams. And support for content encoding within streams is not yet implemented. The change was rather invasive and I didn't think it would be reasonable to implement the entire feature in a single commit. For the record, I would have loved to reuse an existing multiplexing protocol to build the new wire protocol on top of. However, I couldn't find a protocol that offers the performance and scaling characteristics that I desired. Namely, it should support multiple compression contexts to facilitate scaling out to multiple CPU cores and compression contexts should be able to live longer than single RPC requests. HTTP/2 *almost* fits the bill. But the semantics of HTTP message exchange state that streams can only live for a single request-response. We /could/ tunnel on top of HTTP/2 streams and frames with HEADER and DATA frames. But there's no guarantee that HTTP/2 libraries and proxies would allow us to use HTTP/2 streams and frames without the HTTP message exchange semantics defined in RFC 7540 Section 8. Other RPC protocols like gRPC tunnel are built on top of HTTP/2 and thus preserve its semantics of stream per RPC invocation. Even QUIC does this. We could attempt to invent a higher-level stream that spans HTTP/2 streams. But this would be violating HTTP/2 because there is no guarantee that HTTP/2 streams are routed to the same server. The best we can do - which is what this protocol does - is shoehorn all request and response data into a single HTTP message and create streams within. At that point, we've defined a Content-Type in HTTP parlance. It just so happens our media type can also work as a standalone, stream-based protocol, without leaning on HTTP or similar protocol. Differential Revision: https://phab.mercurial-scm.org/D2907
Mon, 26 Mar 2018 13:57:22 -0700 wireproto: start to associate frame generation with a stream
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 13:57:22 -0700] rev 37287
wireproto: start to associate frame generation with a stream An upcoming commit will introduce "streams" into the frame-based wire protocol. In preparation for this invasive change, we introduce a basic "stream" class and have all operations that create frames also operate alongside a stream instance. Differential Revision: https://phab.mercurial-scm.org/D2906
Mon, 26 Mar 2018 13:51:22 -0700 tests: fix duplicate and failing test
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 13:51:22 -0700] rev 37286
tests: fix duplicate and failing test There were two "testconflictingrequestid" methods. Naturally this isn't an error in Python. And by our luck, the test was failing. So we rename the test and fix it to pass. As part of this, _sendsingleframe() now takes a frame, not a string describing the frame. This is better because action at a distance can be confusing. Differential Revision: https://phab.mercurial-scm.org/D2950
Mon, 02 Apr 2018 16:47:53 -0700 debugcommands: drop offset and length from debugindex by default
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 02 Apr 2018 16:47:53 -0700] rev 37285
debugcommands: drop offset and length from debugindex by default These fields are an implementation detail of revlog storage. As such, they are not part of the generic storage "index" interface and shouldn't be displayed by default. Because we don't have another way to display these fields, we've retained support for printing these fields via --verbose. Yes, I know we should probably be doing all this formatting using modern formatting/templater APIs. I didn't feel like scope bloating this patch. Differential Revision: https://phab.mercurial-scm.org/D3028
Mon, 02 Apr 2018 16:28:20 -0700 debugcommands: drop base revision from debugindex
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 02 Apr 2018 16:28:20 -0700] rev 37284
debugcommands: drop base revision from debugindex Revlog index data consists of generic index metadata that will likely be implemented across all storage engines and revlog-specifc metadata. Most tests printing index data only care about the generic fields. This commit drops the printing of the base revision from `hg debugindex`. This value is an implementation detail of revlogs / delta chains. If tests are interested in verifying this implementation detail, `hg debugdeltachain` is a better command. Most tests were skipping over this field anyway. Tests that weren't looked like they were newer. So my guess is we forgot to make them skip the field to match the style of the older tests. This reinforces my belief that the base revision is not worth having in `hg debugindex`. Differential Revision: https://phab.mercurial-scm.org/D3027
Mon, 02 Apr 2018 16:24:57 -0700 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 02 Apr 2018 16:24:57 -0700] rev 37283
tests: use debugdeltachain where appropriate Some tests are verifying delta chain type things. This metadata has more to do with a revlog implementation details than index data, which is theoretically generic. This commit ports some tests to `hg debugdeltachain`, as it is the more appropriate debug command for looking at delta metadata. Differential Revision: https://phab.mercurial-scm.org/D3026
Mon, 02 Apr 2018 15:55:50 -0700 tests: don't use revlog paths in tests
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 02 Apr 2018 15:55:50 -0700] rev 37282
tests: don't use revlog paths in tests Debug commands operating on revlogs don't need the full revlog path: they can accept the relative path to a tracked file or use -c/-m to specify a changelog or manifest. Not using the revlog path makes tests more resilient to cases where revlogs aren't being used for storage. Differential Revision: https://phab.mercurial-scm.org/D3025
Sat, 17 Mar 2018 21:03:16 +0900 templater: define interface for objects requiring unwrapvalue()
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 21:03:16 +0900] rev 37281
templater: define interface for objects requiring unwrapvalue() unwrapvalue() is changed to not return a lazy bytes generator for "wrapped" types because I want to define the tovalue() interface as such. It's a baby step to unify unwrapvalue() and _unwrapvalue().
Fri, 23 Mar 2018 21:40:16 +0900 templater: extract private function to evaluate generator to byte string
Yuya Nishihara <yuya@tcha.org> [Fri, 23 Mar 2018 21:40:16 +0900] rev 37280
templater: extract private function to evaluate generator to byte string
Sun, 18 Mar 2018 23:14:21 +0900 templater: pass (context, mapping) down to unwrapvalue()
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 23:14:21 +0900] rev 37279
templater: pass (context, mapping) down to unwrapvalue() The same reason as why I made unwraphybrid() take a (context, mapping) pair.
Sat, 17 Mar 2018 20:58:28 +0900 templater: drop unneeded generator from mappable object
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 20:58:28 +0900] rev 37278
templater: drop unneeded generator from mappable object Per the definition of the show() interface, it can return a bytes.
Sat, 17 Mar 2018 20:56:42 +0900 templater: mark .gen as a private attribute
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 20:56:42 +0900] rev 37277
templater: mark .gen as a private attribute
Sun, 18 Mar 2018 00:11:36 +0900 templatekw: do not directly call .gen
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 00:11:36 +0900] rev 37276
templatekw: do not directly call .gen
Sat, 17 Mar 2018 20:52:50 +0900 templater: define interface for objects requiring unwraphybrid()
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 20:52:50 +0900] rev 37275
templater: define interface for objects requiring unwraphybrid() Prepares for introducing another hybrid-like data type. show() takes context as an argument so a wrapper class may render its items by pre-configured template: def show(self, context, mapping): return (context.expand(self._tmpl, mapping + lm) for lm in self._mappings)
Sat, 17 Mar 2018 20:09:05 +0900 templater: pass (context, mapping) down to unwraphybrid()
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 20:09:05 +0900] rev 37274
templater: pass (context, mapping) down to unwraphybrid() See the subsequent patches for why. I initially thought it would be wrong to pass a mapping to flatten() and stringify() since these functions may be applied to a tree of generators, where each node should be bound to the mapping when it was evaluated. But, actually that isn't a problem. If an intermediate node has to override a mapping dict, it can do on unwraphybrid() and yield "unwrapped" generator of byte strings: "{f(g(v))}" # literal template example. ^^^^ # g() want to override a mapping, so it returns a wrapped # object 'G{V}' with partial mapping 'lm' attached. ^^^^^^^ # f() stringifies 'G{V}', starting from a mapping 'm'. # when unwrapping 'G{}', it updates 'm' with 'lm', and # passes it to 'V'. This structure is important for the formatter (and the hgweb) to build a static template keyword, which can't access a mapping dict until evaluation phase.
Mon, 02 Apr 2018 16:18:33 -0700 scmutil: add method for looking up a context given a revision symbol
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 16:18:33 -0700] rev 37273
scmutil: add method for looking up a context given a revision symbol changectx's constructor currently supports a mix if inputs: * integer revnums * binary nodeids * '.', 'tip', 'null' * stringified revnums * namespaced identifiers (e.g. bookmarks and tags) * hex nodeids * partial hex nodeids The first two are always internal [1]. The other five can be specified by the user. The third type ('.', 'tip', 'null') often comes from either the user or internal callers. We probably have some internal callers that pass hex nodeids too, perhaps even partial ones (histedit?). There are only a few callers that pass user-supplied strings: revsets.stringset, peer.lookup, webutil.changeidctx, and maybe one or two more. Supporting this mix of things in the constructor is convenient, but a bit strange, IMO. For example, if repo[node] is given a node that's not in the repo, it will first check if it's bookmark etc before raising an exception. Of course, the risk of it being a bookmark is extremely small, but it just feels ugly. Also, a problem with having this code in the constructor (whether it supports a mix of types or not) is that it's harder to override (I'd like to override it, and that's how this series started). This patch starts moving out the handling of user-supplied strings by introducing scmutil.revsymbol(). So far, that just checks that the input is indeed a string, and then delegates to repo[symbol]. The patch also calls it from revsets.stringset to prove that it works. [1] Well, you probably can enter a 20-byte binary nodeid on the command line, but I don't think we should care to preserve support for that. Differential Revision: https://phab.mercurial-scm.org/D3024
Mon, 02 Apr 2018 23:52:43 -0700 narrow: add trailing slash to dir earlier for debug{revlog,index,data}
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 23:52:43 -0700] rev 37272
narrow: add trailing slash to dir earlier for debug{revlog,index,data} The treemanifest code internally uses trailing slashes on directories (except for the root directory, which is an empty string). We should make sure we pass in directories with trailing slashes when we work with the treemanifest code. For some reason, I seem to have decided to be nice to the callers instead in 49c583ca48c4 (treemanifest: add --dir option to debug{revlog,data,index}, 2015-04-12). Let's fix that and pay the cost of fixing up the directory name close close to where we get it from the user. Differential Revision: https://phab.mercurial-scm.org/D3032
Sat, 31 Mar 2018 23:49:58 +0530 addremove: remove dry_run, similarity from scmutil.addremove (API)
Sushil khanchi <sushilkhanchi97@gmail.com> [Sat, 31 Mar 2018 23:49:58 +0530] rev 37271
addremove: remove dry_run, similarity from scmutil.addremove (API) Differential Revision: https://phab.mercurial-scm.org/D3000
Tue, 03 Apr 2018 12:16:19 +0530 histedit: make errror message translatable
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com> [Tue, 03 Apr 2018 12:16:19 +0530] rev 37270
histedit: make errror message translatable This is a follow up patch to https://phab.mercurial-scm.org/D2394 As suggested by Yuya, this patch makes the error message translatable Differential Revision: https://phab.mercurial-scm.org/D3031
Mon, 02 Apr 2018 09:18:01 -0700 context: drop support for changeid='' (API)
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 09:18:01 -0700] rev 37269
context: drop support for changeid='' (API) Since the previous commit, there seem to be no users who pass '' to repo.__getitem__, so let's drop support for it. It may seem like a small cost to keep support for it, but I've spent time being confused by it twice already. Differential Revision: https://phab.mercurial-scm.org/D3021
Mon, 02 Apr 2018 08:43:08 -0700 subrepo: use repo['.'] instead of repo['']
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 08:43:08 -0700] rev 37268
subrepo: use repo['.'] instead of repo[''] The "state" value (a revision) passed to abstractsubrepo.phase() can be '' to represent the currently checked out revisions. Let's convert that to the more common '.'. I think this is the last of use of repo['.'] in core. Differential Revision: https://phab.mercurial-scm.org/D3019
Tue, 03 Apr 2018 00:12:29 +0530 children: use repo['.'] instead of repo['']
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 00:12:29 +0530] rev 37267
children: use repo['.'] instead of repo[''] Differential Revision: https://phab.mercurial-scm.org/D3020
Mon, 02 Apr 2018 09:16:52 -0700 revset: drop support for '' as alias for '.'
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 09:16:52 -0700] rev 37266
revset: drop support for '' as alias for '.' Not marked BC because I think support for using '' on the CLI was there by accident, and we don't seem to have documented it. Differential Revision: https://phab.mercurial-scm.org/D3018
Mon, 02 Apr 2018 09:06:24 -0700 tests: add test showing current parse of empty string symbol in revset
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 09:06:24 -0700] rev 37265
tests: add test showing current parse of empty string symbol in revset We support e.g. parents(""), but I think that's by accident and I'll change it soon. Differential Revision: https://phab.mercurial-scm.org/D3017
Mon, 02 Apr 2018 08:46:07 -0700 clone: rename "rev" to "revs" since there can be many
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 08:46:07 -0700] rev 37264
clone: rename "rev" to "revs" since there can be many It was a little tricky in hg.clone(), since there was a local "revs" variable defined there, but "rev" was never used after "revs", so I just overwrote it. Note that clonewithshare() should also have its "rev" argument renamed to "revs", but I'll leave that to someone else. Differential Revision: https://phab.mercurial-scm.org/D3016
Sun, 01 Apr 2018 15:41:16 -0700 parseurl: consistently call second output "branches"
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 15:41:16 -0700] rev 37263
parseurl: consistently call second output "branches" Differential Revision: https://phab.mercurial-scm.org/D3015
Sun, 01 Apr 2018 11:06:29 +0900 templatefuncs: do not crash because of invalid value fed to mailmap()
Yuya Nishihara <yuya@tcha.org> [Sun, 01 Apr 2018 11:06:29 +0900] rev 37262
templatefuncs: do not crash because of invalid value fed to mailmap()
Sat, 31 Mar 2018 23:34:15 -0700 scmutil: deprecate revpairnodes()
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:34:15 -0700] rev 37261
scmutil: deprecate revpairnodes() Differential Revision: https://phab.mercurial-scm.org/D3012
Sun, 01 Apr 2018 09:30:44 -0700 tests: use context-return revpair() in autodiff
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 09:30:44 -0700] rev 37260
tests: use context-return revpair() in autodiff Differential Revision: https://phab.mercurial-scm.org/D3013
Sat, 31 Mar 2018 23:26:07 -0700 fileset: use context-returning revpair()
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:26:07 -0700] rev 37259
fileset: use context-returning revpair() Differential Revision: https://phab.mercurial-scm.org/D3011
Sat, 31 Mar 2018 23:31:28 -0700 status: use context-returning revpair()
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:31:28 -0700] rev 37258
status: use context-returning revpair() Differential Revision: https://phab.mercurial-scm.org/D3010
Sat, 31 Mar 2018 23:49:44 -0700 diff: simplify by converting contexts to nodeids a little later
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:49:44 -0700] rev 37257
diff: simplify by converting contexts to nodeids a little later Differential Revision: https://phab.mercurial-scm.org/D3009
Sat, 31 Mar 2018 23:25:02 -0700 diff: use context-returning revpair()
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:25:02 -0700] rev 37256
diff: use context-returning revpair() Differential Revision: https://phab.mercurial-scm.org/D3008
Sat, 31 Mar 2018 23:38:53 -0700 extdiff: use context-returning revpair()
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:38:53 -0700] rev 37255
extdiff: use context-returning revpair() Differential Revision: https://phab.mercurial-scm.org/D3007
Sat, 31 Mar 2018 23:10:46 -0700 scmutil: make revpair() return context objects (API)
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:10:46 -0700] rev 37254
scmutil: make revpair() return context objects (API) Differential Revision: https://phab.mercurial-scm.org/D3006
Sat, 31 Mar 2018 23:37:25 -0700 scmutil: introduce deprecated alias for revpair()
Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:37:25 -0700] rev 37253
scmutil: introduce deprecated alias for revpair() revsingle() returns a context object, revpair() returns nodeids, revrange() returns integer revisions (in a revset). I'm going to reduce this inconsistency by making revpair() return context objects. Changing the return type is not nice to extensions, so this patch introduces a nodeid-returning version of revpair() that they can detect and use. Update callers to the new function so we can change revpair() itself and then migrate them back one by one. Differential Revision: https://phab.mercurial-scm.org/D3005
Sat, 31 Mar 2018 23:58:08 -0400 lfs: ensure the transfer request is for a known URI
Matt Harbison <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 23:58:08 -0400] rev 37252
lfs: ensure the transfer request is for a known URI Since the dispatching code only checks the beginning of the string, this enforces that there's only one more path component.
Sat, 31 Mar 2018 23:47:56 -0400 lfs: avoid an improper usage of os.path.basename() to parse a URI
Matt Harbison <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 23:47:56 -0400] rev 37251
lfs: avoid an improper usage of os.path.basename() to parse a URI
Sat, 31 Mar 2018 15:20:43 -0400 lfs: add an experimental knob to disable blob serving
Matt Harbison <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 15:20:43 -0400] rev 37250
lfs: add an experimental knob to disable blob serving The use case here is the server admin may want to store the blobs elsewhere. As it stands now, the `lfs.url` config on the client side is all that enforces this (the web.allow-* permissions aren't able to block LFS blobs without also blocking normal hg traffic). The real solution to this is to implement the 'verify' action on the client and server, but that's not a near term goal. Whether this is useful in its own right, and should be promoted out of experimental at some point is TBD. Since the other two tests that deal with LFS and `hg serve` are already complex and have #testcases, this seems like a good time to start a new test dedicated to access checks against the server. Instead of conditionally wrapping the wire protocol handler, I put this in the handler because I'd still like to bring the annotations in from the evolve extension in order to set up the wrapping. The 400 status probably isn't great, but that's what it would be for existing `hg serve` instances without support for serving blobs.
Sat, 31 Mar 2018 13:01:20 -0400 stringutil: edit comment to reflect actual data type name
Connor Sheehan <sheehan@mozilla.com> [Sat, 31 Mar 2018 13:01:20 -0400] rev 37249
stringutil: edit comment to reflect actual data type name In development the data type used to hold an email/name pair was called a "mailmaptup" since it was implemented as a namedtuple. The implementation has since been changed to use an @attr.s decorated class named mailmapping. This commit changes a comment to reflect this change. Differential Revision: https://phab.mercurial-scm.org/D3004
Sat, 31 Mar 2018 11:36:55 -0400 stringutil: improve check for failed mailmap line parsing
Connor Sheehan <sheehan@mozilla.com> [Sat, 31 Mar 2018 11:36:55 -0400] rev 37248
stringutil: improve check for failed mailmap line parsing The existing check for a bad mailmap file entry fails with inputs like b'>@<'. This commit adds a function to check if a sufficient amount of information has been parsed from a mailmap file entry. At minimum, one email must be found (assumed to be the commit email). If email is not empty and no names are found, then there must be two emails. If there are at least one email and name, the mapping is valid. Differential Revision: https://phab.mercurial-scm.org/D3003
Sat, 31 Mar 2018 10:21:39 -0400 stringutil: rename local email/names variables to their plural forms
Connor Sheehan <sheehan@mozilla.com> [Sat, 31 Mar 2018 10:21:39 -0400] rev 37247
stringutil: rename local email/names variables to their plural forms email and name variables are renamed to emails and names (respectively). This is because the email variable name shadows the email function within the stringutil module. Since we are renaming email, we also rename name for consistency. Differential Revision: https://phab.mercurial-scm.org/D3002
Sat, 31 Mar 2018 10:13:42 -0400 templatefuncs: remove redundant "or author" from mailmap return statement
Connor Sheehan <sheehan@mozilla.com> [Sat, 31 Mar 2018 10:13:42 -0400] rev 37246
templatefuncs: remove redundant "or author" from mailmap return statement Differential Revision: https://phab.mercurial-scm.org/D3001
Sat, 24 Feb 2018 19:56:59 -0500 lfs: add the 'Content-Type' header called out in the file transfer spec
Matt Harbison <matt_harbison@yahoo.com> [Sat, 24 Feb 2018 19:56:59 -0500] rev 37245
lfs: add the 'Content-Type' header called out in the file transfer spec https://github.com/git-lfs/git-lfs/blob/master/docs/api/basic-transfers.md#uploads
Sun, 25 Feb 2018 23:44:02 -0500 lfs: improve the client message when the server signals an object error
Matt Harbison <matt_harbison@yahoo.com> [Sun, 25 Feb 2018 23:44:02 -0500] rev 37244
lfs: improve the client message when the server signals an object error Two things here. First, the previous message included a snippet of JSON, which tends to be long (and in the case of lfs-test-server, has no error message). Instead, give a concise message where possible, and leave the JSON to a debug output. Second, the server can signal issues other than a missing individual file. This change shows a corrupt file, but I'm debating letting the corrupt file get downloaded, because 1) the error code doesn't really fit, and 2) having it locally makes forensics easier. Maybe need a config knob for that.
Sat, 31 Mar 2018 15:54:26 -0400 check-code: tighten the check for `ls -R`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 15:54:26 -0400] rev 37243
check-code: tighten the check for `ls -R` Otherwise, this was flagging `... lfs.serve=False -R server ...` in the tests.
Sat, 31 Mar 2018 16:41:17 +0530 infinitepush: add tests for `hg pull -r <rev>`
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 16:41:17 +0530] rev 37242
infinitepush: add tests for `hg pull -r <rev>` This patch adds test for `hg pull -r <rev>` when the infinitepush extension is not present on the client side and the server by defaults pushes all the incoming push to bundlestore. As the tests show, if a the changeset was applied to the server, that can be pulled, but if a changeset is in the bundlestore we cannot pull that yet. We should support that. Differential Revision: https://phab.mercurial-scm.org/D2998
Sat, 31 Mar 2018 14:56:57 +0530 infinitepush: use bundleoperation.source instead of hacking on tr
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 14:56:57 +0530] rev 37241
infinitepush: use bundleoperation.source instead of hacking on tr Previous patches added a soutce attribute to bundle2.bundleoperation class which stores the command which leads to current bundleoperation. Let's use that to decide whether a processing a `hg unbundle` or not instead of hacking on transaction. Differential Revision: https://phab.mercurial-scm.org/D2997
Sat, 31 Mar 2018 14:54:12 +0530 bundle2: make source a mandatory argument for bundle2.applybundle() (API)
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 14:54:12 +0530] rev 37240
bundle2: make source a mandatory argument for bundle2.applybundle() (API) Currently all the callers in the core pass the source argument, making it mandatory will help us storing right source value in bundleoperation() class. Differential Revision: https://phab.mercurial-scm.org/D2996
Sat, 31 Mar 2018 14:51:34 +0530 bundleoperation: pass the source argument from all the users
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 14:51:34 +0530] rev 37239
bundleoperation: pass the source argument from all the users We now have a source attribute to the bundle2.bundleoperation class which stores the operation which leads to the current bundling/unbundling. Let's make sure we pass source argument from all the users of the command. Differential Revision: https://phab.mercurial-scm.org/D2995
Sat, 31 Mar 2018 14:49:16 +0530 bunlde2: add 'source' as an optional argument to processbundle()
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 14:49:16 +0530] rev 37238
bunlde2: add 'source' as an optional argument to processbundle() This will help us to pass the source variable to bundleoperation class. Differential Revision: https://phab.mercurial-scm.org/D2994
Sat, 31 Mar 2018 14:47:43 +0530 bundle2: add 'source' atrribute to bundleoperation class
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 14:47:43 +0530] rev 37237
bundle2: add 'source' atrribute to bundleoperation class This will help us in easily finding out which command leads to the current operation without hacking on the transaction. Differential Revision: https://phab.mercurial-scm.org/D2993
Sat, 31 Mar 2018 10:13:05 -0700 infinitepush: don't force ipv6 while connecting to mysql server
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 10:13:05 -0700] rev 37236
infinitepush: don't force ipv6 while connecting to mysql server Facebook internally enforces this but looks like we can't force this for pur users. Differential Revision: https://phab.mercurial-scm.org/D2992
Sat, 31 Mar 2018 14:33:37 +0530 infinitepush: drop the default value of config options which are registered
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 14:33:37 +0530] rev 37235
infinitepush: drop the default value of config options which are registered Differential Revision: https://phab.mercurial-scm.org/D2991
Sat, 31 Mar 2018 14:31:29 +0530 infinitepush: replace `remotenames.hoist` with `remotenames.hoistedpeer`
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 31 Mar 2018 14:31:29 +0530] rev 37234
infinitepush: replace `remotenames.hoist` with `remotenames.hoistedpeer` The remotenames.hoist config option was renamed to remotenames.hoistedpeer while moving to core as an extension. Let's start using the config option provided by the in-core extension. Differential Revision: https://phab.mercurial-scm.org/D2990
Sun, 18 Mar 2018 16:57:07 +0900 templater: drop global exception catcher from runfilter() (API)
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 16:57:07 +0900] rev 37233
templater: drop global exception catcher from runfilter() (API) Now all built-in template filters declare input data types or handle type errors by themselves. .. api:: Template filters should declare input data type and/or catch AttributeError, ValueError, TypeError, etc. as needed. See the doc of ``registrar.templatefilters`` for details.
Sun, 18 Mar 2018 16:53:08 +0900 templatefilters: raise ProgrammingError if unencodable type passed to json()
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 16:53:08 +0900] rev 37232
templatefilters: raise ProgrammingError if unencodable type passed to json() This shouldn't happen for any template data types (though I know it does because of some templater bugs.) Let's clarify it is a bug.
Sun, 18 Mar 2018 16:47:44 +0900 templatefilters: handle TypeError by count()
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 16:47:44 +0900] rev 37231
templatefilters: handle TypeError by count() Prepares for removing the weird exception catcher from runfilter().
Sun, 18 Mar 2018 17:02:39 +0900 keyword: declare input type of date filters as date
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 17:02:39 +0900] rev 37230
keyword: declare input type of date filters as date Dropped redundant dateutil.parsedate(), which is now handled by the templater.
Sun, 18 Mar 2018 16:12:44 +0900 templatefilters: declare input type as date where appropriate
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 16:12:44 +0900] rev 37229
templatefilters: declare input type as date where appropriate I'm not sure if the templateutil.date type can be a thing. Currently it's just a constant.
Tue, 20 Mar 2018 22:57:36 +0900 templater: attach hint to input-type error of runfilter()
Yuya Nishihara <yuya@tcha.org> [Tue, 20 Mar 2018 22:57:36 +0900] rev 37228
templater: attach hint to input-type error of runfilter() Tests will be added by the next patch.
Sun, 18 Mar 2018 15:58:22 +0900 templatefuncs: use evaldate() where seems appropriate
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 15:58:22 +0900] rev 37227
templatefuncs: use evaldate() where seems appropriate This means date("today") is allowed. Also fixes evaldate() to forcibly use the custom error message if specified.
Sun, 18 Mar 2018 15:55:31 +0900 templater: factor out function that parses argument as date tuple
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 15:55:31 +0900] rev 37226
templater: factor out function that parses argument as date tuple
Sun, 18 Mar 2018 15:42:28 +0900 templatefilters: declare input type as bytes where appropriate
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 15:42:28 +0900] rev 37225
templatefilters: declare input type as bytes where appropriate Some test outputs changed since input is now coerced to a byte string. I think that's okay. Maybe {date} should have some readable representation?
Sun, 18 Mar 2018 15:14:58 +0900 templatefilters: allow declaration of input data type
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 15:14:58 +0900] rev 37224
templatefilters: allow declaration of input data type Currently filters take an unwrapped value, which should have no hybrid magic but actually it does because stringify() relies on it. The 'intype' allows us to pre-process the magic by .e.g. evalstring() keeping filter functions as simple as they are now. stringify() is ported as an example. More follow.
Mon, 19 Mar 2018 20:39:06 +0900 hgweb: use registrar to declare "websub" template filter
Yuya Nishihara <yuya@tcha.org> [Mon, 19 Mar 2018 20:39:06 +0900] rev 37223
hgweb: use registrar to declare "websub" template filter Prepares for adding 'intype' attribute.
Sun, 25 Mar 2018 12:15:33 +0900 procutil: redirect ui.fout to stderr while stdio is protected
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Mar 2018 12:15:33 +0900] rev 37222
procutil: redirect ui.fout to stderr while stdio is protected The new behavior seems slightly nicer as we can at least read the output. And this is similar to what the sshserver is doing, so we can probably reuse protectstdio() instead of the weird hook.redirect(True) hack.
Sun, 25 Mar 2018 12:07:18 +0900 procutil: unroll uin/uout loop in protectstdio()
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Mar 2018 12:07:18 +0900] rev 37221
procutil: unroll uin/uout loop in protectstdio() I'll change uout to be redirected to stderr.
Fri, 30 Mar 2018 22:46:22 -0700 context: drop support for changeid of type long (API?)
Martin von Zweigbergk <martinvonz@google.com> [Fri, 30 Mar 2018 22:46:22 -0700] rev 37220
context: drop support for changeid of type long (API?) I don't see a reason to support type long. It's pretty much the same type as int. There was some discussion about it on the mailing list around the time of ff2f90503d64 (context: work around `long` not existing on Python 3, 2017-03-11), but I couldn't find a good reason to keep it. There was some mention of hgtk doing "repo[long(rev)]", but that was in 2012. Differential Revision: https://phab.mercurial-scm.org/D2989
Sat, 31 Mar 2018 00:02:31 -0400 lfs: drop a duplicate blob verification method
Matt Harbison <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 00:02:31 -0400] rev 37219
lfs: drop a duplicate blob verification method
Fri, 30 Mar 2018 23:32:06 -0400 server: minor code cleanup
Matt Harbison <matt_harbison@yahoo.com> [Fri, 30 Mar 2018 23:32:06 -0400] rev 37218
server: minor code cleanup Suggested by Yuya after 77f9e95fe3c4, this is mostly using named values for stdio descriptors. The lockfile is also opened in binary mode when reading back content from the child.
Fri, 30 Mar 2018 23:21:46 -0400 server: refactor 'daemon_postexec' instructions into a dictionary
Matt Harbison <matt_harbison@yahoo.com> [Fri, 30 Mar 2018 23:21:46 -0400] rev 37217
server: refactor 'daemon_postexec' instructions into a dictionary
Wed, 28 Mar 2018 13:37:19 -0700 cbor: import CBORDecoder and CBOREncoder
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 13:37:19 -0700] rev 37216
cbor: import CBORDecoder and CBOREncoder And format the imports so it is cleaner. Differential Revision: https://phab.mercurial-scm.org/D2978
Sat, 31 Mar 2018 10:28:18 +0900 py3: fix fix doctests to be bytes-safe
Yuya Nishihara <yuya@tcha.org> [Sat, 31 Mar 2018 10:28:18 +0900] rev 37215
py3: fix fix doctests to be bytes-safe
Wed, 28 Mar 2018 00:11:09 -0400 server: add an error feedback mechanism for when the daemon fails to launch
Matt Harbison <matt_harbison@yahoo.com> [Wed, 28 Mar 2018 00:11:09 -0400] rev 37214
server: add an error feedback mechanism for when the daemon fails to launch There's a recurring problem on Windows where `hg serve -d` will randomly fail to spawn a detached process. The reason for the failure is completely hidden, and it takes hours to get a single failure on my laptop. All this does is redirect stdout/stderr of the child to a file until the lock file is freed, and then the parent dumps it out if it fails to spawn. I chose to put the output into the lock file because that is always cleaned up. There's no way to report errors after that anyway. On Windows, killdaemons.py is roughly `kill -9`, so this ensures that junk won't pile up. This may end up being a case of EADDRINUSE. At least that's what I saw spit out a few times (among other odd errors and missing output on Windows). But I also managed to get the same thing on Fedora 26 by running test-hgwebdir.t with --loop -j10 for several hours. Running `netstat` immediately after killing that run printed a wall of sockets in the TIME_WAIT state, which were gone a couple seconds later. I couldn't match up ports that failed, because --loop doesn't print out the message about the port that was used. So maybe the fix is to rotate the use of HGPORT[12] in the tests. But, let's collect some more data first.
Fri, 30 Mar 2018 20:53:36 -0400 tests: conditionalize test-stream-bundle-v2 for Windows
Matt Harbison <matt_harbison@yahoo.com> [Fri, 30 Mar 2018 20:53:36 -0400] rev 37213
tests: conditionalize test-stream-bundle-v2 for Windows
Mon, 19 Mar 2018 11:16:21 -0400 templatefuncs: add mailmap template function
Connor Sheehan <sheehan@mozilla.com> [Mon, 19 Mar 2018 11:16:21 -0400] rev 37212
templatefuncs: add mailmap template function This commit adds a template function to support the .mailmap file in Mercurial repositories. The .mailmap file comes from git, and can be used to map new emails and names for old commits. The general use case is that someone may change their name or author commits under different emails and aliases, which would make these commits appear as though they came from different persons. The file allows you to specify the correct name that should be used in place of the author field specified in the commit. The mailmap file has 4 possible formats used to map old "commit" names to new "proper" names: 1. <proper@email.com> <commit@email.com> 2. Proper Name <commit@email.com> 3. Proper Name <proper@email.com> <commit@email.com> 4. Proper Name <proper@email.com> Commit Name <commit@email.com> Essentially there is a commit email present in each mailmap entry, that maps to either an updated name, email, or both. The final possible format allows commits authored by a person who used both an old name and an old email to map to a new name and email. To parse the file, we split by spaces and build a name out of every element that does not start with "<". Once we find an element that does start with "<" we concatenate all the name elements that preceded and add that as a parsed name. We then add the email as the first parsed email. We repeat the process until the end of the line, or a comment is found. We will be left with all parsed names in a list, and all parsed emails in a list, with the 0 index being the proper values and the 1 index being the commit values (if they were specified in the entry). The commit values are added as the keys to a dict, and with the proper fields as the values. The mapname function takes the mapping object and the commit author field and attempts to look for a corresponding entry. To do so we try (commit name, commit email) first, and if no results are returned then (None, commit email) is also looked up. This is due to format 4 from above, where someone may have a mailmap entry with both name and email, and if they don't it is possible they have an entry that uses only the commit email. Differential Revision: https://phab.mercurial-scm.org/D2904
Fri, 30 Mar 2018 12:16:46 -0700 extdiff: document that it copies modified files back to working directory
Kyle Lippincott <spectral@google.com> [Fri, 30 Mar 2018 12:16:46 -0700] rev 37211
extdiff: document that it copies modified files back to working directory Differential Revision: https://phab.mercurial-scm.org/D2976
(0) -30000 -10000 -3000 -1000 -192 +192 +1000 +3000 +10000 tip