comparison mercurial/merge.py @ 33321:d09e948dc303

sparse: move pruning of temporary includes into core This was our last method on the custom repo type, meaning we could remove that custom type and inline the 2 lines of code into reposetup(). As part of the move, instead of wrapping merge.update() from the sparse extension, we inline the function call. The ported function now no-ops if sparse isn't enabled, making it safe to always call. The call site in update() may not be the most appropriate. But it matches the previous behavior, which is the safest thing to do. It can be improved later.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 06 Jul 2017 14:33:18 -0700
parents f8f716da90fa
children 252500520d60
comparison
equal deleted inserted replaced
33320:153456f02426 33321:d09e948dc303
1512 2 = abort: uncommitted changes (commit or update --clean to discard changes) 1512 2 = abort: uncommitted changes (commit or update --clean to discard changes)
1513 3 = abort: uncommitted changes (checked in commands.py) 1513 3 = abort: uncommitted changes (checked in commands.py)
1514 1514
1515 Return the same tuple as applyupdates(). 1515 Return the same tuple as applyupdates().
1516 """ 1516 """
1517 # Avoid cycle.
1518 from . import sparse
1517 1519
1518 # This function used to find the default destination if node was None, but 1520 # This function used to find the default destination if node was None, but
1519 # that's now in destutil.py. 1521 # that's now in destutil.py.
1520 assert node is not None 1522 assert node is not None
1521 if not branchmerge and not force: 1523 if not branchmerge and not force:
1701 util.unlink(repo.vfs.join('updatestate')) 1703 util.unlink(repo.vfs.join('updatestate'))
1702 1704
1703 if not branchmerge: 1705 if not branchmerge:
1704 repo.dirstate.setbranch(p2.branch()) 1706 repo.dirstate.setbranch(p2.branch())
1705 1707
1708 # If we're updating to a location, clean up any stale temporary includes
1709 # (ex: this happens during hg rebase --abort).
1710 if not branchmerge:
1711 sparse.prunetemporaryincludes(repo)
1712
1706 if not partial: 1713 if not partial:
1707 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3]) 1714 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
1708 return stats 1715 return stats
1709 1716
1710 def graft(repo, ctx, pctx, labels, keepparent=False): 1717 def graft(repo, ctx, pctx, labels, keepparent=False):