comparison tests/test-bundle-vs-outgoing.t @ 11873:0a0b2872b0de

tests: unify test-bundle-vs-outgoing
author Martin Geisler <mg@lazybytes.net>
date Sat, 14 Aug 2010 03:26:03 +0200
parents tests/test-bundle-vs-outgoing@7d2e9121ef4f
children 22f3353bcc36
comparison
equal deleted inserted replaced
11872:bc436a97038b 11873:0a0b2872b0de
1 this structure seems to tickle a bug in bundle's search for
2 changesets, so first we have to recreate it
3
4 o 8
5 |
6 | o 7
7 | |
8 | o 6
9 |/|
10 o | 5
11 | |
12 o | 4
13 | |
14 | o 3
15 | |
16 | o 2
17 |/
18 o 1
19 |
20 o 0
21
22 $ mkrev()
23 > {
24 > revno=$1
25 > echo "rev $revno"
26 > echo "rev $revno" > foo.txt
27 > hg -q ci -m"rev $revno"
28 > }
29
30 $ set -e
31
32 setup test repo1
33
34 $ hg init repo1
35 $ cd repo1
36 $ echo "rev 0" > foo.txt
37 $ hg ci -Am"rev 0"
38 adding foo.txt
39 $ mkrev 1
40 rev 1
41
42 first branch
43
44 $ mkrev 2
45 rev 2
46 $ mkrev 3
47 rev 3
48
49 back to rev 1 to create second branch
50
51 $ hg up -r1
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 $ mkrev 4
54 rev 4
55 $ mkrev 5
56 rev 5
57
58 merge first branch to second branch
59
60 $ hg up -C -r5
61 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 $ HGMERGE=internal:local hg merge
63 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 (branch merge, don't forget to commit)
65 $ echo "merge rev 5, rev 3" > foo.txt
66 $ hg ci -m"merge first branch to second branch"
67
68 one more commit following the merge
69
70 $ mkrev 7
71 rev 7
72
73 back to "second branch" to make another head
74
75 $ hg up -r5
76 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 $ mkrev 8
78 rev 8
79
80 $ echo "[extensions]" >> $HGRCPATH
81 $ echo "graphlog=" >> $HGRCPATH
82
83 the story so far
84
85 $ hg glog --template "{rev}\n"
86 @ 8
87 |
88 | o 7
89 | |
90 | o 6
91 |/|
92 o | 5
93 | |
94 o | 4
95 | |
96 | o 3
97 | |
98 | o 2
99 |/
100 o 1
101 |
102 o 0
103
104
105 check that "hg outgoing" really does the right thing
106
107 sanity check of outgoing: expect revs 4 5 6 7 8
108
109 $ hg clone -r3 . ../repo2
110 requesting all changes
111 adding changesets
112 adding manifests
113 adding file changes
114 added 4 changesets with 4 changes to 1 files
115 updating to branch default
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117
118 this should (and does) report 5 outgoing revisions: 4 5 6 7 8
119
120 $ hg outgoing --template "{rev}\n" ../repo2
121 comparing with ../repo2
122 searching for changes
123 4
124 5
125 6
126 7
127 8
128
129 test bundle (destination repo): expect 5 revisions
130
131 this should bundle the same 5 revisions that outgoing reported, but it
132
133 actually bundles 7
134
135 $ hg bundle foo.bundle ../repo2
136 searching for changes
137 5 changesets found
138
139 test bundle (base revision): expect 5 revisions
140
141 this should (and does) give exactly the same result as bundle
142
143 with a destination repo... i.e. it's wrong too
144
145 $ hg bundle --base 3 foo.bundle
146 5 changesets found
147