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