mercurial/merge.py
changeset 33321 d09e948dc303
parent 33311 f8f716da90fa
child 33323 252500520d60
--- a/mercurial/merge.py	Thu Jul 06 17:41:45 2017 -0700
+++ b/mercurial/merge.py	Thu Jul 06 14:33:18 2017 -0700
@@ -1514,6 +1514,8 @@
 
     Return the same tuple as applyupdates().
     """
+    # Avoid cycle.
+    from . import sparse
 
     # This function used to find the default destination if node was None, but
     # that's now in destutil.py.
@@ -1703,6 +1705,11 @@
                 if not branchmerge:
                     repo.dirstate.setbranch(p2.branch())
 
+    # If we're updating to a location, clean up any stale temporary includes
+    # (ex: this happens during hg rebase --abort).
+    if not branchmerge:
+        sparse.prunetemporaryincludes(repo)
+
     if not partial:
         repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
     return stats