tests/test-identify.t
author Na'Tosha Bard <natosha@unity3d.com>
Mon, 13 Feb 2012 18:37:07 +0100
changeset 16120 47ee41fcf42b
parent 15446 c5c9ca3719f9
child 17014 50fbe9063ff2
permissions -rw-r--r--
largefiles: optimize update speed by only updating changed largefiles Historically, during 'hg update', every largefile in the working copy was hashed (which is a very expensive operation on big files) and any largefiles that did not have a hash that matched their standin were updated. This patch optimizes 'hg update' by keeping track of what standins have changed between the old and new revisions, and only updating the largefiles that have changed. This saves a lot of time by avoiding the unecessary calculation of a list of sha1 hashes for big files. With this patch, the time 'hg update' takes to complete is a function of how many largefiles need to be updated and what their size is. Performance tests on a repository with about 80 largefiles ranging from a few MB to about 97 MB are shown below. The tests show how long it takes to run 'hg update' with no changes actually being updated. Mercurial 2.1 release: $ time hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed largefiles 0 largefiles updated, 0 removed real 0m10.045s user 0m9.367s sys 0m0.674s With this patch: $ time hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved real 0m0.965s user 0m0.845s sys 0m0.115s The same repsoitory, without the largefiles extension enabled: $ time hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved real 0m0.799s user 0m0.684s sys 0m0.111s So before the patch, 'hg update' with no changes was approximately 9.25s slower with largefiles enabled. With this patch, it is approximately 0.165s slower.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15446
c5c9ca3719f9 tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents: 14746
diff changeset
     1
  $ "$TESTDIR/hghave" no-outer-repo serve || exit 80
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     2
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     3
no repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     4
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     5
  $ hg id
12070
fddacca3202e Merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 11796
diff changeset
     6
  abort: there is no Mercurial repository here (.hg not found)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12070
diff changeset
     7
  [255]
7830
55bd03e2e13c test-identify: require no-outer-repo
Mads Kiilerich <mads@kiilerich.com>
parents: 7759
diff changeset
     8
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     9
create repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    10
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    11
  $ hg init test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    12
  $ cd test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    13
  $ echo a > a
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    14
  $ hg ci -Ama
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    15
  adding a
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    16
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    17
basic id usage
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    18
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    19
  $ hg id
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    20
  cb9a9f314b8b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    21
  $ hg id --debug
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    22
  cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    23
  $ hg id -q
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    24
  cb9a9f314b8b
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    25
  $ hg id -v
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    26
  cb9a9f314b8b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    27
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    28
with options
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    29
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    30
  $ hg id -r.
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    31
  cb9a9f314b8b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    32
  $ hg id -n
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    33
  0
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    34
  $ hg id -t
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    35
  tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    36
  $ hg id -b
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    37
  default
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    38
  $ hg id -i
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    39
  cb9a9f314b8b
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    40
  $ hg id -n -t -b -i
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    41
  cb9a9f314b8b 0 default tip
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    42
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    43
with modifications
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    44
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    45
  $ echo b > a
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    46
  $ hg id -n -t -b -i
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    47
  cb9a9f314b8b+ 0+ default tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    48
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    49
other local repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    50
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    51
  $ cd ..
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    52
  $ hg -R test id
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    53
  cb9a9f314b8b+ tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    54
  $ hg id test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    55
  cb9a9f314b8b+ tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    56
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    57
with remote http repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    58
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    59
  $ cd test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    60
  $ hg serve -p $HGPORT1 -d --pid-file=hg.pid
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    61
  $ cat hg.pid >> $DAEMON_PIDS
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    62
  $ hg id http://localhost:$HGPORT1/
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    63
  cb9a9f314b8b
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    64
13477
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    65
remote with rev number?
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    66
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    67
  $ hg id -n http://localhost:$HGPORT1/
13644
7e6c2f58ad56 identify: list bookmarks for remote repositories
Nils Adermann <naderman@naderman.de>
parents: 13477
diff changeset
    68
  abort: can't query remote revision number, branch, or tags
13477
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    69
  [255]
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    70
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    71
remote with tags?
7759
50baf8215942 tests: fix for test-identify returning 255
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7757
diff changeset
    72
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    73
  $ hg id -t http://localhost:$HGPORT1/
13644
7e6c2f58ad56 identify: list bookmarks for remote repositories
Nils Adermann <naderman@naderman.de>
parents: 13477
diff changeset
    74
  abort: can't query remote revision number, branch, or tags
13477
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    75
  [255]
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    76
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    77
remote with branch?
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    78
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13447
diff changeset
    79
  $ hg id -b http://localhost:$HGPORT1/
13644
7e6c2f58ad56 identify: list bookmarks for remote repositories
Nils Adermann <naderman@naderman.de>
parents: 13477
diff changeset
    80
  abort: can't query remote revision number, branch, or tags
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12070
diff changeset
    81
  [255]
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
    82
13645
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    83
test bookmark support
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    84
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    85
  $ hg bookmark Y
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    86
  $ hg bookmark Z
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    87
  $ hg bookmarks
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    88
     Y                         0:cb9a9f314b8b
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    89
   * Z                         0:cb9a9f314b8b
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    90
  $ hg id
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    91
  cb9a9f314b8b+ tip Y/Z
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    92
  $ hg id --bookmarks
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    93
  Y Z
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    94
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    95
test remote identify with bookmarks
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    96
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    97
  $ hg id http://localhost:$HGPORT1/
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    98
  cb9a9f314b8b Y/Z
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
    99
  $ hg id --bookmarks http://localhost:$HGPORT1/
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
   100
  Y Z
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
   101
  $ hg id -r . http://localhost:$HGPORT1/
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
   102
  cb9a9f314b8b Y/Z
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
   103
  $ hg id --bookmarks -r . http://localhost:$HGPORT1/
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
   104
  Y Z
3786b810ea75 tests: add tests for bookmarks support in hg identify
David Soria Parra <dsp@php.net>
parents: 13644
diff changeset
   105
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   106
Make sure we do not obscure unknown requires file entries (issue2649)
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   107
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   108
  $ echo fake >> .hg/requires
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   109
  $ hg id
14746
72e4fcb43227 requirements: show all missing features in the error message.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14483
diff changeset
   110
  abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   111
  [255]
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   112
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   113
  $ cd ..
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   114
  $ hg id test
14746
72e4fcb43227 requirements: show all missing features in the error message.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14483
diff changeset
   115
  abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   116
  [255]
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12346
diff changeset
   117