annotate tests/test-update-branches @ 11985:81edef14922e

log: add logging for commands
author Matt Mackall <mpm@selenic.com>
date Thu, 19 Aug 2010 11:14:09 -0500
parents ea8c207a0f78
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9716
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
1 #!/bin/sh
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
2
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
3 # Construct the following history tree:
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
4 #
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
5 # @ 5:e1bb631146ca b1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
6 # |
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
7 # o 4:a4fdb3b883c4 0:b608b9236435 b1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
8 # |
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
9 # | o 3:4b57d2520816 1:44592833ba9f
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
10 # | |
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
11 # | | o 2:063f31070f65
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
12 # | |/
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
13 # | o 1:44592833ba9f
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
14 # |/
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
15 # o 0:b608b9236435
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
16
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
17 hg init
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
18 echo foo > foo
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
19 echo zero > a
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
20 hg ci -qAm0
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
21 echo one > a ; hg ci -m1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
22 echo two > a ; hg ci -m2
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
23 hg up -q 1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
24 echo three > a ; hg ci -qm3
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
25 hg up -q 0
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
26 hg branch -q b1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
27 echo four > a ; hg ci -qm4
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
28 echo five > a ; hg ci -qm5
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
29
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
30 echo % initial repo state
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
31 echo
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
32 hg --config 'extensions.graphlog=' \
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
33 glog --template '{rev}:{node|short} {parents} {branches}\n'
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
34
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
35 # Test helper functions.
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
36
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
37 revtest () {
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
38 msg=$1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
39 dirtyflag=$2 # 'clean' or 'dirty'
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
40 startrev=$3
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
41 targetrev=$4
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
42 opt=$5
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
43 echo % revtest $msg $startrev $targetrev
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
44 hg up -qC $startrev
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
45 test $dirtyflag = dirty && echo dirty > foo
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
46 hg up $opt $targetrev
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
47 hg parent --template 'parent={rev}\n'
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
48 hg stat
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
49 }
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
50
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
51 norevtest () {
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
52 msg=$1
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
53 dirtyflag=$2 # 'clean' or 'dirty'
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
54 startrev=$3
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
55 opt=$4
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
56 echo % norevtest $msg $startrev
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
57 hg up -qC $startrev
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
58 test $dirtyflag = dirty && echo dirty > foo
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
59 hg up $opt
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
60 hg parent --template 'parent={rev}\n'
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
61 hg stat
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
62 }
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
63
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
64 # Test cases are documented in a table in the update function of merge.py.
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
65 # Cases are run as shown in that table, row by row.
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
66
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
67 norevtest 'none clean linear' clean 4
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
68 norevtest 'none clean same' clean 2
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
69
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
70 revtest 'none clean linear' clean 1 2
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
71 revtest 'none clean same' clean 2 3
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
72 revtest 'none clean cross' clean 3 4
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
73
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
74 revtest 'none dirty linear' dirty 1 2
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
75 revtest 'none dirty same' dirty 2 3
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
76 revtest 'none dirty cross' dirty 3 4
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
77
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
78 revtest '-C dirty linear' dirty 1 2 -C
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
79 revtest '-c dirty linear' dirty 1 2 -c
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
80 norevtest '-c clean same' clean 2 -c
ea8c207a0f78 update: add comments and test cases for updating across branches
Stuart W Marks <smarks@smarks.org>
parents:
diff changeset
81 revtest '-cC dirty linear' dirty 1 2 -cC