hgext/histedit.py
changeset 42979 699102b10530
parent 42650 701341f57ceb
child 42981 b4093d1d3b18
equal deleted inserted replaced
42978:f200bea8470b 42979:699102b10530
  1968     if not revs:
  1968     if not revs:
  1969         raise error.Abort(_('%s is not an ancestor of working directory') %
  1969         raise error.Abort(_('%s is not an ancestor of working directory') %
  1970                          node.short(root))
  1970                          node.short(root))
  1971 
  1971 
  1972     ctxs = [repo[r] for r in revs]
  1972     ctxs = [repo[r] for r in revs]
       
  1973 
       
  1974     wctx = repo[None]
       
  1975     # Please don't ask me why `ancestors` is this value. I figured it
       
  1976     # out with print-debugging, not by actually understanding what the
       
  1977     # merge code is doing. :(
       
  1978     ancs = [repo['.']]
       
  1979     # Sniff-test to make sure we won't collide with untracked files in
       
  1980     # the working directory. If we don't do this, we can get a
       
  1981     # collision after we've started histedit and backing out gets ugly
       
  1982     # for everyone, especially the user.
       
  1983     for c in [ctxs[0].p1()] + ctxs:
       
  1984         try:
       
  1985             mergemod.calculateupdates(
       
  1986                 repo, wctx, c, ancs,
       
  1987                 # These parameters were determined by print-debugging
       
  1988                 # what happens later on inside histedit.
       
  1989                 False, # branchmerge
       
  1990                 False, # force
       
  1991                 False, # acceptremote
       
  1992                 False, # followcopies
       
  1993             )
       
  1994         except error.Abort:
       
  1995             raise error.Abort(
       
  1996        _("untracked files in working directory conflict with files in %s") % (
       
  1997            c))
       
  1998 
  1973     if not rules:
  1999     if not rules:
  1974         comment = geteditcomment(ui, node.short(root), node.short(topmost))
  2000         comment = geteditcomment(ui, node.short(root), node.short(topmost))
  1975         actions = [pick(state, r) for r in revs]
  2001         actions = [pick(state, r) for r in revs]
  1976         rules = ruleeditor(repo, ui, actions, comment)
  2002         rules = ruleeditor(repo, ui, actions, comment)
  1977     else:
  2003     else: