Mon, 03 Jul 2017 21:10:48 -0700 show: tweak warning message
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 03 Jul 2017 21:10:48 -0700] rev 33208
show: tweak warning message '.' is "working directory parent" not "working directory."
Fri, 23 Jun 2017 13:49:34 +0200 revlog: add an experimental option to mitigated delta issues (issue5480)
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 23 Jun 2017 13:49:34 +0200] rev 33207
revlog: add an experimental option to mitigated delta issues (issue5480) The general delta heuristic to select a delta do not scale with the number of branch. The delta base is frequently too far away to be able to reuse a chain according to the "distance" criteria. This leads to insertion of larger delta (or even full text) that themselves push the bases for the next delta further away leading to more large deltas and full texts. This full text and frequent recomputation throw Mercurial performance in disarray. For example of a slightly large repository 280 000 files (2 150 000 versions) 430 000 changesets (10 000 topological heads) Number below compares repository with and without the distance criteria: manifest size: with: 21.4 GB without: 0.3 GB store size: with: 28.7 GB without 7.4 GB bundle last 15 00 revisions: with: 800 seconds 971 MB without: 50 seconds 73 MB unbundle time (of the last 15K revisions): with: 1150 seconds (~19 minutes) without: 35 seconds Similar issues has been observed in other repositories. Adding a new option or "feature" on stable is uncommon. However, given that this issues is making Mercurial practically unusable, I'm exceptionally targeting this patch for stable. What is actually needed is a full rework of the delta building and reading logic. However, that will be a longer process and churn not suitable for stable. In the meantime, we introduces a quick and dirty mitigation of this in the 'experimental' config space. The new option introduces a way to set the maximum amount of memory usable to store a diff in memory. This extend the ability for Mercurial to create chains without removing all safe guard regarding memory access. The option should be phased out when core has a more proper solution available. Setting the limit to '0' remove all limits, setting it to '-1' use the default limit (textsize x 4).
Sun, 02 Jul 2017 13:24:23 +0900 tests: use system hg only if changelog or dirstate can't be read
Yuya Nishihara <yuya@tcha.org> [Sun, 02 Jul 2017 13:24:23 +0900] rev 33206
tests: use system hg only if changelog or dirstate can't be read The bundled hg should work flawlessly in most cases. Make it depend on the external installation only if necessary since we can't control the whole environment. This patch doesn't implement the "exit 80" idea proposed by Jun. I don't want to keep the capability checking sync with the actual tests.
Sun, 02 Jul 2017 13:20:28 +0900 tests: restore workaround of obsolete warning from 3c9066ed557c
Yuya Nishihara <yuya@tcha.org> [Sun, 02 Jul 2017 13:20:28 +0900] rev 33205
tests: restore workaround of obsolete warning from 3c9066ed557c It's simple and works well unless you are using third-party extensions that changes the store format.
Sun, 02 Jul 2017 13:14:20 +0900 tests: alias syshg and syshgenv so they can be switched conditionally
Yuya Nishihara <yuya@tcha.org> [Sun, 02 Jul 2017 13:14:20 +0900] rev 33204
tests: alias syshg and syshgenv so they can be switched conditionally
Fri, 30 Jun 2017 21:49:29 +0900 tests: actually restore the original environment before running syshg
Yuya Nishihara <yuya@tcha.org> [Fri, 30 Jun 2017 21:49:29 +0900] rev 33203
tests: actually restore the original environment before running syshg Since os.environ may be overridden in run-tests.py, several important variables such as PATH weren't restored. I don't like the idea of using the system hg *by default* because the executable and the configs are out of our control. But I don't mind as long as the tests pass.
Sun, 02 Jul 2017 20:08:09 -0700 phabricator: add phabread command to read patches
Jun Wu <quark@fb.com> [Sun, 02 Jul 2017 20:08:09 -0700] rev 33202
phabricator: add phabread command to read patches This patch adds a `phabread` command generating plain-text patches from Phabricator, suitable for `hg import`. It respects `hg:meta` so user and date information might be preserved. And it removes `Summary:` field name which makes the commit message a bit tidier. To support stacked diffs, a `--stack` flag was added to read dependent patches recursively.
Sun, 02 Jul 2017 20:08:09 -0700 phabricator: add phabsend command to send a stack
Jun Wu <quark@fb.com> [Sun, 02 Jul 2017 20:08:09 -0700] rev 33201
phabricator: add phabsend command to send a stack The `phabsend` command is intended to provide `hg email`-like experience - sending a stack, setup dependency information and do not amend existing changesets. It uses differential.createrawdiff and differential.revision.edit Conduit API to create or update a Differential Revision. Local tags like `D123` are written indicating certain changesets were sent to Phabricator. The `phabsend` command will use obsstore and tags information to decide whether to update or create Differential Revisions.
Sun, 02 Jul 2017 20:08:09 -0700 phabricator: add a contrib script
Jun Wu <quark@fb.com> [Sun, 02 Jul 2017 20:08:09 -0700] rev 33200
phabricator: add a contrib script The default Phabricator client arcanist is not friendly to send a stack of changesets. It works better when a feature branch is reviewed as a single review unit. However, we want multiple revisions per feature branch. To be able to have an `hg email`-like UX to send and receive a stack of commits easily, it seems we have to re-invent things. This patch adds `phabricator.py` speaking Conduit API [1] in `contrib` as the first step. This may also be an option for people who don't want to run PHP. Config could be done in `hgrc` (instead of `arcrc` or `arcconfig`): [phabricator] # API token. Get it from https://phab.mercurial-scm.org/conduit/login/ token = cli-xxxxxxxxxxxxxxxxxxxxxxxxxxxx url = https://phab.mercurial-scm.org/ # callsign is used by the next patch callsign = HG This patch only adds a single command: `debugcallconduit` to keep the patch size small. To test it, having the above config, and run: $ hg debugcallconduit diffusion.repository.search <<EOF > {"constraints": {"callsigns": ["HG"]}} > EOF The result will be printed in prettified JSON format. [1]: Conduit APIs are listed at https://phab.mercurial-scm.org/conduit/
Sat, 01 Jul 2017 22:38:42 -0700 show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 01 Jul 2017 22:38:42 -0700] rev 33199
show: implement "stack" view People often want to know what they are working on *now*. As part of this, they also commonly want to know how that work is related to other changesets in the repo so they can perform common actions like rebase, histedit, and merge. `hg show work` made headway into this space. However, it is geared towards a complete repo view as opposed to just the current line of work. If you have a lot of in-flight work or the repo has many heads, the output can be overwhelming. The closest thing Mercurial has to "show me the current thing I'm working on" that doesn't require custom revsets is `hg qseries`. And this requires MQ, which completely changes workflows and repository behavior and has horrible performance on large repos. But as sub-optimal as MQ is, it does some things right, such as expose a model of the repo that is easy for people to reason about. This simplicity is why I think a lot of people prefer to use MQ, despite its shortcomings. One common development workflow is to author a series of linear changesets, using bookmarks, branches, anonymous heads, or even topics (3rd party extension). I'll call this a "stack." You periodically rewrite history in place (using `hg histedit`) and reparent the stack against newer changesets (using `hg rebase`). This workflow can be difficult because there is no obvious way to quickly see the current "stack" nor its relation to other changesets. Figuring out arguments to `hg rebase` can be difficult and may require highlighting and pasting multiple changeset nodes to construct a command. The goal of this commit is to make stack based workflows simpler by exposing a view of the current stack and its relationship to other releant changesets, notably the parent of the base changeset in the stack and newer heads that the stack could be rebased or merged into. Introduced is the `hg show stack` view. Essentially, it finds all mutable changesets from the working directory revision in both directions, stopping at a merge or branch point. This limits the revisions to a DAG linear range. The stack is rendered as a concise list of changesets. Alongside the stack is a visualization of the DAG, similar to `hg log -G`. Newer public heads from the branch point of the stack are rendered above the stack. The presence of these heads helps people understand the DAG model and the relationship between the stack and changes made since the branch point of that stack. If the "rebase" command is available, a `hg rebase` command is printed for each head so a user can perform a simple copy and paste to perform a rebase. This view is alpha quality. There are tons of TODOs documented inline. But I think it is good enough for a first iteration.
Wed, 28 Jun 2017 21:30:46 -0400 tests: demonstrate inconsistencies with dirty state in various commands
Matt Harbison <matt_harbison@yahoo.com> [Wed, 28 Jun 2017 21:30:46 -0400] rev 33198
tests: demonstrate inconsistencies with dirty state in various commands Not only is the output of these commands inconsistent with respect to each other when a file is deleted, they are internally inconsistent depending upon whether the deleted file is in the top level repo or a subrepo. It seemed easier to show the problems, rather than describe them. The original goal was to fix the summary command with respect to deleted files. I haven't fixed any of the other issues yet, in case anybody believes the current subrepo behavior is correct. I think a natural understanding of clean/dirty is that they are two opposite values of a single binary repo state. If `hg update --clean -r .` changes a file, then naturally that repo was dirty, and `hg update --check` should have blocked it. Deleted files are special, in that they don't block a commit. But they make the filesystem content not the same as a clean checkout.
Sat, 01 Jul 2017 20:34:27 -0700 check-config: syntax to allow inconsistent config values
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 01 Jul 2017 20:34:27 -0700] rev 33197
check-config: syntax to allow inconsistent config values The ignore regular expression has been updated to detect "inconsistent config." If present, we track which configs have that set and we suppress the conflicting defaults error for those options. I also added named groups to the regexp to aid readability. A comment was added to profiling.py to make a desired inconsistent value error go away.
Fri, 30 Jun 2017 03:28:02 +0200 configitems: register the 'badserver.closebeforeaccept' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:28:02 +0200] rev 33196
configitems: register the 'badserver.closebeforeaccept' config
Fri, 30 Jun 2017 03:27:54 +0200 configitems: register the 'badserver.closeaftersendbytes' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:27:54 +0200] rev 33195
configitems: register the 'badserver.closeaftersendbytes' config
Fri, 30 Jun 2017 03:27:44 +0200 configitems: register the 'badserver.closeafterrecvbytes' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:27:44 +0200] rev 33194
configitems: register the 'badserver.closeafterrecvbytes' config
Fri, 30 Jun 2017 03:27:36 +0200 configitems: register the 'badserver.closeafteraccept' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:27:36 +0200] rev 33193
configitems: register the 'badserver.closeafteraccept' config
Fri, 30 Jun 2017 03:28:18 +0200 configitems: register the 'blackbox.logsource' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:28:18 +0200] rev 33192
configitems: register the 'blackbox.logsource' config
Fri, 30 Jun 2017 03:28:11 +0200 configitems: register the 'blackbox.dirty' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:28:11 +0200] rev 33191
configitems: register the 'blackbox.dirty' config
Fri, 30 Jun 2017 03:27:24 +0200 configitems: register the 'automv.similarity' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:27:24 +0200] rev 33190
configitems: register the 'automv.similarity' config Default value has been ported.
Sat, 01 Jul 2017 20:58:34 +0200 acl: use configlist to retrieve the source config
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 01 Jul 2017 20:58:34 +0200] rev 33189
acl: use configlist to retrieve the source config This is what the previous code was about.
Fri, 30 Jun 2017 03:27:07 +0200 configitems: register the 'acl.sources' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:27:07 +0200] rev 33188
configitems: register the 'acl.sources' config The existing default value is now formally declared. It seems like the whole config should be a list, but this is an adventure for the next changesets.
Fri, 30 Jun 2017 03:26:57 +0200 configitems: register the 'acl.config' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:26:57 +0200] rev 33187
configitems: register the 'acl.config' config
Wed, 28 Jun 2017 13:31:51 +0200 config: register the 'devel.legacy.exchange' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:31:51 +0200] rev 33186
config: register the 'devel.legacy.exchange' config
Fri, 30 Jun 2017 03:31:35 +0200 configitems: register the 'bundle.reorder' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:31:35 +0200] rev 33185
configitems: register the 'bundle.reorder' config
Fri, 30 Jun 2017 03:31:26 +0200 configitems: register the 'bundle.mainreporoot' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:31:26 +0200] rev 33184
configitems: register the 'bundle.mainreporoot' config
Fri, 30 Jun 2017 03:28:28 +0200 configitems: register the 'bookmarks.pushing' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:28:28 +0200] rev 33183
configitems: register the 'bookmarks.pushing' config
Fri, 30 Jun 2017 03:27:18 +0200 configitems: register the 'auth.cookiefile' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:27:18 +0200] rev 33182
configitems: register the 'auth.cookiefile' config
Fri, 30 Jun 2017 03:32:09 +0200 configitems: register the 'color.mode' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 30 Jun 2017 03:32:09 +0200] rev 33181
configitems: register the 'color.mode' config
Sat, 01 Jul 2017 21:57:17 +0200 zeroconf: blindly forward extra argument to the core config method
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 01 Jul 2017 21:57:17 +0200] rev 33180
zeroconf: blindly forward extra argument to the core config method The new default value handling is simpler if we let the original function handle everything.
Sat, 01 Jul 2017 20:16:54 +0200 configitem: fix default value for 'serverrequirecert'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 01 Jul 2017 20:16:54 +0200] rev 33179
configitem: fix default value for 'serverrequirecert'
Fri, 30 Jun 2017 01:47:49 +0900 localrepo: factor out base of filecache annotation class
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 30 Jun 2017 01:47:49 +0900] rev 33178
localrepo: factor out base of filecache annotation class It isn't needed that storecache is derived from repofilecache. Changes in this patch allow repofilecache and storecache to do in own __init__() differently from each other.
Fri, 30 Jun 2017 01:47:48 +0900 manifest: apply checkambig=True only for root 00manifest.i
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 30 Jun 2017 01:47:48 +0900] rev 33177
manifest: apply checkambig=True only for root 00manifest.i This is a fix for my 14ad8e2a4abe, which used 'bool(dir)' as checkambig value for revlog.__init__(). I can't remember why I did so in 14ad8e2a4abe, but this is obviously wrong, because only root indexfile is cached via filecache-ed property of localrepository.
Sat, 01 Jul 2017 19:35:17 -0700 revlog: address review feedback for deltachain C implementation
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 01 Jul 2017 19:35:17 -0700] rev 33176
revlog: address review feedback for deltachain C implementation * Scope of "value" is reduced * index_baserev() is documented * Error is no longer redundantly set for -2 return values * Error values are compared <= -2 instead of == -2 to protect against odd failure scenarios
Sat, 01 Jul 2017 15:13:09 -0400 test-rebase-interruptions: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 Jul 2017 15:13:09 -0400] rev 33175
test-rebase-interruptions: stabilize for Windows External hooks end up launching cmd.exe, which knows nothing about $VAR syntax. For some reason, I thought that Mercurial would substitute in the value, in order to paper over the platform difference. But I can't find that in the documentation, and there's at least one other use of this pattern [1]. [1] https://www.mercurial-scm.org/repo/hg/file/tip/tests/test-histedit-fold.t#l477
Fri, 30 Jun 2017 23:15:09 -0700 drawdag: inline transaction() function
Martin von Zweigbergk <martinvonz@google.com> [Fri, 30 Jun 2017 23:15:09 -0700] rev 33174
drawdag: inline transaction() function I suspect Jun wrote the method before he learnt that Python 2.7 allows multiple context managers in a single with-clause.
Sun, 25 Jun 2017 12:41:34 -0700 revlog: C implementation of delta chain resolution
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 25 Jun 2017 12:41:34 -0700] rev 33173
revlog: C implementation of delta chain resolution I've seen revlog._deltachain() appear in a number of performance profiles. I suspect there are 2 reasons for this: 1. Delta chain resolution performs many index lookups, thus triggering population of index tuples. Creating possibly tens of thousands of PyObject will have overhead. 2. Delta chain resolution is a tight loop. By moving delta chain resolution to C, we can defer instantiation of full index entry tuples and make the loop faster courtesy of not running in Python. We can measure the impact to delta chain resolution via `hg perflogrevision` using the mozilla-central repo with a recent manifest having delta chain length of 33726: $ hg perfrevlogrevision -m 364895 ! full ! wall 0.367585 comb 0.370000 user 0.340000 sys 0.030000 (best of 27) ! wall 0.357581 comb 0.360000 user 0.350000 sys 0.010000 (best of 28) ! deltachain ! wall 0.010644 comb 0.010000 user 0.010000 sys 0.000000 (best of 270) ! wall 0.000292 comb 0.000000 user 0.000000 sys 0.000000 (best of 8729) $ hg perfrevlogrevision --cache -m 364895 ! deltachain ! wall 0.003904 comb 0.000000 user 0.000000 sys 0.000000 (best of 712) ! wall 0.000284 comb 0.000000 user 0.000000 sys 0.000000 (best of 9926) The first test measures savings from both not instantiating index entries and moving to C. The second test (which doesn't clear the index caches) essentially isolates the benefits of moving from Python to C. It still shows a 13.7x speedup (versus 36.4x). And there are multiple milliseconds of savings within the critical path for resolving revision data. I think that justifies the existence of C code. A more striking example of the benefits of this change can be demonstrated by timing `hg debugdeltachain -m` for the mozilla-central repo: $ time hg debugdeltachain -m > /dev/null before: 1057.4s after: 503.3s PyPy2.7 5.8.0: 220.0s It's worth noting that the C code isn't as optimal as it could be. We're still instantiating a new PyObject for every revision. A future optimization would be to reuse the PyObject on the cached index tuple. We could potentially also get wins by using a memory array of raw integers. There is also room for a delta chain cache on revlog instances. Of course, the best optimization is to implement revlog reading outside of Python so Python doesn't need to be concerned about the relatively expensive index entries and operations on them.
Wed, 28 Jun 2017 13:32:36 +0200 config: register the 'devel.strip-obsmarkers' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:36 +0200] rev 33172
config: register the 'devel.strip-obsmarkers' config The single explicit default that existed so far is converted to registered config value.
Wed, 28 Jun 2017 13:32:28 +0200 config: register the 'devel.serverrequirecert' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:28 +0200] rev 33171
config: register the 'devel.serverrequirecert' config
Wed, 28 Jun 2017 13:32:18 +0200 config: register the 'devel.serverexactprotocol' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:18 +0200] rev 33170
config: register the 'devel.serverexactprotocol' config
Wed, 28 Jun 2017 13:32:07 +0200 config: register the 'devel.servercafile' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:32:07 +0200] rev 33169
config: register the 'devel.servercafile' config
Wed, 28 Jun 2017 13:31:18 +0200 config: register the 'devel.disableloaddefaultcerts' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:31:18 +0200] rev 33168
config: register the 'devel.disableloaddefaultcerts' config
Wed, 28 Jun 2017 13:31:05 +0200 config: register the 'devel.check-relroot' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:31:05 +0200] rev 33167
config: register the 'devel.check-relroot' config
Wed, 28 Jun 2017 13:37:59 +0200 config: register the devel.check-locks config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:37:59 +0200] rev 33166
config: register the devel.check-locks config
Wed, 28 Jun 2017 13:25:33 +0200 config: register the 'devel.bundle2.debug' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:25:33 +0200] rev 33165
config: register the 'devel.bundle2.debug' config Existing explicit default are dropped now that the default is centralised.
Wed, 28 Jun 2017 13:19:40 +0200 config: register the 'devel.all-warnings' config
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:19:40 +0200] rev 33164
config: register the 'devel.all-warnings' config Let us start registering the existing option. I'm starting with the 'devel' section because it is full of useful things that are poorly documented. So registering these will more than other section.
Wed, 28 Jun 2017 14:53:54 -0700 rebase: always pass destination as revnum to _handleskippingobsolete()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 28 Jun 2017 14:53:54 -0700] rev 33163
rebase: always pass destination as revnum to _handleskippingobsolete() We were passing it as a revision number in one place and as a context in another. It worked because the only use was in "repo[dest].rev()", but it was confusing. By always passing a revision number, we can also remove that unnecessary lookup.
Thu, 29 Jun 2017 23:04:47 -0700 patch: remove unused fsbackend._join()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 29 Jun 2017 23:04:47 -0700] rev 33162
patch: remove unused fsbackend._join() The function lost its last caller in 2a095d3442e0 (patch: replace functions in fsbackend to use vfs, 2014-06-05) when the callers started relying on the opener to do the join.
Fri, 30 Jun 2017 09:07:24 -0700 patch: add close() to abstractbackend
Martin von Zweigbergk <martinvonz@google.com> [Fri, 30 Jun 2017 09:07:24 -0700] rev 33161
patch: add close() to abstractbackend patchbackend() seems to call it on an arbitrary backend, so it seems to be part of the API. Since all subclasses do something in their close() methods, I decided to let this one raise an exception rather than just pass.
Mon, 26 Jun 2017 15:46:24 +0200 log: add an extension hook-point in changeset_printer
Boris Feld <boris.feld@octobus.net> [Mon, 26 Jun 2017 15:46:24 +0200] rev 33160
log: add an extension hook-point in changeset_printer Extensions sometimes wants to add other information in the default log output format (when no templating is used). Add an empty function named '_exthook' for easing the extension life. Extensions will be able to wrap this function and collaborate to display additional information. Exthook is called after displaying troubles and just before displaying the files, extra and description. Add a new test file to test it and not pollute other test files.
Tue, 27 Jun 2017 00:01:17 -0700 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com> [Tue, 27 Jun 2017 00:01:17 -0700] rev 33159
drawdag: support obsmarker creation in comments This patch adds special comment handling so one can create obsmarkers in drawdag comments like "# replace: A -> B -> C", "# prune: X, Y, Z", "split: P -> M, N" and they are just self-explained.
Mon, 26 Jun 2017 23:31:53 -0700 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com> [Mon, 26 Jun 2017 23:31:53 -0700] rev 33158
test-drawdag: add a test for drawdag.py The drawdag script is useful but does not have a formal test. This patch adds it.
Mon, 26 Jun 2017 22:52:15 -0700 filemerge: convert a couple of wvfs calls in internal mergetools to contexts
Phil Cohen <phillco@fb.com> [Mon, 26 Jun 2017 22:52:15 -0700] rev 33157
filemerge: convert a couple of wvfs calls in internal mergetools to contexts One hitch is that sometimes fcd is actually an absentfilectx which does not expose any mutator functions. In order to still use the context functions, we look up the underlying workingfilectx to perform the write there. One alternate way would be to put the write functions on the absentfilectx and have them pass-through. While this makes the callsites cleaner, we would need to decide what its getter functions would return after this point, since returning None for `data` (and True for `isabsent()`) might no longer be correct after a write. I discussed with Sidd about just having the getters raise RuntimeErrors after a mutator has been called, but we actually call isabsent() in merge.py after running the internal merge tools.
Wed, 28 Jun 2017 13:50:20 +0200 configitems: support callable as a default value
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 13:50:20 +0200] rev 33156
configitems: support callable as a default value Yuya pointed out that using mutable value as the default could be problematic. To work around this we now support callable object as default value. This allows for creating new mutable objects on demand when needed.
Tue, 27 Jun 2017 02:06:15 +0200 obsutil: move 'getmarkers' to the new modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 02:06:15 +0200] rev 33155
obsutil: move 'getmarkers' to the new modules We have a new 'obsutil' module now. We move the high level utility there to bring 'obsolete.py' back to a more reasonable size.
Tue, 27 Jun 2017 01:51:40 +0200 obsutil: move the 'marker' class to the new modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:51:40 +0200] rev 33154
obsutil: move the 'marker' class to the new modules We have a new 'obsutil' module now. We move high level utility there to bring 'obsolete.py' back to a more reasonable size.
Tue, 27 Jun 2017 01:48:41 +0200 obsolete: delete three unused utility functions
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:48:41 +0200] rev 33153
obsolete: delete three unused utility functions None of this function has been used in the past 5 years, so I think it is safe to just kill them. All code accessing rich markers is using 'getmarkers(...)' instead (or raw markers).
Tue, 27 Jun 2017 01:40:34 +0200 obsutil: move 'foreground' to the new modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:40:34 +0200] rev 33152
obsutil: move 'foreground' to the new modules We have a new 'obsutil' module now. We move the high level utility there to bring 'obsolete.py' back to a more reasonable size.
Tue, 27 Jun 2017 01:36:20 +0200 obsutil: move 'allsuccessors' to the new modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:36:20 +0200] rev 33151
obsutil: move 'allsuccessors' to the new modules We have a new 'obsutil' module now. We move the high level utility there to bring 'obsolete.py' back to a more reasonable size.
Tue, 27 Jun 2017 01:31:18 +0200 obsutil: move 'allprecursors' to the new modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:31:18 +0200] rev 33150
obsutil: move 'allprecursors' to the new modules We have a new 'obsutil' module now. We move the high level utility there to bring 'obsolete.py' back to a more reasonable size.
Tue, 27 Jun 2017 01:11:56 +0200 obsutil: move 'exclusivemarkers' to the new modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:11:56 +0200] rev 33149
obsutil: move 'exclusivemarkers' to the new modules We have a new 'obsutil' module now. We move the high level utility there to bring 'obsolete.py' back to a more reasonable size.
Tue, 27 Jun 2017 01:03:01 +0200 obsutil: move 'successorssets' to the new modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 27 Jun 2017 01:03:01 +0200] rev 33148
obsutil: move 'successorssets' to the new modules We have a new 'obsutil' module now. We move this high level utility there to bring 'obsolete.py' back to a more reasonable size.
Thu, 29 Jun 2017 11:29:19 -0700 tests: fix variable name regular expression in _genrestoreenv()
Adam Simpkins <simpkins@fb.com> [Thu, 29 Jun 2017 11:29:19 -0700] rev 33147
tests: fix variable name regular expression in _genrestoreenv() Update the code to correctly anchor the expression on the end of the name, to require that the entire name match this expression. It was already anchored at the start by using re.match(), but this does not anchor it at the end.
Thu, 29 Jun 2017 15:21:52 -0700 merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Thu, 29 Jun 2017 15:21:52 -0700] rev 33146
merge with stable
Wed, 28 Jun 2017 17:41:25 +0200 pushrace: avoid crash on bare push when using concurrent push mode
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 28 Jun 2017 17:41:25 +0200] rev 33145
pushrace: avoid crash on bare push when using concurrent push mode If the remote is empty, we do now bother computing head changes and the 'pushbranchmap' attribute stays at None. We now handle and tests this case.
Sun, 25 Jun 2017 22:20:37 -0700 show: config option to register aliases for views
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 25 Jun 2017 22:20:37 -0700] rev 33144
show: config option to register aliases for views As part of using `hg show` in my daily workflow, I've found it slightly annoying to have to type full view names, complete with a space. I've locally registered an alias for "swork = show work." I think others will have this same complaint and could benefit from some automation to streamline the creation of aliases. So, this commit introduces a config option that allows `hg show` views to be automatically aliased using a given prefix. e.g. a value of "s" will automatically register "swork" and "sbookmarks." Multiple values can be given for ultimate flexibility. This arguably isn't needed now. But since we don't register aliases if there will be a collision and we're bound to have a collision, it makes sense to allow multiple prefixes so specific views can avoid collisions by using different prefixes.
Sun, 18 Jun 2017 20:49:08 +0200 blackbox: use a human readable version of the default
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 18 Jun 2017 20:49:08 +0200] rev 33143
blackbox: use a human readable version of the default Now that the default value is also converted we can use a human readable version for it. This will be useful if we start to automatically display the default config value in various place.
Sat, 17 Jun 2017 13:21:06 +0200 configitems: register 'blackbox.maxsize' as an example of 'configbytes'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 13:21:06 +0200] rev 33142
configitems: register 'blackbox.maxsize' as an example of 'configbytes' This exercise the default value handling in 'configbytes'.
Sat, 17 Jun 2017 13:41:28 +0200 blackbox: minor code reordering
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 13:41:28 +0200] rev 33141
blackbox: minor code reordering The version declaration should come first in my opinion. This will help gather the command table with the config table.
Sun, 18 Jun 2017 19:52:54 +0200 configitems: add a devel warning for extensions items overiding core one
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 18 Jun 2017 19:52:54 +0200] rev 33140
configitems: add a devel warning for extensions items overiding core one We do not want such case to pass silently. In the future we'll likely have useful tool for an extension to alter the existing definition in core.
Sat, 17 Jun 2017 13:48:20 +0200 configitems: add an official API for extensions to register config item
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 13:48:20 +0200] rev 33139
configitems: add an official API for extensions to register config item Extensions can have a 'configtable' mapping and use 'registrar.configitem(table)' to retrieve the registration function. This behave in the same way as the other way for extensions to register new items (commands, colors, etc).
Sat, 17 Jun 2017 13:38:53 +0200 configitems: extract the logic to build a registrar on any configtable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 13:38:53 +0200] rev 33138
configitems: extract the logic to build a registrar on any configtable Having the logic available independently from the mapping used is a necessary step toward extensions support.
Mon, 19 Jun 2017 01:08:11 +0200 obsolete: skip 'changectx' usage in unstable computation
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Jun 2017 01:08:11 +0200] rev 33137
obsolete: skip 'changectx' usage in unstable computation We simplify the unstable computation code, skipping the expensive creation of changectx object. We focus on efficient set operation and revnumber centric functions. In my mercurial development repository, this provides a 3x speedup to the function: before: 5.319 ms after: 1.844 ms repo details: total changesets: 40886 obsolete changesets: 7756 mutable (not obsolete): 293 unstable: 30
Sun, 18 Jun 2017 22:38:11 +0200 obsolete: provide a small function to retrieve all mutable revisions
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 18 Jun 2017 22:38:11 +0200] rev 33136
obsolete: provide a small function to retrieve all mutable revisions More obsolescence related algorithm focus on the mutable revision. We provide a tiny utility function to make it easy to access this set.
Tue, 27 Jun 2017 14:38:00 -0700 bundle2: add debug info about the number of stream params
Siddharth Agarwal <sid0@fb.com> [Tue, 27 Jun 2017 14:38:00 -0700] rev 33135
bundle2: add debug info about the number of stream params Seems like the %i was never substituted.
Tue, 27 Jun 2017 14:30:55 -0700 bundle2: add some debugging information to the not-a-bundle error
Siddharth Agarwal <sid0@fb.com> [Tue, 27 Jun 2017 14:30:55 -0700] rev 33134
bundle2: add some debugging information to the not-a-bundle error I found this useful while trying to debug wireproto-related issues.
Wed, 28 Jun 2017 12:23:22 -0700 tests: more completely restore the environment in syshgenv
Adam Simpkins <simpkins@fb.com> [Wed, 28 Jun 2017 12:23:22 -0700] rev 33133
tests: more completely restore the environment in syshgenv Update the syshgenv function to attempt to completely restore the original environment, rather than only updating a few specific variables. run_tests.py now generates a shell script that can be used to restore the original environment, and syshgenv sources it. This is a bit more complicated than the previous code, but should do a better job of running the system hg in the correct environment. I've tested it on Linux using python 2.x, but let me know if it causes issues in other environments. I'm not terribly familiar with how the tests get run on Windows, for instance, and how the environment needs to be updated there.
Wed, 28 Jun 2017 13:45:51 -0700 tests: do not use system hg if it does not have "files" command
Jun Wu <quark@fb.com> [Wed, 28 Jun 2017 13:45:51 -0700] rev 33132
tests: do not use system hg if it does not have "files" command Ancient hg does not have "hg files" so test-check-*.t will fail with "unknown command 'files'": $ hg files hg: unknown command 'files' $ hg --version Mercurial Distributed SCM (version 2.6.2) Test "hg files" and give up using syshg if it does not have "files" command.
Wed, 28 Jun 2017 10:50:37 -0700 setup: fix runcmd() usage on darwin
Adam Simpkins <simpkins@fb.com> [Wed, 28 Jun 2017 10:50:37 -0700] rev 33131
setup: fix runcmd() usage on darwin Fix one invocation of runcmd() that was missed in the recent change to make runcmd() also return the process exit status.
Tue, 27 Jun 2017 21:16:08 +0530 py3: update the python3-whitelist with new tests which pass on Python 3
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 27 Jun 2017 21:16:08 +0530] rev 33130
py3: update the python3-whitelist with new tests which pass on Python 3 We have now 34 tests passing on Python 3.
Wed, 28 Jun 2017 06:49:01 -0700 setup: fix localhgenv
Jun Wu <quark@fb.com> [Wed, 28 Jun 2017 06:49:01 -0700] rev 33129
setup: fix localhgenv It should return env as a dict instead of None.
Tue, 27 Jun 2017 17:24:31 -0700 tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com> [Tue, 27 Jun 2017 17:24:31 -0700] rev 33128
tests: use the system hg for examining the local repository Most test scripts use "hg" to interact with a temporary test repository. However a few tests also want to run hg commands to interact with the local repository containing the mercurial source code. Notably, many of the test-check-* tests want to check local files and commit messages. These tests were previously using the version of hg being tested to query the source repository. However, this will fail if the source repository requires extensions or other settings not supported by the version of mercurial being tested. The source repository was typically initially cloned using the system hg installation, so we should use the system hg installation to query it. There was already a helpers-testrepo.sh script designed to help cope with different requirements for the source repository versus the test repositories. However, it only handled the evolve extension. This new behavior works with any extensions that are different between the system installation and the test installation.
Tue, 27 Jun 2017 17:24:31 -0700 tests: save the original PATH and PYTHONPATH variables
Adam Simpkins <simpkins@fb.com> [Tue, 27 Jun 2017 17:24:31 -0700] rev 33127
tests: save the original PATH and PYTHONPATH variables When running the tests, define ORIG_PATH and ORIG_PYTHONPATH environment variables that contain the original contents of PATH and PYTHONPATH, before they were modified by run-tests.py This will make it possible for tests to refer to the original contents of these variables if necessary. In particular, this is necessary for invoking the correct version of hg for examining the local repository (the mercurial repository itself, not the temporary test repositories). Various tests examine the local repository to check the file lists and contents of commit messages.
Tue, 27 Jun 2017 16:15:32 -0700 setup: prefer using the system hg to interact with the local repository
Adam Simpkins <simpkins@fb.com> [Tue, 27 Jun 2017 16:15:32 -0700] rev 33126
setup: prefer using the system hg to interact with the local repository Add a findhg() function that tries to be smarter about figuring out how to run hg for examining the local repository. It first tries running "hg" from the user's PATH, with the default HGRCPATH settings intact, but with HGPLAIN enabled. This will generally use the same version of mercurial and the same settings used to originally clone the repository, and should have a higher chance of working successfully than trying to run the hg script from the local repository. If that fails findhg() falls back to the existing behavior of running the local hg script.
Tue, 27 Jun 2017 16:15:32 -0700 setup: replace runhg() with an hgcommand helper class
Adam Simpkins <simpkins@fb.com> [Tue, 27 Jun 2017 16:15:32 -0700] rev 33125
setup: replace runhg() with an hgcommand helper class Replace the runhg() function with an hgcommand helper class. hgcommand has as run() function similar to runhg(), but no longer requires the caller to pass in the exact path to python and the hg script, and the environment settings for invoking hg. For now this diff contains no behavior changes, but in the future this will make it easier for the hgcommand helper class to more intelligently figure out the proper way to invoke hg.
Mon, 26 Jun 2017 11:31:30 -0700 setup: move environment computation into a helper function
Adam Simpkins <simpkins@fb.com> [Mon, 26 Jun 2017 11:31:30 -0700] rev 33124
setup: move environment computation into a helper function Add a helper function to compute the environment used for invoking mercurial, rather than doing this computation entirely at global scope. This will make it easier to do some subsequent refactoring.
Mon, 26 Jun 2017 11:31:30 -0700 setup: update runcmd() to also return the exit status
Adam Simpkins <simpkins@fb.com> [Mon, 26 Jun 2017 11:31:30 -0700] rev 33123
setup: update runcmd() to also return the exit status Update the runcmd() helper function so it also returns the process exit status. This allows callers to more definitively determine if a command failed, rather than testing only for the presence of data on stderr. I don't expect this to have any behavioral changes for now: the commands invoked by setup generally should print data on stderr if and only if they failed.
Mon, 26 Jun 2017 11:31:30 -0700 setup: fail if we cannot determine the version number
Adam Simpkins <simpkins@fb.com> [Mon, 26 Jun 2017 11:31:30 -0700] rev 33122
setup: fail if we cannot determine the version number If running hg fails, exit the setup script unsuccessfully, rather than proceeding to use a bogus version of "+0-". Using an invalid version number causes various tests to fail later. Failing early makes it easier to identify the source of the problem. It is currently easy for setup.py to fail this way since it sets HGRCPTH to the empty string before running "hg", which may often disable extensions necessary to interact with the local repository.
Tue, 27 Jun 2017 23:50:22 +0900 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org> [Tue, 27 Jun 2017 23:50:22 +0900] rev 33121
smartset: fix generatorset.last() to not return the first element (issue5609)
Mon, 26 Jun 2017 21:11:02 -0700 strip: respect the backup option in stripcallback
Jun Wu <quark@fb.com> [Mon, 26 Jun 2017 21:11:02 -0700] rev 33120
strip: respect the backup option in stripcallback The backup option was mistakenly ignored. It should be respected. Thanks Martin von Zweigbergk for finding this out!
Mon, 26 Jun 2017 23:58:27 +0530 py3: use pycompat.bytestr() to convert str to bytes
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Jun 2017 23:58:27 +0530] rev 33119
py3: use pycompat.bytestr() to convert str to bytes
Mon, 26 Jun 2017 23:57:49 +0530 py3: pass the memoryview object into bytes() to get the value
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Jun 2017 23:57:49 +0530] rev 33118
py3: pass the memoryview object into bytes() to get the value
Mon, 26 Jun 2017 17:23:10 +0530 py3: use pycompat.bytestr instead of str
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Jun 2017 17:23:10 +0530] rev 33117
py3: use pycompat.bytestr instead of str
Mon, 26 Jun 2017 17:22:45 +0530 py3: use '%d' to convert integers to bytes
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Jun 2017 17:22:45 +0530] rev 33116
py3: use '%d' to convert integers to bytes
Sun, 25 Jun 2017 08:36:51 +0530 py3: slice over bytes to prevent getting it's ascii value
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 25 Jun 2017 08:36:51 +0530] rev 33115
py3: slice over bytes to prevent getting it's ascii value
Tue, 27 Jun 2017 00:23:32 +0530 py3: use pycompat.strkwargs() to convert kwargs keys to str
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 27 Jun 2017 00:23:32 +0530] rev 33114
py3: use pycompat.strkwargs() to convert kwargs keys to str
Tue, 27 Jun 2017 00:15:56 +0530 py3: use r'' to prevent the addition of b'' by transformer
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 27 Jun 2017 00:15:56 +0530] rev 33113
py3: use r'' to prevent the addition of b'' by transformer There are cases in opts handling in debugcommands.py where we don't need to convert opts keys back to bytes as there are some handful cases and no other function using opts value. Using r'', we prevent the transformer to add a b'' which will keep the value str.
Tue, 27 Jun 2017 00:20:55 +0530 py3: use pycompat.byteskwargs() to convert kwargs' keys to bytes
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 27 Jun 2017 00:20:55 +0530] rev 33112
py3: use pycompat.byteskwargs() to convert kwargs' keys to bytes This is used where ever required like where kwargs are passed into ui.formatter(), scmutil.match() or cmdutil.openrevlog() which expects bytes.
Tue, 27 Jun 2017 02:24:38 +0900 tests: use cgienv to minimize environment setup at hgweb tests
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 27 Jun 2017 02:24:38 +0900] rev 33111
tests: use cgienv to minimize environment setup at hgweb tests This patch follows other hgweb tests.
Tue, 27 Jun 2017 02:24:37 +0900 tests: avoid test failure for mangling path-like string by MSYS
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 27 Jun 2017 02:24:37 +0900] rev 33110
tests: avoid test failure for mangling path-like string by MSYS
Sun, 25 Jun 2017 08:20:05 +0530 py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 25 Jun 2017 08:20:05 +0530] rev 33109
py3: make sure commands name are bytes in tests
Sun, 25 Jun 2017 03:11:55 +0530 py3: add b'' to make the regex pattern bytes
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 25 Jun 2017 03:11:55 +0530] rev 33108
py3: add b'' to make the regex pattern bytes
Mon, 26 Jun 2017 17:20:46 +0530 py3: use hex() to convert the hash to bytes
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Jun 2017 17:20:46 +0530] rev 33107
py3: use hex() to convert the hash to bytes
Sat, 24 Jun 2017 19:57:50 +0530 py3: add b'' to make a triple quoted string bytes on Python 3
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 24 Jun 2017 19:57:50 +0530] rev 33106
py3: add b'' to make a triple quoted string bytes on Python 3 Transformer does not adds b'' in front of triple quoted strings to prevent converting docs to bytes.
Sat, 24 Jun 2017 19:55:41 +0530 py3: add tests to show `hg bookmarks` and `hg branches` work on Python 3
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 24 Jun 2017 19:55:41 +0530] rev 33105
py3: add tests to show `hg bookmarks` and `hg branches` work on Python 3
Sat, 24 Jun 2017 19:55:01 +0530 py3: fix kwargs handling for `hg bookmarks`
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 24 Jun 2017 19:55:01 +0530] rev 33104
py3: fix kwargs handling for `hg bookmarks`
Mon, 26 Jun 2017 09:37:16 +0900 identify: provide changectx to templater
Yuya Nishihara <yuya@tcha.org> [Mon, 26 Jun 2017 09:37:16 +0900] rev 33103
identify: provide changectx to templater
Mon, 26 Jun 2017 09:33:01 +0900 formatter: proxy fm.context() through converter
Yuya Nishihara <yuya@tcha.org> [Mon, 26 Jun 2017 09:33:01 +0900] rev 33102
formatter: proxy fm.context() through converter Otherwise nested template formatter would not see the context objects. It's just a boolean flag now. We might want to change it to 'ctxs -> items' function so changectx attributes are populated automatically in JSON, but I'm not sure.
Mon, 26 Jun 2017 09:18:55 +0900 identify: change p1/p2 to a list of parents
Yuya Nishihara <yuya@tcha.org> [Mon, 26 Jun 2017 09:18:55 +0900] rev 33101
identify: change p1/p2 to a list of parents It makes sense because the nested data structure is a list of items.
Sun, 25 Jun 2017 13:31:56 -0700 scmutil: add a cleanupnodes method for developers
Jun Wu <quark@fb.com> [Sun, 25 Jun 2017 13:31:56 -0700] rev 33100
scmutil: add a cleanupnodes method for developers It's now common that an old node gets replaced by zero or more new nodes, that could happen with amend, rebase, histedit, etc. And it's a common requirement to do bookmark movements, strip or obsolete nodes and even moving working copy parent. Previously, amend, rebase, history have their own logic doing the above. This patch is an attempt to unify them and future code. This enables new developers to be able to do "replace X with Y" thing correctly, without any knowledge about bookmarks, strip or obsstore. The next step will be migrating rebase to the new API, so it works inside a transaction, and its code could be simplified.
Sun, 25 Jun 2017 10:38:45 -0700 strip: add a delayedstrip method that works in a transaction
Jun Wu <quark@fb.com> [Sun, 25 Jun 2017 10:38:45 -0700] rev 33099
strip: add a delayedstrip method that works in a transaction For long, the fact that strip does not work inside a transaction and some code has to work with both obsstore and fallback to strip lead to duplicated code like: with repo.transaction(): .... if obsstore: obsstore.createmarkers(...) if not obsstore: repair.strip(...) Things get more complex when you want to call something which may call strip under the hood. Like you cannot simply write: with repo.transaction(): .... rebasemod.rebase(...) # may call "strip", so this doesn't work But you do want rebase to run inside a same transaction if possible, so the code may look like: with repo.transaction(): .... if obsstore: rebasemod.rebase(...) obsstore.createmarkers(...) if not obsstore: rebasemod.rebase(...) repair.strip(...) That's ugly and error-prone. Ideally it's possible to just write: with repo.transaction(): rebasemod.rebase(...) saferemovenodes(...) This patch is the first step towards that. It adds a "delayedstrip" method to repair.py which maintains a postclose callback in the transaction object.
Sun, 25 Jun 2017 22:30:14 -0700 workingfilectx: add audit() as a wrapper for wvfs.audit()
Phil Cohen <phillco@fb.com> [Sun, 25 Jun 2017 22:30:14 -0700] rev 33098
workingfilectx: add audit() as a wrapper for wvfs.audit()
Sun, 25 Jun 2017 22:30:14 -0700 workingfilectx: add backgroundclose as a kwarg to write()
Phil Cohen <phillco@fb.com> [Sun, 25 Jun 2017 22:30:14 -0700] rev 33097
workingfilectx: add backgroundclose as a kwarg to write() This is necessary because some callers in merge.py pass backgroundclose=True when writing. As with previous changes in this series, this should be a no-op.
Sun, 25 Jun 2017 22:29:09 -0700 merge: change repo.wvfs.setflags calls to a new wctx[f].setflags function
Phil Cohen <phillco@fb.com> [Sun, 25 Jun 2017 22:29:09 -0700] rev 33096
merge: change repo.wvfs.setflags calls to a new wctx[f].setflags function As with previous changes in this series, this should be a no-op.
Sun, 25 Jun 2017 17:00:15 -0700 merge: convert repo.wwrite() calls to wctx[f].write()
Phil Cohen <phillco@fb.com> [Sun, 25 Jun 2017 17:00:15 -0700] rev 33095
merge: convert repo.wwrite() calls to wctx[f].write() As with the previous patch in this series, workingfilectx.write() is a direct call to repo.wwrite(), so this change should be a no-op.
Sun, 25 Jun 2017 16:58:26 -0700 merge: replace repo.wvfs.unlinkpath() with calls to wctx[f].remove()
Phil Cohen <phillco@fb.com> [Sun, 25 Jun 2017 16:58:26 -0700] rev 33094
merge: replace repo.wvfs.unlinkpath() with calls to wctx[f].remove() The code inside workingfilectx.remove() is a straight call to repo.wvfs.unlinkpath, so this should be a no-op.
Sun, 25 Jun 2017 16:56:49 -0700 merge: pass wctx to batchremove and batchget
Phil Cohen <phillco@fb.com> [Sun, 25 Jun 2017 16:56:49 -0700] rev 33093
merge: pass wctx to batchremove and batchget We would like to migrate direct calls of repo.wvfs/wwrite/wread/etc to a call on the relevant workingfilectx, both as a cleanup (to reduce the number of working copy functions on `repo`), and also to facilitate an in-memory merge that doesn't write to the working copy. In order to do that, the first step is to ensure we pass the target wctx around and perform our writes and reads on it. Later, this object might become a memctx.
Sat, 24 Jun 2017 23:05:57 +0900 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Jun 2017 23:05:57 +0900] rev 33092
revset: add depth limit to descendants() (issue5374) This is naive implementation using two-pass scanning. Tracking descendants isn't an easy problem if both start and stop depths are specified. It's impractical to remember all possible depths of each node while scanning from roots to descendants because the number of depths explodes. Instead, we could cache (min, max) depths as a good approximation and track ancestors back when needed, but that's likely to have off-by-one bug. Since this implementation appears not significantly slower, and is quite straightforward, I think it's good enough for practical use cases. The time and space complexity is O(n) ish. revisions: 0) 1-pass scanning with (min, max)-depth cache (worst-case quadratic) 1) 2-pass scanning (this version) repository: mozilla-central # descendants(0) (for reference) *) 0.430353 # descendants(0, depth=1000) 0) 0.264889 1) 0.398289 # descendants(limit(tip:0, 1, offset=10000), depth=1000) 0) 0.025478 1) 0.029099 # descendants(0, depth=2000, startdepth=1000) 0) painfully slow (due to quadratic backtracking of ancestors) 1) 1.531138
Sat, 24 Jun 2017 23:35:03 +0900 dagop: make walk direction switchable so it can track descendants
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Jun 2017 23:35:03 +0900] rev 33091
dagop: make walk direction switchable so it can track descendants # ancestors(tip) using hg repo 2) 0.068527 3) 0.069097
Sat, 24 Jun 2017 23:30:51 +0900 dagop: factor out generator of ancestor nodes
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Jun 2017 23:30:51 +0900] rev 33090
dagop: factor out generator of ancestor nodes # ancestors(tip) using hg repo 1) 0.068976 2) 0.068527
Sat, 24 Jun 2017 23:22:45 +0900 dagop: factor out pfunc from revancestors() generator
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Jun 2017 23:22:45 +0900] rev 33089
dagop: factor out pfunc from revancestors() generator This generator will be reused for tracking descendants with depth limit. # ancestors(tip) using hg repo 0) 0.065868 1) 0.068976
(0) -30000 -10000 -3000 -1000 -120 +120 +1000 +3000 +10000 tip