mercurial/repair.py
changeset 32651 5732e6d2b369
parent 32646 ed566a59f660
child 32652 71eb6a098315
--- a/mercurial/repair.py	Thu Jun 01 08:44:01 2017 +0200
+++ b/mercurial/repair.py	Thu Jun 01 12:08:49 2017 +0200
@@ -23,7 +23,7 @@
     util,
 )
 
-def _bundle(repo, bases, heads, node, suffix, compress=True):
+def _bundle(repo, bases, heads, node, suffix, compress=True, obsolescence=True):
     """create a bundle with the specified revisions as a backup"""
 
     backupdir = "strip-backup"
@@ -49,7 +49,7 @@
         bundletype = "HG10UN"
 
     outgoing = discovery.outgoing(repo, missingroots=bases, missingheads=heads)
-    contentopts = {'cg.version': cgversion, 'obsolescence': True}
+    contentopts = {'cg.version': cgversion, 'obsolescence': obsolescence}
     return bundle2.writenewbundle(repo.ui, repo, 'strip', name, bundletype,
                                   outgoing, contentopts, vfs, compression=comp)
 
@@ -150,8 +150,13 @@
     tmpbundlefile = None
     if saveheads:
         # do not compress temporary bundle if we remove it from disk later
+        #
+        # We do not include obsolescence, it might re-introduce prune markers
+        # we are trying to strip.  This is harmless since the stripped markers
+        # are already backed up and we did not touched the markers for the
+        # saved changesets.
         tmpbundlefile = _bundle(repo, savebases, saveheads, node, 'temp',
-                            compress=False)
+                                compress=False, obsolescence=False)
 
     mfst = repo.manifestlog._revlog