Details
Details
- Reviewers
marmoute indygreg - Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
marmoute | |
indygreg |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | hgext/strip.py (3 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
2f90e3b7763c | 3931a0ac4dde | Augie Fackler | May 18 2020, 4:43 PM |
"""strip changesets and their descendants from history | """strip changesets and their descendants from history | ||||
This extension allows you to strip changesets and all their descendants from the | This extension allows you to strip changesets and all their descendants from the | ||||
repository. See the command help for details. | repository. See the command help for details. | ||||
""" | """ | ||||
from __future__ import absolute_import | from __future__ import absolute_import | ||||
from mercurial.i18n import _ | from mercurial.i18n import _ | ||||
from mercurial.pycompat import getattr | from mercurial.pycompat import getattr | ||||
from mercurial import ( | from mercurial import ( | ||||
bookmarks as bookmarksmod, | bookmarks as bookmarksmod, | ||||
cmdutil, | cmdutil, | ||||
error, | error, | ||||
hg, | hg, | ||||
lock as lockmod, | lock as lockmod, | ||||
mergestate as mergestatemod, | |||||
node as nodemod, | node as nodemod, | ||||
pycompat, | pycompat, | ||||
registrar, | registrar, | ||||
repair, | repair, | ||||
scmutil, | scmutil, | ||||
util, | util, | ||||
) | ) | ||||
dirstate = repo.dirstate | dirstate = repo.dirstate | ||||
dirchanges = [f for f in dirstate if dirstate[f] != b'n'] | dirchanges = [f for f in dirstate if dirstate[f] != b'n'] | ||||
changedfiles.extend(dirchanges) | changedfiles.extend(dirchanges) | ||||
repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles) | repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles) | ||||
repo.dirstate.write(repo.currenttransaction()) | repo.dirstate.write(repo.currenttransaction()) | ||||
# clear resolve state | # clear resolve state | ||||
mergestatemod.mergestate.clean(repo, repo[b'.'].node()) | repo[None].mergestate(clean=True) | ||||
update = False | update = False | ||||
strip( | strip( | ||||
ui, | ui, | ||||
repo, | repo, | ||||
revs, | revs, | ||||
backup=backup, | backup=backup, | ||||
update=update, | update=update, | ||||
force=opts.get(b'force'), | force=opts.get(b'force'), | ||||
bookmarks=bookmarks, | bookmarks=bookmarks, | ||||
soft=opts[b'soft'], | soft=opts[b'soft'], | ||||
) | ) | ||||
return 0 | return 0 |