Show More
@@ -1153,7 +1153,7 b' class queue:' | |||
|
1153 | 1153 | sortedseries.append((idx, p)) |
|
1154 | 1154 | |
|
1155 | 1155 | sortedseries.sort(reverse=True) |
|
1156 |
for |
|
|
1156 | for i, p in sortedseries: | |
|
1157 | 1157 | if i != -1: |
|
1158 | 1158 | del self.fullseries[i] |
|
1159 | 1159 | else: |
@@ -1177,7 +1177,6 b' class queue:' | |||
|
1177 | 1177 | firstrev = repo[self.applied[0].node].rev() |
|
1178 | 1178 | patches = [] |
|
1179 | 1179 | for i, rev in enumerate(revs): |
|
1180 | ||
|
1181 | 1180 | if rev < firstrev: |
|
1182 | 1181 | raise error.Abort(_(b'revision %d is not managed') % rev) |
|
1183 | 1182 | |
@@ -3225,45 +3224,46 b' def fold(ui, repo, *files, **opts):' | |||
|
3225 | 3224 | raise error.Abort(_(b'qfold requires at least one patch name')) |
|
3226 | 3225 | if not q.checktoppatch(repo)[0]: |
|
3227 | 3226 | raise error.Abort(_(b'no patches applied')) |
|
3228 | q.checklocalchanges(repo) | |
|
3229 | ||
|
3230 | message = cmdutil.logmessage(ui, opts) | |
|
3231 | ||
|
3232 | parent = q.lookup(b'qtip') | |
|
3233 | patches = [] | |
|
3234 | messages = [] | |
|
3235 | for f in files: | |
|
3236 | p = q.lookup(f) | |
|
3237 | if p in patches or p == parent: | |
|
3238 | ui.warn(_(b'skipping already folded patch %s\n') % p) | |
|
3239 | if q.isapplied(p): | |
|
3240 | raise error.Abort( | |
|
3241 | _(b'qfold cannot fold already applied patch %s') % p | |
|
3242 | ) | |
|
3243 | patches.append(p) | |
|
3244 | ||
|
3245 | for p in patches: | |
|
3227 | ||
|
3228 | with repo.wlock(): | |
|
3229 | q.checklocalchanges(repo) | |
|
3230 | ||
|
3231 | message = cmdutil.logmessage(ui, opts) | |
|
3232 | ||
|
3233 | parent = q.lookup(b'qtip') | |
|
3234 | patches = [] | |
|
3235 | messages = [] | |
|
3236 | for f in files: | |
|
3237 | p = q.lookup(f) | |
|
3238 | if p in patches or p == parent: | |
|
3239 | ui.warn(_(b'skipping already folded patch %s\n') % p) | |
|
3240 | if q.isapplied(p): | |
|
3241 | raise error.Abort( | |
|
3242 | _(b'qfold cannot fold already applied patch %s') % p | |
|
3243 | ) | |
|
3244 | patches.append(p) | |
|
3245 | ||
|
3246 | for p in patches: | |
|
3247 | if not message: | |
|
3248 | ph = patchheader(q.join(p), q.plainmode) | |
|
3249 | if ph.message: | |
|
3250 | messages.append(ph.message) | |
|
3251 | pf = q.join(p) | |
|
3252 | (patchsuccess, files, fuzz) = q.patch(repo, pf) | |
|
3253 | if not patchsuccess: | |
|
3254 | raise error.Abort(_(b'error folding patch %s') % p) | |
|
3255 | ||
|
3246 | 3256 | if not message: |
|
3247 | ph = patchheader(q.join(p), q.plainmode) | |
|
3248 |
|
|
|
3249 |
|
|
|
3250 | pf = q.join(p) | |
|
3251 | (patchsuccess, files, fuzz) = q.patch(repo, pf) | |
|
3252 | if not patchsuccess: | |
|
3253 | raise error.Abort(_(b'error folding patch %s') % p) | |
|
3254 | ||
|
3255 | if not message: | |
|
3256 | ph = patchheader(q.join(parent), q.plainmode) | |
|
3257 | message = ph.message | |
|
3258 | for msg in messages: | |
|
3259 | if msg: | |
|
3260 | if message: | |
|
3261 | message.append(b'* * *') | |
|
3262 | message.extend(msg) | |
|
3263 | message = b'\n'.join(message) | |
|
3264 | ||
|
3265 | diffopts = q.patchopts(q.diffopts(), *patches) | |
|
3266 | with repo.wlock(): | |
|
3257 | ph = patchheader(q.join(parent), q.plainmode) | |
|
3258 | message = ph.message | |
|
3259 | for msg in messages: | |
|
3260 | if msg: | |
|
3261 | if message: | |
|
3262 | message.append(b'* * *') | |
|
3263 | message.extend(msg) | |
|
3264 | message = b'\n'.join(message) | |
|
3265 | ||
|
3266 | diffopts = q.patchopts(q.diffopts(), *patches) | |
|
3267 | 3267 | q.refresh( |
|
3268 | 3268 | repo, |
|
3269 | 3269 | msg=message, |
General Comments 0
You need to be logged in to leave comments.
Login now