mercurial/commands.py
changeset 38508 39db5a01cd53
parent 38487 8d9d0d30cfcc
child 38540 1e25782a7583
equal deleted inserted replaced
38507:03e7ec8180f0 38508:39db5a01cd53
  2449                            "branch, can't strip\n"))
  2449                            "branch, can't strip\n"))
  2450             cleanup = False
  2450             cleanup = False
  2451 
  2451 
  2452         if cleanup:
  2452         if cleanup:
  2453             with repo.wlock(), repo.lock():
  2453             with repo.wlock(), repo.lock():
  2454                 hg.updaterepo(repo, startctx.node(), True)
  2454                 hg.updaterepo(repo, startctx.node(), overwrite=True)
  2455                 # stripping the new nodes created
  2455                 # stripping the new nodes created
  2456                 strippoints = [c.node() for c in repo.set("roots(%ld)",
  2456                 strippoints = [c.node() for c in repo.set("roots(%ld)",
  2457                                                           newnodes)]
  2457                                                           newnodes)]
  2458                 repair.strip(repo.ui, repo, strippoints, backup=False)
  2458                 repair.strip(repo.ui, repo, strippoints, backup=False)
  2459 
  2459 
  2460     if not cleanup:
  2460     if not cleanup:
  2461         # we don't update to the startnode if we can't strip
  2461         # we don't update to the startnode if we can't strip
  2462         startctx = repo['.']
  2462         startctx = repo['.']
  2463         hg.updaterepo(repo, startctx.node(), True)
  2463         hg.updaterepo(repo, startctx.node(), overwrite=True)
  2464 
  2464 
  2465     ui.status(_("graft aborted\n"))
  2465     ui.status(_("graft aborted\n"))
  2466     ui.status(_("working directory is now at %s\n") % startctx.hex()[:12])
  2466     ui.status(_("working directory is now at %s\n") % startctx.hex()[:12])
  2467     graftstate.delete()
  2467     graftstate.delete()
  2468     return 0
  2468     return 0
  2478 def _stopgraft(ui, repo, graftstate):
  2478 def _stopgraft(ui, repo, graftstate):
  2479     """stop the interrupted graft"""
  2479     """stop the interrupted graft"""
  2480     if not graftstate.exists():
  2480     if not graftstate.exists():
  2481         raise error.Abort(_("no interrupted graft found"))
  2481         raise error.Abort(_("no interrupted graft found"))
  2482     pctx = repo['.']
  2482     pctx = repo['.']
  2483     hg.updaterepo(repo, pctx.node(), True)
  2483     hg.updaterepo(repo, pctx.node(), overwrite=True)
  2484     graftstate.delete()
  2484     graftstate.delete()
  2485     ui.status(_("stopped the interrupted graft\n"))
  2485     ui.status(_("stopped the interrupted graft\n"))
  2486     ui.status(_("working directory is now at %s\n") % pctx.hex()[:12])
  2486     ui.status(_("working directory is now at %s\n") % pctx.hex()[:12])
  2487     return 0
  2487     return 0
  2488 
  2488