mercurial/commands.py
branchstable
changeset 10505 b3311e26f94f
parent 10479 bb508b312359
child 10515 98bc3e195720
equal deleted inserted replaced
10504:d2c1fc440533 10505:b3311e26f94f
  2231             raise util.Abort(_('working dir not at a head rev - '
  2231             raise util.Abort(_('working dir not at a head rev - '
  2232                                'use "hg update" or merge with an explicit rev'))
  2232                                'use "hg update" or merge with an explicit rev'))
  2233         node = parent == bheads[0] and bheads[-1] or bheads[0]
  2233         node = parent == bheads[0] and bheads[-1] or bheads[0]
  2234 
  2234 
  2235     if opts.get('preview'):
  2235     if opts.get('preview'):
  2236         p1 = repo['.']
  2236         # find nodes that are ancestors of p2 but not of p1
  2237         p2 = repo[node]
  2237         p1 = repo.lookup('.')
  2238         common = p1.ancestor(p2)
  2238         p2 = repo.lookup(node)
  2239         roots, heads = [common.node()], [p2.node()]
  2239         nodes = repo.changelog.findmissing(common=[p1], heads=[p2])
       
  2240 
  2240         displayer = cmdutil.show_changeset(ui, repo, opts)
  2241         displayer = cmdutil.show_changeset(ui, repo, opts)
  2241         for node in repo.changelog.nodesbetween(roots=roots, heads=heads)[0]:
  2242         for node in nodes:
  2242             if node not in roots:
  2243             displayer.show(repo[node])
  2243                 displayer.show(repo[node])
       
  2244         displayer.close()
  2244         displayer.close()
  2245         return 0
  2245         return 0
  2246 
  2246 
  2247     return hg.merge(repo, node, force=opts.get('force'))
  2247     return hg.merge(repo, node, force=opts.get('force'))
  2248 
  2248