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 | |
|
4 | # changesets, so first we have to recreate it | |
|
5 | # | |
|
6 | # o 8 | |
|
7 | # | | |
|
8 | # | o 7 | |
|
9 | # | | | |
|
10 | # | o 6 | |
|
11 | # |/| | |
|
12 | # o | 5 | |
|
13 | # | | | |
|
14 | # o | 4 | |
|
15 | # | | | |
|
16 | # | o 3 | |
|
17 | # | | | |
|
18 | # | o 2 | |
|
19 | # |/ | |
|
20 | # o 1 | |
|
21 | # | | |
|
22 | # o 0 | |
|
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 | |
|
23 | 50 | |
|
24 | mkrev() | |
|
25 | { | |
|
26 | revno=$1 | |
|
27 | echo "rev $revno" | |
|
28 | echo "rev $revno" > foo.txt | |
|
29 | hg -q ci -m"rev $revno" | |
|
30 | } | |
|
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 | |
|
31 | 59 | |
|
32 | set -e | |
|
33 | echo "% setup test repo1" | |
|
34 | hg init repo1 | |
|
35 | cd repo1 | |
|
36 | echo "rev 0" > foo.txt | |
|
37 | hg ci -Am"rev 0" | |
|
38 | mkrev 1 | |
|
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 | |
|
39 | 74 | |
|
40 | # first branch | |
|
41 | mkrev 2 | |
|
42 |
mkrev |
|
|
75 | $ hg up -r5 | |
|
76 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
77 | $ mkrev 8 | |
|
78 | rev 8 | |
|
43 | 79 | |
|
44 | # back to rev 1 to create second branch | |
|
45 | hg up -r1 | |
|
46 | mkrev 4 | |
|
47 | mkrev 5 | |
|
80 | $ echo "[extensions]" >> $HGRCPATH | |
|
81 | $ echo "graphlog=" >> $HGRCPATH | |
|
82 | ||
|
83 | the story so far | |
|
48 | 84 | |
|
49 | # merge first branch to second branch | |
|
50 | hg up -C -r5 | |
|
51 | HGMERGE=internal:local hg merge | |
|
52 | echo "merge rev 5, rev 3" > foo.txt | |
|
53 | hg ci -m"merge first branch to second branch" | |
|
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 | ||
|
54 | 104 | |
|
55 | # one more commit following the merge | |
|
56 | mkrev 7 | |
|
105 | check that "hg outgoing" really does the right thing | |
|
57 | 106 | |
|
58 | # back to "second branch" to make another head | |
|
59 | hg up -r5 | |
|
60 | mkrev 8 | |
|
107 | sanity check of outgoing: expect revs 4 5 6 7 8 | |
|
61 | 108 | |
|
62 | echo "[extensions]" >> $HGRCPATH | |
|
63 | echo "graphlog=" >> $HGRCPATH | |
|
64 | ||
|
65 | echo "% the story so far" | |
|
66 | hg glog --template "{rev}\n" | |
|
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 | |
|
67 | 117 | |
|
68 | # check that "hg outgoing" really does the right thing | |
|
69 | echo "% sanity check of outgoing: expect revs 4 5 6 7 8" | |
|
70 | hg clone -r3 . ../repo2 | |
|
71 | # this should (and does) report 5 outgoing revisions: 4 5 6 7 8 | |
|
72 | hg outgoing --template "{rev}\n" ../repo2 | |
|
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 | |
|
73 | 128 | |
|
74 |
|
|
|
75 | # this should bundle the same 5 revisions that outgoing reported, but it | |
|
76 | # actually bundles 7 | |
|
77 | hg bundle foo.bundle ../repo2 | |
|
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 | |
|
78 | 138 | |
|
79 |
|
|
|
80 | # this should (and does) give exactly the same result as bundle | |
|
81 | # with a destination repo... i.e. it's wrong too | |
|
82 | hg bundle --base 3 foo.bundle | |
|
139 | test bundle (base revision): expect 5 revisions | |
|
140 | ||
|
141 | this should (and does) give exactly the same result as 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 |
General Comments 0
You need to be logged in to leave comments.
Login now