equal
deleted
inserted
replaced
4152 startctx = repo[newnodes[0]].p1() |
4152 startctx = repo[newnodes[0]].p1() |
4153 else: |
4153 else: |
4154 startctx = repo[b'.'] |
4154 startctx = repo[b'.'] |
4155 # whether to strip or not |
4155 # whether to strip or not |
4156 cleanup = False |
4156 cleanup = False |
4157 from . import hg |
|
4158 |
4157 |
4159 if newnodes: |
4158 if newnodes: |
4160 newnodes = [repo[r].rev() for r in newnodes] |
4159 newnodes = [repo[r].rev() for r in newnodes] |
4161 cleanup = True |
4160 cleanup = True |
4162 # checking that none of the newnodes turned public or is public |
4161 # checking that none of the newnodes turned public or is public |
4180 ) |
4179 ) |
4181 cleanup = False |
4180 cleanup = False |
4182 |
4181 |
4183 if cleanup: |
4182 if cleanup: |
4184 with repo.wlock(), repo.lock(): |
4183 with repo.wlock(), repo.lock(): |
4185 hg.updaterepo(repo, startctx.node(), overwrite=True) |
4184 mergemod.clean_update(startctx) |
4186 # stripping the new nodes created |
4185 # stripping the new nodes created |
4187 strippoints = [ |
4186 strippoints = [ |
4188 c.node() for c in repo.set(b"roots(%ld)", newnodes) |
4187 c.node() for c in repo.set(b"roots(%ld)", newnodes) |
4189 ] |
4188 ] |
4190 repair.strip(repo.ui, repo, strippoints, backup=False) |
4189 repair.strip(repo.ui, repo, strippoints, backup=False) |
4191 |
4190 |
4192 if not cleanup: |
4191 if not cleanup: |
4193 # we don't update to the startnode if we can't strip |
4192 # we don't update to the startnode if we can't strip |
4194 startctx = repo[b'.'] |
4193 startctx = repo[b'.'] |
4195 hg.updaterepo(repo, startctx.node(), overwrite=True) |
4194 mergemod.clean_update(startctx) |
4196 |
4195 |
4197 ui.status(_(b"graft aborted\n")) |
4196 ui.status(_(b"graft aborted\n")) |
4198 ui.status(_(b"working directory is now at %s\n") % startctx.hex()[:12]) |
4197 ui.status(_(b"working directory is now at %s\n") % startctx.hex()[:12]) |
4199 graftstate.delete() |
4198 graftstate.delete() |
4200 return 0 |
4199 return 0 |