Mercurial > hg
comparison hgext/strip.py @ 24709:69154e0ae384
strip: properly clear resolve state with --keep (issue4593)
Normal updates automatically clean up the resolve state, but strip
--keep does a "manual" update that bypasses the normal machinery. This
adds a mergestate reset.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 13 Apr 2015 07:42:25 -0500 |
parents | 1ff35d76421c |
children | 08ec11e3ae4c |
comparison
equal
deleted
inserted
replaced
24708:fb47816e1a9c | 24709:69154e0ae384 |
---|---|
5 """ | 5 """ |
6 from mercurial.i18n import _ | 6 from mercurial.i18n import _ |
7 from mercurial.node import nullid | 7 from mercurial.node import nullid |
8 from mercurial.lock import release | 8 from mercurial.lock import release |
9 from mercurial import cmdutil, hg, scmutil, util | 9 from mercurial import cmdutil, hg, scmutil, util |
10 from mercurial import repair, bookmarks | 10 from mercurial import repair, bookmarks, merge |
11 | 11 |
12 cmdtable = {} | 12 cmdtable = {} |
13 command = cmdutil.command(cmdtable) | 13 command = cmdutil.command(cmdtable) |
14 testedwith = 'internal' | 14 testedwith = 'internal' |
15 | 15 |
203 dirchanges = [f for f in dirstate if dirstate[f] != 'n'] | 203 dirchanges = [f for f in dirstate if dirstate[f] != 'n'] |
204 changedfiles.extend(dirchanges) | 204 changedfiles.extend(dirchanges) |
205 | 205 |
206 repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles) | 206 repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles) |
207 repo.dirstate.write() | 207 repo.dirstate.write() |
208 | |
209 # clear resolve state | |
210 ms = merge.mergestate(repo) | |
211 ms.reset(repo['.'].node()) | |
212 | |
208 update = False | 213 update = False |
209 | 214 |
210 | 215 |
211 strip(ui, repo, revs, backup=backup, update=update, | 216 strip(ui, repo, revs, backup=backup, update=update, |
212 force=opts.get('force'), bookmark=opts.get('bookmark')) | 217 force=opts.get('force'), bookmark=opts.get('bookmark')) |