Mercurial > hg
annotate tests/test-blackbox.t @ 18766:64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Writes the backup bundle paths to the blackbox so it's easy to see which
backup bundle is associated with which command when you are debugging an
issue.
Example output:
2013/03/13 10:39:56 durham> strip tip
2013/03/13 10:39:59 durham> saved backup bundle to /data/users/durham/www-hg/.hg/strip-backup/e5fac262363a-backup.hg
2013/03/13 10:40:03 durham> strip tip exited 0 after 7.97 seconds
author | Durham Goode <durham@fb.com> |
---|---|
date | Wed, 13 Mar 2013 10:43:51 -0700 |
parents | 0ade08dcb3c3 |
children | ed39a8f94e95 |
rev | line source |
---|---|
18674
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
1 setup |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
2 $ cat > mock.py <<EOF |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
3 > from mercurial import util |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
4 > import getpass |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
5 > |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
6 > def makedate(): |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
7 > return 0, 0 |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
8 > def getuser(): |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
9 > return 'bob' |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
10 > # mock the date and user apis so the output is always the same |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
11 > def uisetup(ui): |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
12 > util.makedate = makedate |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
13 > getpass.getuser = getuser |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
14 > EOF |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
15 $ cat >> $HGRCPATH <<EOF |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
16 > [extensions] |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
17 > blackbox= |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
18 > mock=`pwd`/mock.py |
18766
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
19 > mq= |
18674
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
20 > EOF |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
21 $ hg init blackboxtest |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
22 $ cd blackboxtest |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
23 |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
24 command, exit codes, and duration |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
25 |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
26 $ echo a > a |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
27 $ hg add a |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
28 $ hg blackbox |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
29 1970/01/01 00:00:00 bob> add a |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
30 1970/01/01 00:00:00 bob> add exited 0 after * seconds (glob) |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
31 |
18677
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
32 incoming change tracking |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
33 |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
34 create two heads to verify that we only see one change in the log later |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
35 $ hg commit -ma |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
36 $ hg up null |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
37 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
38 $ echo b > b |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
39 $ hg commit -Amb |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
40 adding b |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
41 created new head |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
42 |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
43 clone, commit, pull |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
44 $ hg clone . ../blackboxtest2 |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
45 updating to branch default |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
47 $ echo c > c |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
48 $ hg commit -Amc |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
49 adding c |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
50 $ cd ../blackboxtest2 |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
51 $ hg pull |
18719
9ad13296c581
tests: append glob to filename output when required for windows
Simon Heimberg <simohe@besonet.ch>
parents:
18677
diff
changeset
|
52 pulling from $TESTTMP/blackboxtest (glob) |
18677
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
53 searching for changes |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
54 adding changesets |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
55 adding manifests |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
56 adding file changes |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
57 added 1 changesets with 1 changes to 1 files |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
58 (run 'hg update' to get a working copy) |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
59 $ hg blackbox -l 3 |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
60 1970/01/01 00:00:00 bob> pull |
18720
0ade08dcb3c3
tests: remove glob lines which unnecessary match / for \ on windows
Simon Heimberg <simohe@besonet.ch>
parents:
18719
diff
changeset
|
61 1970/01/01 00:00:00 bob> 1 incoming changes - new heads: d02f48003e62 |
18677
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
62 1970/01/01 00:00:00 bob> pull exited None after * seconds (glob) |
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
63 |
18766
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
64 backup bundles get logged |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
65 |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
66 $ touch d |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
67 $ hg commit -Amd |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
68 adding d |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
69 created new head |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
70 $ hg strip tip |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
71 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
72 saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob) |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
73 $ hg blackbox -l 3 |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
74 1970/01/01 00:00:00 bob> strip tip |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
75 1970/01/01 00:00:00 bob> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob) |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
76 1970/01/01 00:00:00 bob> strip exited 0 after * seconds (glob) |
64b5562550e2
blackbox: add backup bundle paths to blackbox logs
Durham Goode <durham@fb.com>
parents:
18720
diff
changeset
|
77 |
18674
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
78 extension and python hooks - use the eol extension for a pythonhook |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
79 |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
80 $ echo '[extensions]' >> .hg/hgrc |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
81 $ echo 'eol=' >> .hg/hgrc |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
82 $ echo '[hooks]' >> .hg/hgrc |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
83 $ echo 'update = echo hooked' >> .hg/hgrc |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
84 $ hg update |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
85 hooked |
18677
539210ed2069
blackbox: only show new heads on incoming
Durham Goode <durham@fb.com>
parents:
18674
diff
changeset
|
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
18674
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
87 $ hg blackbox -l 4 |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
88 1970/01/01 00:00:00 bob> update |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
89 1970/01/01 00:00:00 bob> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob) |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
90 1970/01/01 00:00:00 bob> exthook-update: echo hooked finished in * seconds (glob) |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
91 1970/01/01 00:00:00 bob> update exited False after * seconds (glob) |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
92 |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
93 cleanup |
c61b49d059eb
blackbox: tests for the blackbox extension
Durham Goode <durham@fb.com>
parents:
diff
changeset
|
94 $ cd .. |