hgext/rebase.py
changeset 40366 b14fdf1fb615
parent 40293 c303d65d2e34
child 40452 f07d4f94f098
child 40693 ea84c2b286a2
equal deleted inserted replaced
40365:4f37af86d5d5 40366:b14fdf1fb615
  1186     if wctx.isinmemory():
  1186     if wctx.isinmemory():
  1187         wctx.setbase(repo[p1])
  1187         wctx.setbase(repo[p1])
  1188     else:
  1188     else:
  1189         if repo['.'].rev() != p1:
  1189         if repo['.'].rev() != p1:
  1190             repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
  1190             repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
  1191             mergemod.update(repo, p1, False, True)
  1191             mergemod.update(repo, p1, branchmerge=False, force=True)
  1192         else:
  1192         else:
  1193             repo.ui.debug(" already in destination\n")
  1193             repo.ui.debug(" already in destination\n")
  1194         # This is, alas, necessary to invalidate workingctx's manifest cache,
  1194         # This is, alas, necessary to invalidate workingctx's manifest cache,
  1195         # as well as other data we litter on it in other places.
  1195         # as well as other data we litter on it in other places.
  1196         wctx = repo[None]
  1196         wctx = repo[None]
  1198     repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev]))
  1198     repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev]))
  1199     if base is not None:
  1199     if base is not None:
  1200         repo.ui.debug("   detach base %d:%s\n" % (base, repo[base]))
  1200         repo.ui.debug("   detach base %d:%s\n" % (base, repo[base]))
  1201     # When collapsing in-place, the parent is the common ancestor, we
  1201     # When collapsing in-place, the parent is the common ancestor, we
  1202     # have to allow merging with it.
  1202     # have to allow merging with it.
  1203     stats = mergemod.update(repo, rev, True, True, base, collapse,
  1203     stats = mergemod.update(repo, rev, branchmerge=True, force=True,
       
  1204                             ancestor=base, mergeancestor=collapse,
  1204                             labels=['dest', 'source'], wc=wctx)
  1205                             labels=['dest', 'source'], wc=wctx)
  1205     if collapse:
  1206     if collapse:
  1206         copies.duplicatecopies(repo, wctx, rev, dest)
  1207         copies.duplicatecopies(repo, wctx, rev, dest)
  1207     else:
  1208     else:
  1208         # If we're not using --collapse, we need to
  1209         # If we're not using --collapse, we need to
  1641             updateifonnodes.add(originalwd)
  1642             updateifonnodes.add(originalwd)
  1642             shouldupdate = repo['.'].rev() in updateifonnodes
  1643             shouldupdate = repo['.'].rev() in updateifonnodes
  1643 
  1644 
  1644             # Update away from the rebase if necessary
  1645             # Update away from the rebase if necessary
  1645             if shouldupdate or needupdate(repo, state):
  1646             if shouldupdate or needupdate(repo, state):
  1646                 mergemod.update(repo, originalwd, False, True)
  1647                 mergemod.update(repo, originalwd, branchmerge=False, force=True)
  1647 
  1648 
  1648             # Strip from the first rebased revision
  1649             # Strip from the first rebased revision
  1649             if rebased:
  1650             if rebased:
  1650                 repair.strip(repo.ui, repo, strippoints, backup=backup)
  1651                 repair.strip(repo.ui, repo, strippoints, backup=backup)
  1651 
  1652