D5638: branchmap: encapsulate cache updating in the map itself

2019-02-08 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG328ca3b9e545: branchmap: encapsulate cache updating in the map itself (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5635: branchmap: make branchcache responsible for reading

2019-02-05 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGbf7fb97aecf1: branchmap: make branchcache responsible for reading (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5637: branchmap: add some clarifications and clean up flow

2019-02-05 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc795c462b1d6: branchmap: add some clarifications and clean up flow (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5636: branchmap: updating triggers a write

2019-02-05 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGeb7ce452e0fb: branchmap: updating triggers a write (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5636?vs=13331=13807

D5638: branchmap: encapsulate cache updating in the map itself

2019-01-28 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 13543. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5638?vs=13502=13543 REVISION DETAIL https://phab.mercurial-scm.org/D5638 AFFECTED FILES contrib/perf.py mercurial/branchmap.py mercurial/localrepo.py

D5635: branchmap: make branchcache responsible for reading

2019-01-28 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 13542. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5635?vs=13501=13542 REVISION DETAIL https://phab.mercurial-scm.org/D5635 AFFECTED FILES contrib/perf.py mercurial/branchmap.py CHANGE DETAILS diff --git

D5638: branchmap: encapsulate cache updating in the map itself

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters added inline comments. INLINE COMMENTS > martinvonz wrote in perf.py:2299 > Same here: I think this needs to be made compatible with both versions > (before and after this patch) I'll wait for confirmation; see the other patch. > martinvonz wrote in localrepo.py:2077 > Hmm, it's

D5638: branchmap: encapsulate cache updating in the map itself

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 13502. mjpieters marked an inline comment as done. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5638?vs=1=13502 REVISION DETAIL https://phab.mercurial-scm.org/D5638 AFFECTED FILES contrib/perf.py

D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 13501. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5635?vs=13330=13501 REVISION DETAIL https://phab.mercurial-scm.org/D5635 AFFECTED FILES contrib/perf.py mercurial/branchmap.py CHANGE DETAILS diff --git

D5636: branchmap: updating triggers a write

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters added inline comments. INLINE COMMENTS > martinvonz wrote in discovery.py:242-243 > Indentation seems bad (seemed bad before too) It's a generator expression as single argument. I was deliberately not making style changes in these patches, so I didn't touch the indentation here. If

D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread mjpieters (Martijn Pieters)
mjpieters added a subscriber: yuja. mjpieters added inline comments. INLINE COMMENTS > martinvonz wrote in perf.py:2326 > As I was recently reminded by Yuya, the perf commands are supposed to be > compatible with older versions of hg too, and this doesn't seem to be > compatible with the

D5290: branchmap: rename partial -> bcache

2019-01-25 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG3461814417f3: branchmap: rename partial - bcache (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5290?vs=13329=13490

D5290: branchmap: rename partial -> bcache

2019-01-21 Thread mjpieters (Martijn Pieters)
mjpieters added a comment. @yuja: you wanted separate commits, you got separate commits. :-) (and apologies for taking so long) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5290 To: mjpieters, #hg-reviewers Cc: yuja, mercurial-devel

D5292: branchmap: make it easier for extensions not to break branchcache

2019-01-21 Thread mjpieters (Martijn Pieters)
mjpieters abandoned this revision. mjpieters added a comment. This would need more thought then; the evolve/topic/topicmap codebase wraps the whole branchmap.branchcache class and mucks about with a context manager to re-instate the right name in the branchmap globals so super() doesn't

D5638: branchmap: encapsulate cache updating in the map itself

2019-01-21 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Rather than have a repository update the cache, move handling of cache updates into the branchmap module, in the form of a custom mapping class. This makes

D5637: branchmap: add some clarifications and clean up flow

2019-01-21 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY - Remove indentation where it is not needed. - Swap the subset test branches to follow along logically and put the 'empty' case last. REPOSITORY rHG

D5635: branchmap: make branchcache responsible for reading

2019-01-21 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Encapsulate reading in a classmethod, to make it clear what kind of object is being handled. This is part of a stack of refactoring changes to help

D5636: branchmap: updating triggers a write

2019-01-21 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Rather than separate updating and writing, create a subclass that doesn't write on update. This minimises chances we forget to write out updates somewhere.

D5290: branchmap: rename partial -> bcache

2019-01-21 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 13329. mjpieters edited the summary of this revision. mjpieters retitled this revision from "branchmap: refactor for better encapsulation" to "branchmap: rename partial -> bcache". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5290: branchmap: refactor for better encapsulation

2018-11-22 Thread mjpieters (Martijn Pieters)
mjpieters added a comment. The goal of this refactor is to bring clarity to the branchmap cache behaviour, and to make it easier to add performance improvements (in an upcoming additional series of patches). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5290

D5292: branchmap: make it easier for extensions not to break branchcache

2018-11-21 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The _branchcache global gives us a reference for super() to use even if an extension subclasses branchmap.branchcache then replaces the class in the module.

D5064: style: run black on a subset of mercurial

2018-11-20 Thread mjpieters (Martijn Pieters)
mjpieters added a comment. In https://phab.mercurial-scm.org/D5064#78545, @av6 wrote: > I look at the changes and see nitpicks at best. On the one hand, black proved better than any linter that we can already write consistent code. On the other, if black were a linter... I'd switch to

D5290: branchmap: refactor for better encapsulation

2018-11-20 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5290 AFFECTED FILES contrib/perf.py mercurial/branchmap.py mercurial/discovery.py

D5111: branchmap: remove redundant sort

2018-10-16 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5644f7c8982e: branchmap: remove redundant sort (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5111?vs=12157=12158

D5111: branchmap: remove redundant sort

2018-10-16 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY There is absoluty no benefit in sorting a list that's being merged into a set on the next line. The changelog.ancestors() call later on also doesn't benefit

D5105: style: drop requirement to only use single lines between top-level objects

2018-10-16 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG47084b5ffd80: style: drop requirement to only use single lines between top-level objects (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5105: style: drop requirement to only use single lines between top-level objects

2018-10-14 Thread mjpieters (Martijn Pieters)
mjpieters added a subscriber: indygreg. mjpieters added a comment. This was split out from https://phab.mercurial-scm.org/D5064 (cc @indygreg ) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5105 To: mjpieters, #hg-reviewers Cc: indygreg, mercurial-devel

D5064: style: run black on a subset of mercurial

2018-10-14 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 12135. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5064?vs=12059=12135 REVISION DETAIL https://phab.mercurial-scm.org/D5064 AFFECTED FILES contrib/import-checker.py mercurial/cacheutil.py

D5105: style: drop requirement to only use single lines between top-level objects

2018-10-14 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5105 AFFECTED FILES contrib/check-commit CHANGE DETAILS diff --git a/contrib/check-commit

D5079: py3: use py3 as the test tag, dropping the k

2018-10-13 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG8cf459d8b111: py3: use py3 as the test tag, dropping the k (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D5079: py3: use py3 as the test tag, dropping the k

2018-10-13 Thread mjpieters (Martijn Pieters)
mjpieters added a comment. Note: I undid the change to `mercurial/thirdparty/zope/interface/_compat.py` as it should not have been changed to begin with. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5079 To: mjpieters, #hg-reviewers, pulkit, durin42 Cc:

D5079: py3: use py3 as the test tag, dropping the k

2018-10-13 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 12091. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5079?vs=12068=12091 REVISION DETAIL https://phab.mercurial-scm.org/D5079 AFFECTED FILES mercurial/help.py tests/hghave.py tests/run-tests.py

D5079: py3: use py3 as the test tag, dropping the k

2018-10-13 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5079 AFFECTED FILES mercurial/help.py mercurial/thirdparty/zope/interface/_compat.py

D5064: style: run black on a subset of mercurial

2018-10-13 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 12059. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5064?vs=12047=12059 REVISION DETAIL https://phab.mercurial-scm.org/D5064 AFFECTED FILES contrib/check-commit contrib/import-checker.py

D5064: style: run black on a subset of mercurial

2018-10-13 Thread mjpieters (Martijn Pieters)
mjpieters updated this revision to Diff 12047. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5064?vs=12030=12047 REVISION DETAIL https://phab.mercurial-scm.org/D5064 AFFECTED FILES mercurial/cacheutil.py mercurial/diffhelper.py

D5064: style: run black on a subset of mercurial

2018-10-13 Thread mjpieters (Martijn Pieters)
mjpieters added a comment. The `import` parentheses collapsing is described here: https://github.com/ambv/black#parentheses. The behavior is not configurable. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5064 To: mjpieters, indygreg, durin42, #hg-reviewers

D5064: style: run black on a subset of mercurial

2018-10-13 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. mjpieters added reviewers: indygreg, durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This applied black to the 20 smallest files in mercurial/: ls -S1 mercurial/*.py | tail -n20 | xargs black

D4280: perf: time loading branchmap caches

2018-08-15 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGf16c3efe35e3: perf: time loading branchmap caches (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4280?vs=10352=10373

D4281: branchmap: load branchmap as an iterable

2018-08-15 Thread mjpieters (Martijn Pieters)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9a800691f075: branchmap: load branchmap as an iterable (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4281?vs=10353=10374

D4281: branchmap: load branchmap as an iterable

2018-08-13 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This avoids reading all the file into memory if the cache turns out to be invalid. REPOSITORY rHG Mercurial REVISION DETAIL

D4280: perf: time loading branchmap caches

2018-08-13 Thread mjpieters (Martijn Pieters)
mjpieters created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4280 AFFECTED FILES contrib/perf.py CHANGE DETAILS diff --git a/contrib/perf.py b/contrib/perf.py

D472: extensions: make wrapfunction() return a context manager

2017-08-24 Thread mjpieters (Martijn Pieters)
mjpieters accepted this revision. mjpieters added a comment. I was being too strict; like `open()` it's sometimes fine to apply the action in the constructor. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D472 To: martinvonz, #hg-reviewers, quark, mjpieters

D472: extensions: make wrapfunction() return a context manager

2017-08-23 Thread mjpieters (Martijn Pieters)
mjpieters added inline comments. INLINE COMMENTS > extensions.py:408-412 > +origfn = getattr(container, funcname) > +assert callable(origfn) > +wrap = bind(wrapper, origfn) > +_updatewrapper(wrap, origfn, wrapper) > +setattr(container, funcname, wrap)