tests/test-dumprevlog.out
author David Greenaway <hg-dev@davidgreenaway.com>
Sat, 03 Apr 2010 11:58:16 +1100
changeset 11060 e6df01776e08
parent 7229 7946503ec76e
permissions -rw-r--r--
findrenames: Optimise "addremove -s100" by matching files by their SHA1 hashes. We speed up 'findrenames' for the usecase when a user specifies they want a similarity of 100% by matching files by their exact SHA1 hash value. This reduces the number of comparisons required to find exact matches from O(n^2) to O(n). While it would be nice if we could just use mercurial's pre-calculated SHA1 hash for existing files, this hash includes the file's ancestor information making it unsuitable for our purposes. Instead, we calculate the hash of old content from scratch. The following benchmarks were taken on the current head of crew: addremove 100% similarity: rm -rf *; hg up -C; mv tests tests.new hg --time addremove -s100 --dry-run before: real 176.350 secs (user 128.890+0.000 sys 47.430+0.000) after: real 2.130 secs (user 1.890+0.000 sys 0.240+0.000) addremove 75% similarity: rm -rf *; hg up -C; mv tests tests.new; \ for i in tests.new/*; do echo x >> $i; done hg --time addremove -s75 --dry-run before: real 264.560 secs (user 215.130+0.000 sys 49.410+0.000) after: real 218.710 secs (user 172.790+0.000 sys 45.870+0.000)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7229
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
     1
% prepare repo-a
6465
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     2
checking changesets
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     3
checking manifests
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     4
crosschecking files in changesets and manifests
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     5
checking files
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     6
1 files, 3 changesets, 3 total revisions
7229
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
     7
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
     8
% dumping revlog of file a to stdout
6465
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     9
file: .hg/store/data/a.i
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    10
node: 183d2312b35066fb6b3b449b84efc370d50993d0
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    11
linkrev: 0
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    12
parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    13
length: 15
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    14
-start-
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    15
this is file a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    16
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    17
-end-
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    18
node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    19
linkrev: 1
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    20
parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    21
length: 32
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    22
-start-
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    23
this is file a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    24
adding to file a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    25
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    26
-end-
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    27
node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    28
linkrev: 2
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    29
parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    30
length: 54
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    31
-start-
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    32
this is file a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    33
adding to file a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    34
adding more to file a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    35
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    36
-end-
7229
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    37
% dumprevlog done
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    38
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    39
% dump all revlogs to file repo.dump
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    40
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    41
% undumping into repo-b
6512
368a4ec603cc merge: introduce mergestate
Matt Mackall <mpm@selenic.com>
parents: 6465
diff changeset
    42
.hg/store/00changelog.i
6465
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    43
.hg/store/00manifest.i
6512
368a4ec603cc merge: introduce mergestate
Matt Mackall <mpm@selenic.com>
parents: 6465
diff changeset
    44
.hg/store/data/a.i
7229
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    45
% undumping done
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    46
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    47
% clone --pull repo-b repo-c to rebuild fncache
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    48
requesting all changes
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    49
adding changesets
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    50
adding manifests
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    51
adding file changes
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    52
added 3 changesets with 3 changes to 1 files
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    53
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    54
% verify repo-c
6465
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    55
checking changesets
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    56
checking manifests
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    57
crosschecking files in changesets and manifests
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    58
checking files
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    59
1 files, 3 changesets, 3 total revisions
7229
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    60
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    61
% comparing repos
6465
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    62
comparing with repo-a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    63
searching for changes
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    64
no changes found
7229
7946503ec76e introduce fncache repository layout
Adrian Buehlmann <adrian@cadifra.com>
parents: 6512
diff changeset
    65
comparing with repo-c
6465
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    66
searching for changes
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    67
no changes found