Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG28a97cf212af: strip: don't reimplement any()
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| durin42 |
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/strip.py (7 lines) |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| if not revs: | if not revs: | ||||
| raise error.Abort(_('empty revision set')) | raise error.Abort(_('empty revision set')) | ||||
| descendants = set(cl.descendants(revs)) | descendants = set(cl.descendants(revs)) | ||||
| strippedrevs = revs.union(descendants) | strippedrevs = revs.union(descendants) | ||||
| roots = revs.difference(descendants) | roots = revs.difference(descendants) | ||||
| update = False | |||||
| # if one of the wdir parent is stripped we'll need | # if one of the wdir parent is stripped we'll need | ||||
| # to update away to an earlier revision | # to update away to an earlier revision | ||||
| for p in repo.dirstate.parents(): | update = any(p != nullid and cl.rev(p) in strippedrevs | ||||
| if p != nullid and cl.rev(p) in strippedrevs: | for p in repo.dirstate.parents()) | ||||
| update = True | |||||
| break | |||||
| rootnodes = set(cl.node(r) for r in roots) | rootnodes = set(cl.node(r) for r in roots) | ||||
| q = getattr(repo, 'mq', None) | q = getattr(repo, 'mq', None) | ||||
| if q is not None and q.applied: | if q is not None and q.applied: | ||||
| # refresh queue state if we're about to strip | # refresh queue state if we're about to strip | ||||
| # applied patches | # applied patches | ||||
| if cl.rev(repo.lookup('qtip')) in strippedrevs: | if cl.rev(repo.lookup('qtip')) in strippedrevs: | ||||