annotate tests/test-push-validation.t @ 17970:0b03454abae7

ancestor: faster algorithm for difference of ancestor sets One of the major reasons rebase is slow in large repositories is the computation of the detach set: the set of ancestors of the changesets to rebase not in the destination parent. This is currently done via a revset that does two walks all the way to the root of the DAG. Instead of doing that, to find ancestors of a set <revs> not in another set <common> we walk up the tree in reverse revision number order, maintaining sets of nodes visited from <revs>, <common> or both. For the common case where the sets are close both topologically and in revision number (relative to repository size), this has been found to speed up rebase by around 15-20%. When the nodes are farther apart and the DAG is highly branching, it is harder to say which would win. Here's how long computing the detach set takes in a linear repository with over 400000 changesets, rebasing near tip: Rebasing across 4 changesets Revset method: 2.2s New algorithm: 0.00015s Rebasing across 250 changesets Revset method: 2.2s New algorithm: 0.00069s Rebasing across 10000 changesets Revset method: 2.4s New algorithm: 0.019s
author Siddharth Agarwal <sid0@fb.com>
date Mon, 26 Nov 2012 11:46:51 -0800
parents f2719b387380
children f009804e2a43
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
1 $ hg init test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
2 $ cd test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
3
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
4 $ cat > .hg/hgrc <<EOF
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
5 > [server]
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
6 > validate=1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
7 > EOF
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
8
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
9 $ echo alpha > alpha
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
10 $ echo beta > beta
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
11 $ hg addr
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
12 adding alpha
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
13 adding beta
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
14 $ hg ci -m 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
15
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
16 $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
17 $ hg clone test test-clone
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
18 updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
20
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
21 $ cd test-clone
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
22 $ cp .hg/store/data/beta.i tmp
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
23 $ echo blah >> beta
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
24 $ hg ci -m '2 (corrupt)'
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
25 $ mv tmp .hg/store/data/beta.i
10418
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
26
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
27 Expected to fail:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
28
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
29 $ hg verify
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
30 checking changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
31 checking manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
32 crosschecking files in changesets and manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
33 checking files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
34 beta@1: dddc47b3ba30 in manifests not found
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
35 2 files, 2 changesets, 2 total revisions
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
36 1 integrity errors encountered!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
37 (first damaged changeset appears to be 1)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
38 [1]
10418
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
39
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
40 Expected to fail:
10418
5fc090ba08a6 localrepo: add optional validation (defaults to off) for incoming changes
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
41
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
42 $ hg push
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 12640
diff changeset
43 pushing to $TESTTMP/test (glob)
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
44 searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
45 adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
46 adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
47 adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
48 transaction abort!
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
49 rollback completed
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
50 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12279
diff changeset
51 [255]
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 10469
diff changeset
52
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15447
diff changeset
53 $ cd ..