Show More
@@ -273,24 +273,24 b' def getshelvename(repo, parent, opts):' | |||||
273 | raise error.Abort(_("shelved change names may not start with '.'")) |
|
273 | raise error.Abort(_("shelved change names may not start with '.'")) | |
274 | return name |
|
274 | return name | |
275 |
|
275 | |||
276 | def _docreatecmd(ui, repo, pats, opts): |
|
276 | def mutableancestors(ctx): | |
277 |
|
|
277 | """return all mutable ancestors for ctx (included) | |
278 | """return all mutable ancestors for ctx (included) |
|
|||
279 |
|
278 | |||
280 |
|
|
279 | Much faster than the revset ancestors(ctx) & draft()""" | |
281 |
|
|
280 | seen = set([nodemod.nullrev]) | |
282 |
|
|
281 | visit = collections.deque() | |
283 |
|
|
282 | visit.append(ctx) | |
284 |
|
|
283 | while visit: | |
285 |
|
|
284 | ctx = visit.popleft() | |
286 |
|
|
285 | yield ctx.node() | |
287 |
|
|
286 | for parent in ctx.parents(): | |
288 |
|
|
287 | rev = parent.rev() | |
289 |
|
|
288 | if rev not in seen: | |
290 |
|
|
289 | seen.add(rev) | |
291 |
|
|
290 | if parent.mutable(): | |
292 |
|
|
291 | visit.append(parent) | |
293 |
|
292 | |||
|
293 | def _docreatecmd(ui, repo, pats, opts): | |||
294 | wctx = repo[None] |
|
294 | wctx = repo[None] | |
295 | parents = wctx.parents() |
|
295 | parents = wctx.parents() | |
296 | if len(parents) > 1: |
|
296 | if len(parents) > 1: |
General Comments 0
You need to be logged in to leave comments.
Login now