Mercurial > hg
comparison tests/test-patchbomb-bookmark.t @ 32639:c2fe2b00db53
patchbomb: add -B option to select a bookmark
Add the -B/--bookmark option to select a bookmark whose changesets
and its ancestors will be selected unless a new bookmark/head is
found.
This is inspired by hg strip -B option.
author | David Demelier <demelier.david@gmail.com> |
---|---|
date | Fri, 03 Feb 2017 15:02:27 +0100 |
parents | |
children | 2d0c306a88c2 |
comparison
equal
deleted
inserted
replaced
32638:4f6645ec6bb2 | 32639:c2fe2b00db53 |
---|---|
1 Create @ bookmark as main reference | |
2 | |
3 $ hg init repo | |
4 $ cd repo | |
5 $ echo "[extensions]" >> $HGRCPATH | |
6 $ echo "patchbomb=" >> $HGRCPATH | |
7 $ hg book @ | |
8 | |
9 Create a dummy revision that must never be exported | |
10 | |
11 $ echo no > no | |
12 $ hg ci -Amno -d '6 0' | |
13 adding no | |
14 | |
15 Create a feature and use -B | |
16 | |
17 $ hg book booktest | |
18 $ echo first > a | |
19 $ hg ci -Amfirst -d '7 0' | |
20 adding a | |
21 $ echo second > b | |
22 $ hg ci -Amsecond -d '8 0' | |
23 adding b | |
24 $ hg email --date '1981-1-1 0:1' -n -t foo -s bookmark -B booktest | |
25 From [test]: test | |
26 this patch series consists of 2 patches. | |
27 | |
28 | |
29 Write the introductory message for the patch series. | |
30 | |
31 Cc: | |
32 | |
33 displaying [PATCH 0 of 2] bookmark ... | |
34 Content-Type: text/plain; charset="us-ascii" | |
35 MIME-Version: 1.0 | |
36 Content-Transfer-Encoding: 7bit | |
37 Subject: [PATCH 0 of 2] bookmark | |
38 Message-Id: <patchbomb.347155260@*> (glob) | |
39 User-Agent: Mercurial-patchbomb/* (glob) | |
40 Date: Thu, 01 Jan 1981 00:01:00 +0000 | |
41 From: test | |
42 To: foo | |
43 | |
44 | |
45 displaying [PATCH 1 of 2] first ... | |
46 Content-Type: text/plain; charset="us-ascii" | |
47 MIME-Version: 1.0 | |
48 Content-Transfer-Encoding: 7bit | |
49 Subject: [PATCH 1 of 2] first | |
50 X-Mercurial-Node: accde9b8b6dce861c185d0825c1affc09a79cb26 | |
51 X-Mercurial-Series-Index: 1 | |
52 X-Mercurial-Series-Total: 2 | |
53 Message-Id: <accde9b8b6dce861c185.347155261@*> (glob) | |
54 X-Mercurial-Series-Id: <accde9b8b6dce861c185.347155261@*> (glob) | |
55 In-Reply-To: <patchbomb.347155260@*> (glob) | |
56 References: <patchbomb.347155260@*> (glob) | |
57 User-Agent: Mercurial-patchbomb/* (glob) | |
58 Date: Thu, 01 Jan 1981 00:01:01 +0000 | |
59 From: test | |
60 To: foo | |
61 | |
62 # HG changeset patch | |
63 # User test | |
64 # Date 7 0 | |
65 # Thu Jan 01 00:00:07 1970 +0000 | |
66 # Node ID accde9b8b6dce861c185d0825c1affc09a79cb26 | |
67 # Parent 043bd3889e5aaf7d88fe3713cf425f782ad2fb71 | |
68 first | |
69 | |
70 diff -r 043bd3889e5a -r accde9b8b6dc a | |
71 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
72 +++ b/a Thu Jan 01 00:00:07 1970 +0000 | |
73 @@ -0,0 +1,1 @@ | |
74 +first | |
75 | |
76 displaying [PATCH 2 of 2] second ... | |
77 Content-Type: text/plain; charset="us-ascii" | |
78 MIME-Version: 1.0 | |
79 Content-Transfer-Encoding: 7bit | |
80 Subject: [PATCH 2 of 2] second | |
81 X-Mercurial-Node: 417defd1559c396ba06a44dce8dc1c2d2d653f3f | |
82 X-Mercurial-Series-Index: 2 | |
83 X-Mercurial-Series-Total: 2 | |
84 Message-Id: <417defd1559c396ba06a.347155262@*> (glob) | |
85 X-Mercurial-Series-Id: <accde9b8b6dce861c185.347155261@*> (glob) | |
86 In-Reply-To: <patchbomb.347155260@*> (glob) | |
87 References: <patchbomb.347155260@*> (glob) | |
88 User-Agent: Mercurial-patchbomb/* (glob) | |
89 Date: Thu, 01 Jan 1981 00:01:02 +0000 | |
90 From: test | |
91 To: foo | |
92 | |
93 # HG changeset patch | |
94 # User test | |
95 # Date 8 0 | |
96 # Thu Jan 01 00:00:08 1970 +0000 | |
97 # Node ID 417defd1559c396ba06a44dce8dc1c2d2d653f3f | |
98 # Parent accde9b8b6dce861c185d0825c1affc09a79cb26 | |
99 second | |
100 | |
101 diff -r accde9b8b6dc -r 417defd1559c b | |
102 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
103 +++ b/b Thu Jan 01 00:00:08 1970 +0000 | |
104 @@ -0,0 +1,1 @@ | |
105 +second | |
106 | |
107 Do the same and combine with -o only one must be exported | |
108 | |
109 $ cd .. | |
110 $ hg clone repo repo2 | |
111 updating to bookmark @ | |
112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
113 $ cd repo | |
114 $ hg up @ | |
115 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
116 (activating bookmark @) | |
117 $ hg book outgoing | |
118 $ echo 1 > x | |
119 $ hg ci -Am1 -d '8 0' | |
120 adding x | |
121 created new head | |
122 $ hg push ../repo2 -B outgoing | |
123 pushing to ../repo2 | |
124 searching for changes | |
125 adding changesets | |
126 adding manifests | |
127 adding file changes | |
128 added 1 changesets with 1 changes to 1 files (+1 heads) | |
129 exporting bookmark outgoing | |
130 $ echo 2 > y | |
131 $ hg ci -Am2 -d '9 0' | |
132 adding y | |
133 $ hg email --date '1982-1-1 0:1' -n -t foo -s bookmark -B outgoing -o ../repo2 | |
134 comparing with ../repo2 | |
135 From [test]: test | |
136 this patch series consists of 1 patches. | |
137 | |
138 Cc: | |
139 | |
140 displaying [PATCH] bookmark ... | |
141 Content-Type: text/plain; charset="us-ascii" | |
142 MIME-Version: 1.0 | |
143 Content-Transfer-Encoding: 7bit | |
144 Subject: [PATCH] bookmark | |
145 X-Mercurial-Node: 8dab2639fd35f1e337ad866c372a5c44f1064e3c | |
146 X-Mercurial-Series-Index: 1 | |
147 X-Mercurial-Series-Total: 1 | |
148 Message-Id: <8dab2639fd35f1e337ad.378691260@*> (glob) | |
149 X-Mercurial-Series-Id: <8dab2639fd35f1e337ad.378691260@*> (glob) | |
150 User-Agent: Mercurial-patchbomb/* (glob) | |
151 Date: Fri, 01 Jan 1982 00:01:00 +0000 | |
152 From: test | |
153 To: foo | |
154 | |
155 # HG changeset patch | |
156 # User test | |
157 # Date 9 0 | |
158 # Thu Jan 01 00:00:09 1970 +0000 | |
159 # Node ID 8dab2639fd35f1e337ad866c372a5c44f1064e3c | |
160 # Parent 0b24b8316483bf30bfc3e4d4168e922b169dbe66 | |
161 2 | |
162 | |
163 diff -r 0b24b8316483 -r 8dab2639fd35 y | |
164 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
165 +++ b/y Thu Jan 01 00:00:09 1970 +0000 | |
166 @@ -0,0 +1,1 @@ | |
167 +2 | |
168 |