Show More
@@ -1,84 +1,147 b'' | |||||
1 | #!/bin/sh |
|
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 | |||
2 |
|
33 | |||
3 | # this structure seems to tickle a bug in bundle's search for |
|
34 | $ hg init repo1 | |
4 | # changesets, so first we have to recreate it |
|
35 | $ cd repo1 | |
5 | # |
|
36 | $ echo "rev 0" > foo.txt | |
6 | # o 8 |
|
37 | $ hg ci -Am"rev 0" | |
7 | # | |
|
38 | adding foo.txt | |
8 | # | o 7 |
|
39 | $ mkrev 1 | |
9 | # | | |
|
40 | rev 1 | |
10 | # | o 6 |
|
41 | ||
11 | # |/| |
|
42 | first branch | |
12 | # o | 5 |
|
43 | ||
13 | # | | |
|
44 | $ mkrev 2 | |
14 | # o | 4 |
|
45 | rev 2 | |
15 | # | | |
|
46 | $ mkrev 3 | |
16 | # | o 3 |
|
47 | rev 3 | |
17 | # | | |
|
48 | ||
18 | # | o 2 |
|
49 | back to rev 1 to create second branch | |
19 | # |/ |
|
|||
20 | # o 1 |
|
|||
21 | # | |
|
|||
22 | # o 0 |
|
|||
23 |
|
50 | |||
24 | mkrev() |
|
51 | $ hg up -r1 | |
25 | { |
|
52 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
26 | revno=$1 |
|
53 | $ mkrev 4 | |
27 | echo "rev $revno" |
|
54 | rev 4 | |
28 | echo "rev $revno" > foo.txt |
|
55 | $ mkrev 5 | |
29 | hg -q ci -m"rev $revno" |
|
56 | rev 5 | |
30 | } |
|
57 | ||
|
58 | merge first branch to second branch | |||
31 |
|
59 | |||
32 | set -e |
|
60 | $ hg up -C -r5 | |
33 | echo "% setup test repo1" |
|
61 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
34 | hg init repo1 |
|
62 | $ HGMERGE=internal:local hg merge | |
35 | cd repo1 |
|
63 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
36 | echo "rev 0" > foo.txt |
|
64 | (branch merge, don't forget to commit) | |
37 | hg ci -Am"rev 0" |
|
65 | $ echo "merge rev 5, rev 3" > foo.txt | |
38 | mkrev 1 |
|
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 | |||
39 |
|
74 | |||
40 | # first branch |
|
75 | $ hg up -r5 | |
41 | mkrev 2 |
|
76 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 |
mkrev |
|
77 | $ mkrev 8 | |
|
78 | rev 8 | |||
43 |
|
79 | |||
44 | # back to rev 1 to create second branch |
|
80 | $ echo "[extensions]" >> $HGRCPATH | |
45 | hg up -r1 |
|
81 | $ echo "graphlog=" >> $HGRCPATH | |
46 | mkrev 4 |
|
82 | ||
47 | mkrev 5 |
|
83 | the story so far | |
48 |
|
84 | |||
49 | # merge first branch to second branch |
|
85 | $ hg glog --template "{rev}\n" | |
50 | hg up -C -r5 |
|
86 | @ 8 | |
51 | HGMERGE=internal:local hg merge |
|
87 | | | |
52 | echo "merge rev 5, rev 3" > foo.txt |
|
88 | | o 7 | |
53 | hg ci -m"merge first branch to second branch" |
|
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 | ||||
54 |
|
104 | |||
55 | # one more commit following the merge |
|
105 | check that "hg outgoing" really does the right thing | |
56 | mkrev 7 |
|
|||
57 |
|
106 | |||
58 | # back to "second branch" to make another head |
|
107 | sanity check of outgoing: expect revs 4 5 6 7 8 | |
59 | hg up -r5 |
|
|||
60 | mkrev 8 |
|
|||
61 |
|
108 | |||
62 | echo "[extensions]" >> $HGRCPATH |
|
109 | $ hg clone -r3 . ../repo2 | |
63 | echo "graphlog=" >> $HGRCPATH |
|
110 | requesting all changes | |
64 |
|
111 | adding changesets | ||
65 | echo "% the story so far" |
|
112 | adding manifests | |
66 | hg glog --template "{rev}\n" |
|
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 | |||
67 |
|
117 | |||
68 | # check that "hg outgoing" really does the right thing |
|
118 | this should (and does) report 5 outgoing revisions: 4 5 6 7 8 | |
69 | echo "% sanity check of outgoing: expect revs 4 5 6 7 8" |
|
119 | ||
70 | hg clone -r3 . ../repo2 |
|
120 | $ hg outgoing --template "{rev}\n" ../repo2 | |
71 | # this should (and does) report 5 outgoing revisions: 4 5 6 7 8 |
|
121 | comparing with ../repo2 | |
72 | hg outgoing --template "{rev}\n" ../repo2 |
|
122 | searching for changes | |
|
123 | 4 | |||
|
124 | 5 | |||
|
125 | 6 | |||
|
126 | 7 | |||
|
127 | 8 | |||
73 |
|
128 | |||
74 |
|
|
129 | test bundle (destination repo): expect 5 revisions | |
75 | # this should bundle the same 5 revisions that outgoing reported, but it |
|
130 | ||
76 | # actually bundles 7 |
|
131 | this should bundle the same 5 revisions that outgoing reported, but it | |
77 | hg bundle foo.bundle ../repo2 |
|
132 | ||
|
133 | actually bundles 7 | |||
|
134 | ||||
|
135 | $ hg bundle foo.bundle ../repo2 | |||
|
136 | searching for changes | |||
|
137 | 5 changesets found | |||
78 |
|
138 | |||
79 |
|
|
139 | test bundle (base revision): expect 5 revisions | |
80 | # this should (and does) give exactly the same result as bundle |
|
140 | ||
81 | # with a destination repo... i.e. it's wrong too |
|
141 | this should (and does) give exactly the same result as bundle | |
82 | hg bundle --base 3 foo.bundle |
|
|||
83 |
|
142 | |||
|
143 | with a destination repo... i.e. it's wrong too | |||
84 |
|
144 | |||
|
145 | $ hg bundle --base 3 foo.bundle | |||
|
146 | 5 changesets found | |||
|
147 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now