##// END OF EJS Templates
copies: calculate mergecopies() based on pathcopies()...
copies: calculate mergecopies() based on pathcopies() When copies are stored in changesets, we need a changeset-centric version of mergecopies() just like we have a changeset-centric version of pathcopies(). I think the natural way of thinking about mergecopies() is in terms of pathcopies() from the base to each of the commits. So if we can rewrite mergecopies() based on two such pathcopies() calls, we'll get the changeset-centric version for free. That's what this patch does. A nice bonus is that it ends up being a lot simpler. mergecopies() has accumulated a lot of technical debt over time. One good example is the code for dealing with grafts (the "partial/incomplete/dirty" stuff). Since pathcopies() already deals with backwards renames and ping-pong renames, we get that for free. I've run tests with hard-coded debug logging for "fullcopy" and while I haven't looked at every difference it produces, all the ones I have looked at seemed reasonable to me. I'm a little surprised that no more tests fail when run with '--extra-config-opt experimental.copies.read-from=compatibility' compared to before this patch. This patch also fixes the broken cases in test-annotate.t and test-fastannotate.t. It also enables the part of test-copies.t that was previously disabled exactly because mergecopies() needed to get a changeset-centric version. One drawback of the rewritten code is that we may now make remotefilelog prefetch more files. We used to prefetch files that were unique to either side of the merge compared to the other. We now prefetch files that are unique to either side of the merge compared to the base. This means that if you added the same file to each side, we would not prefetch it before, but we would now. Such cases are probably quite rare, but one likely scenario where they happen is when moving from a commit to its successor (or the other way around). The user will probably already have the files in the cache in such cases, so it's probably not a big deal. Some timings for calculating mergecopies between two revisions (revisions shown on each line, all using the common ancestor as base): In the hg repo: 4.8 4.9: 0.21s -> 0.21s 4.0 4.8: 0.35s -> 0.63s In and old copy of the mozilla-unified repo: FIREFOX_BETA_60_BASE^ FIREFOX_BETA_60_BASE: 0.82s -> 0.82s FIREFOX_NIGHTLY_59_END FIREFOX_BETA_60_BASE: 2.5s -> 2.6s FIREFOX_BETA_59_END FIREFOX_BETA_60_BASE: 3.9s -> 4.1s FIREFOX_AURORA_50_BASE FIREFOX_BETA_60_BASE: 31s -> 33s So it's measurably slower in most cases. The most significant difference is in the hg repo between revisions 4.0 and 4.8. In that case it seems to come from the fact that pathcopies() uses fctx.isintroducedafter() (in _tracefile), while the old mergecopies() used fctx.linkrev() (in _checkcopies()). That results in a single call to filectx._adjustlinkrev(), which is responsible for the entire difference in time (in my repo). So we pay a performance penalty but we get more correct code (see change in test-mv-cp-st-diff.t). Deleting the "== f.filenode()" in _tracefile() recovers the lost performance in the hg repo. There were are few other optimizations in _checkcopies() that I could not measure any impact from. One was from the "seen" set. Another was from a "continue" when the file was not in the destination manifest (corresponding to "am" in _tracefile). Also note that merge copies are not calculated when updating with a clean working copy, which is probably the most common case. I therefore think the much simpler code is worth the slowdown. Differential Revision: https://phab.mercurial-scm.org/D6255

File last commit:

r40003:aab43d58 default
r42408:57203e02 default
Show More
.hgignore
70 lines | 870 B | text/plain | TextLexer
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 syntax: glob
*.elc
Simon Heimberg
Makefile: do update on a temporary copy of a po file...
r19991 *.tmp
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 *.orig
*.rej
*~
Bryan O'Sullivan
Ignore mergebackup files generated by mpatch
r5019 *.mergebackup
Vadim Gelfer
contrib: add restricted shell.
r2341 *.o
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 *.so
Craig Leres
hgignore: ignore dll files generated under cygwin
r13643 *.dll
Adrian Buehlmann
hgignore: simply ignore all *.exe's everywhere...
r17115 *.exe
Adrian Buehlmann
ignore *.pyd files...
r6551 *.pyd
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 *.pyc
Simon Heimberg
hgignore: ignore more bytecode...
r13346 *.pyo
*$py.class
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 *.swp
*.prof
Adrian Buehlmann
hgignore: ignore zip files
r17274 *.zip
Bryan O'Sullivan
win32text: be more careful about rejecting violating changesets...
r8147 \#*\#
.\#*
Boris Feld
sparse-revlog: add a test checking revlog deltas for a churning file...
r39527 tests/artifacts/cache/big-file-churn.hg
Vadim Gelfer
let run-tests run optional code coverage tests....
r2068 tests/.coverage*
Bryan O'Sullivan
tests: write recent run times to a file named tests/.testtimes...
r27634 tests/.testtimes*
David R. MacIver
testing: generate tests operations using Hypothesis...
r28255 tests/.hypothesis
tests/hypothesis-generated
Thomas Arendsen Hein
Ignore annotated coverage output of run-tests.py -C
r2151 tests/annotated
Gregory Szorc
run-tests: mechanism to report exceptions during test execution...
r35191 tests/exceptions
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 tests/*.err
Markus Zapke-Gründemann
tests: add htmlcov option
r15859 tests/htmlcov
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 build
Yuya Nishihara
hgignore: ignore chg binary
r28061 contrib/chg/chg
Vadim Gelfer
contrib: add restricted shell.
r2341 contrib/hgsh/hgsh
anatoly techtonik
contrib/vagrant: use Vagrant for running tests on virtual machine...
r21874 contrib/vagrant/.vagrant
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 dist
Matt Mackall
packaging: move output directory from build/ to packages/...
r21560 packages
Takumi IINO
doc: make man and html from translated documents...
r19426 doc/common.txt
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 doc/*.[0-9]
Takumi IINO
doc: make man and html from translated documents...
r19426 doc/*.[0-9].txt
Thomas Arendsen Hein
Ignore generated documentation
r1817 doc/*.[0-9].gendoc.txt
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 doc/*.[0-9].{x,ht}ml
MANIFEST
Thomas Arendsen Hein
hgignore: ignore MANIFEST.in (generated since 2ce7dfe17bc5)
r14560 MANIFEST.in
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 patches
timeless
setup: create a module for the modulepolicy...
r28430 mercurial/__modulepolicy__.py
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 mercurial/__version__.py
Adrian Buehlmann
exewrapper: adapt for legacy HackableMercurial...
r17732 mercurial/hgpythonlib.h
Lee Cantey
Ignore mercurial.egg-info build output
r11380 mercurial.egg-info
Lee Cantey
Ignore .DS_Store directories...
r2987 .DS_Store
Kirill Smelkov
.hgignore += tags & cscope files
r5693 tags
cscope.*
Angel Ezquerra
hgignore: ignore the PyCharm workspace folder
r22945 .idea/*
Philippe Pepiot
perf: add asv benchmarks...
r30406 .asv/*
Martin Geisler
i18n: let Makefile generate i18n/hg.pot...
r7648 i18n/hg.pot
Martin Geisler
i18n: new build_mo command for setup.py...
r7649 locale/*/LC_MESSAGES/hg.mo
Yuya Nishihara
setup: add command to generate index of extensions...
r14538 hgext/__index__.py
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270
Gregory Szorc
rust: implementation of `hg`...
r35587 rust/target/
Yuya Nishihara
rust-chg: add project skeleton...
r40003 rust/*/target/
Gregory Szorc
rust: implementation of `hg`...
r35587
Boris Feld
packaging: add make target for linux wheels...
r32080 # Generated wheels
wheelhouse/
Bryan O'Sullivan
Switch to new syntax for .hgignore files....
r1270 syntax: regexp
Thomas Arendsen Hein
Ignore test error files, protect dot in .pc/
r794 ^\.pc/
Brendan Cully
Ignore eclipse droppings
r7439 ^\.(pydev)?project
Laurens Holst
ignore: add files present in the hackable-hg windows distribution
r15702
# hackable windows distribution additions
Mads Kiilerich
update .hgignore for hackable with Python 2.7
r16537 ^hg-python
Laurens Holst
ignore: add files present in the hackable-hg windows distribution
r15702 ^hg.py$