##// END OF EJS Templates
merge with stable
Matt Mackall -
r15801:bfd3ce75 merge default
parent child Browse files
Show More
@@ -1854,8 +1854,9 b' class queue(object):'
1854 1854 def delete(ui, repo, *patches, **opts):
1855 1855 """remove patches from queue
1856 1856
1857 The patches must not be applied, and at least one patch is required. With
1858 -k/--keep, the patch files are preserved in the patch directory.
1857 The patches must not be applied, and at least one patch is required. Exact
1858 patch identifiers must be given. With -k/--keep, the patch files are
1859 preserved in the patch directory.
1859 1860
1860 1861 To stop managing a patch and move it into permanent history,
1861 1862 use the :hg:`qfinish` command."""
@@ -15,7 +15,7 b' http://mercurial.selenic.com/wiki/Rebase'
15 15 '''
16 16
17 17 from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks
18 from mercurial import extensions, patch
18 from mercurial import extensions, patch, scmutil
19 19 from mercurial.commands import templateopts
20 20 from mercurial.node import nullrev
21 21 from mercurial.lock import release
@@ -187,10 +187,12 b' def rebase(ui, repo, **opts):'
187 187 if revf:
188 188 rebaseset = repo.revs('%lr', revf)
189 189 elif srcf:
190 rebaseset = repo.revs('(%r)::', srcf)
190 src = scmutil.revrange(repo, [srcf])
191 rebaseset = repo.revs('(%ld)::', src)
191 192 else:
192 base = basef or '.'
193 rebaseset = repo.revs('(children(ancestor(%r, %d)) & ::%r)::',
193 base = scmutil.revrange(repo, [basef or '.'])
194 rebaseset = repo.revs(
195 '(children(ancestor(%ld, %d)) and ::(%ld))::',
194 196 base, dest, base)
195 197
196 198 if rebaseset:
@@ -4,6 +4,7 b''
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 import errno
7 8
8 9 from node import nullid
9 10 from i18n import _
@@ -80,7 +81,9 b' class dirstate(object):'
80 81 def _branch(self):
81 82 try:
82 83 return self._opener.read("branch").strip() or "default"
83 except IOError:
84 except IOError, inst:
85 if inst.errno != errno.ENOENT:
86 raise
84 87 return "default"
85 88
86 89 @propertycache
@@ -22,25 +22,156 b''
22 22 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 23 $ cd ..
24 24
25
26 Rebasing descendant onto ancestor across different named branches
27
28 25 $ hg clone -q -u . a a1
29 26
30 27 $ cd a1
31 28
32 $ hg branch dev
33 marked working directory as branch dev
29 $ hg update 3
30 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
31 $ hg branch dev-one
32 marked working directory as branch dev-one
33 (branches are permanent and global, did you want a bookmark?)
34 $ hg ci -m 'dev-one named branch'
35
36 $ hg update 7
37 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
38 $ hg branch dev-two
39 marked working directory as branch dev-two
34 40 (branches are permanent and global, did you want a bookmark?)
35 41
36 42 $ echo x > x
37 43
38 44 $ hg add x
39 45
40 $ hg ci -m 'extra named branch'
46 $ hg ci -m 'dev-two named branch'
47
48 $ hg tglog
49 @ 9: 'dev-two named branch' dev-two
50 |
51 | o 8: 'dev-one named branch' dev-one
52 | |
53 o | 7: 'H'
54 | |
55 +---o 6: 'G'
56 | | |
57 o | | 5: 'F'
58 | | |
59 +---o 4: 'E'
60 | |
61 | o 3: 'D'
62 | |
63 | o 2: 'C'
64 | |
65 | o 1: 'B'
66 |/
67 o 0: 'A'
68
69
70 Branch name containing a dash (issue3181)
71
72 $ hg rebase -b dev-two -d dev-one --keepbranches
73 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
74
75 $ hg tglog
76 @ 9: 'dev-two named branch' dev-two
77 |
78 o 8: 'H'
79 |
80 | o 7: 'G'
81 |/|
82 o | 6: 'F'
83 | |
84 o | 5: 'dev-one named branch' dev-one
85 | |
86 | o 4: 'E'
87 | |
88 o | 3: 'D'
89 | |
90 o | 2: 'C'
91 | |
92 o | 1: 'B'
93 |/
94 o 0: 'A'
95
96 $ hg rebase -s dev-one -d 0 --keepbranches
97 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
41 98
42 99 $ hg tglog
43 @ 8: 'extra named branch' dev
100 @ 8: 'dev-two named branch' dev-two
101 |
102 o 7: 'H'
103 |
104 | o 6: 'G'
105 |/|
106 o | 5: 'F'
107 | |
108 | o 4: 'E'
109 |/
110 | o 3: 'D'
111 | |
112 | o 2: 'C'
113 | |
114 | o 1: 'B'
115 |/
116 o 0: 'A'
117
118 $ hg update 3
119 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
120 $ hg branch dev-one
121 marked working directory as branch dev-one
122 (branches are permanent and global, did you want a bookmark?)
123 $ hg ci -m 'dev-one named branch'
124
125 $ hg tglog
126 @ 9: 'dev-one named branch' dev-one
127 |
128 | o 8: 'dev-two named branch' dev-two
129 | |
130 | o 7: 'H'
131 | |
132 | | o 6: 'G'
133 | |/|
134 | o | 5: 'F'
135 | | |
136 | | o 4: 'E'
137 | |/
138 o | 3: 'D'
139 | |
140 o | 2: 'C'
141 | |
142 o | 1: 'B'
143 |/
144 o 0: 'A'
145
146 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
147 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
148
149 $ hg tglog
150 @ 9: 'dev-two named branch' dev-two
151 |
152 o 8: 'H'
153 |
154 | o 7: 'G'
155 |/|
156 o | 6: 'F'
157 | |
158 o | 5: 'dev-one named branch' dev-one
159 | |
160 | o 4: 'E'
161 | |
162 o | 3: 'D'
163 | |
164 o | 2: 'C'
165 | |
166 o | 1: 'B'
167 |/
168 o 0: 'A'
169
170 $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches
171 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
172
173 $ hg tglog
174 @ 8: 'dev-two named branch' dev-two
44 175 |
45 176 o 7: 'H'
46 177 |
@@ -59,6 +190,7 b' Rebasing descendant onto ancestor across'
59 190 o 0: 'A'
60 191
61 192
193 Rebasing descendant onto ancestor across different named branches
62 194
63 195 $ hg rebase -s 1 -d 8 --keepbranches
64 196 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
@@ -70,7 +202,7 b' Rebasing descendant onto ancestor across'
70 202 |
71 203 o 6: 'B'
72 204 |
73 o 5: 'extra named branch' dev
205 o 5: 'dev-two named branch' dev-two
74 206 |
75 207 o 4: 'H'
76 208 |
@@ -96,7 +228,7 b' Rebasing descendant onto ancestor across'
96 228 |
97 229 o 6: 'B'
98 230 |
99 o 5: 'extra named branch'
231 o 5: 'dev-two named branch'
100 232 |
101 233 o 4: 'H'
102 234 |
General Comments 0
You need to be logged in to leave comments. Login now