Patchwork [7,of,7] strip: strip obsmarkers exclusive to the stripped changeset

login
register
mail settings
Submitter Pierre-Yves David
Date June 1, 2017, 1:39 p.m.
Message ID <fb16a4d85cf46afbc12b.1496324390@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21122/
State Accepted
Headers show

Comments

Pierre-Yves David - June 1, 2017, 1:39 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1495289999 -7200
#      Sat May 20 16:19:59 2017 +0200
# Node ID fb16a4d85cf46afbc12bb61f8d22784cef31d1dc
# Parent  2c44bd45fdeeb3a8bf1762af4a81af3914fadc29
# EXP-Topic obsstrip
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r fb16a4d85cf4
strip: strip obsmarkers exclusive to the stripped changeset

This is it, `hg strip --rev X` will now also remove obsolescence markers
exclusive to X. Since a previous changeset, the obsmarkers has been backed up
in the strip backup bundle, so it is possible to restore them.

Note: stripping obsmarkers means the precursors of the stripped changeset might no
longer be obsolete after the strip.

Stripping changeset without obsmarkers can be useful when building test case. So
It is possible to disable the stripping of obsmarkers using the
'devel.strip-obsmarkers' config option.

Test change have been carefully validated.
Sean Farley - June 1, 2017, 8:21 p.m.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1495289999 -7200
> #      Sat May 20 16:19:59 2017 +0200
> # Node ID fb16a4d85cf46afbc12bb61f8d22784cef31d1dc
> # Parent  2c44bd45fdeeb3a8bf1762af4a81af3914fadc29
> # EXP-Topic obsstrip
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r fb16a4d85cf4
> strip: strip obsmarkers exclusive to the stripped changeset
>
> This is it, `hg strip --rev X` will now also remove obsolescence markers
> exclusive to X. Since a previous changeset, the obsmarkers has been backed up
> in the strip backup bundle, so it is possible to restore them.
>
> Note: stripping obsmarkers means the precursors of the stripped changeset might no
> longer be obsolete after the strip.
>
> Stripping changeset without obsmarkers can be useful when building test case. So
> It is possible to disable the stripping of obsmarkers using the
> 'devel.strip-obsmarkers' config option.
>
> Test change have been carefully validated.

Gleefully queued! I've read and re-read this series a few times but I
will test it out a bit locally just to make sure I understand and will
push after that.
Denis Laxalde - June 3, 2017, 7:36 a.m.
Sean Farley a écrit :
> Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:
>
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@octobus.net>
>> # Date 1495289999 -7200
>> #      Sat May 20 16:19:59 2017 +0200
>> # Node ID fb16a4d85cf46afbc12bb61f8d22784cef31d1dc
>> # Parent  2c44bd45fdeeb3a8bf1762af4a81af3914fadc29
>> # EXP-Topic obsstrip
>> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
>> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r fb16a4d85cf4
>> strip: strip obsmarkers exclusive to the stripped changeset
>>
>> This is it, `hg strip --rev X` will now also remove obsolescence markers
>> exclusive to X. Since a previous changeset, the obsmarkers has been backed up
>> in the strip backup bundle, so it is possible to restore them.
>>
>> Note: stripping obsmarkers means the precursors of the stripped changeset might no
>> longer be obsolete after the strip.
>>
>> Stripping changeset without obsmarkers can be useful when building test case. So
>> It is possible to disable the stripping of obsmarkers using the
>> 'devel.strip-obsmarkers' config option.
>>
>> Test change have been carefully validated.
>
> Gleefully queued! I've read and re-read this series a few times but I
> will test it out a bit locally just to make sure I understand and will
> push after that.
>

I've played a bit with this, it's really nice. This solves a real issue
for local workflows (ability to "undo" history modifications, including
hash preservation) while preserving a sensible behavior in distributed
situations. From my perspective, that's a clear user experience win.

Thank you Pierre-Yves!
Jun Wu - June 3, 2017, 8:41 a.m.
I don't think this is correct in a distributed world. It could potentially
break divergence detection.

Excerpts from Pierre-Yves David's message of 2017-06-01 15:39:50 +0200:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1495289999 -7200
> #      Sat May 20 16:19:59 2017 +0200
> # Node ID fb16a4d85cf46afbc12bb61f8d22784cef31d1dc
> # Parent  2c44bd45fdeeb3a8bf1762af4a81af3914fadc29
> # EXP-Topic obsstrip
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ 
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/  -r fb16a4d85cf4
> strip: strip obsmarkers exclusive to the stripped changeset
> 
> This is it, `hg strip --rev X` will now also remove obsolescence markers
> exclusive to X. Since a previous changeset, the obsmarkers has been backed up
> in the strip backup bundle, so it is possible to restore them.
> 
> Note: stripping obsmarkers means the precursors of the stripped changeset might no
> longer be obsolete after the strip.
> 
> Stripping changeset without obsmarkers can be useful when building test case. So
> It is possible to disable the stripping of obsmarkers using the
> 'devel.strip-obsmarkers' config option.
> 
> Test change have been carefully validated.
> 
> diff --git a/mercurial/repair.py b/mercurial/repair.py
> --- a/mercurial/repair.py
> +++ b/mercurial/repair.py
> @@ -122,6 +122,13 @@ def strip(ui, repo, nodelist, backup=Tru
>      savebases = [cl.node(r) for r in saverevs]
>      stripbases = [cl.node(r) for r in tostrip]
>  
> +    stripobsidx = obsmarkers = ()
> +    if repo.ui.configbool('devel', 'strip-obsmarkers', True):
> +        obsmarkers = obsolete.exclusivemarkers(repo, stripbases)
> +    if obsmarkers:
> +        stripobsidx = [i for i, m in enumerate(repo.obsstore)
> +                       if m in obsmarkers]
> +
>      # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), but
>      # is much faster
>      newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip)
> @@ -185,6 +192,9 @@ def strip(ui, repo, nodelist, backup=Tru
>                  if troffset == 0:
>                      repo.store.markremoved(file)
>  
> +            deleteobsmarkers(repo.obsstore, stripobsidx)
> +            del repo.obsstore
> +
>          if tmpbundlefile:
>              ui.note(_("adding branch\n"))
>              f = vfs.open(tmpbundlefile, "rb")
> diff --git a/tests/test-obsolete-bundle-strip.t b/tests/test-obsolete-bundle-strip.t
> --- a/tests/test-obsolete-bundle-strip.t
> +++ b/tests/test-obsolete-bundle-strip.t
> @@ -80,13 +80,25 @@ obsmarkers. It also check the obsmarkers
>    >     if [ $orphan -eq 0 ];
>    >     then
>    >         printf "# stripping: "
> +  >         prestripfile="${prefix}-pre-strip.txt"
> +  >         poststripfile="${prefix}-post-strip.txt"
> +  >         strippedfile="${prefix}-stripped-markers.txt"
> +  >         hg debugobsolete --hidden | sort | sed 's/^/    /' > "${prestripfile}"
>    >         hg strip --hidden --rev "${revs}"
> +  >         hg debugobsolete --hidden | sort | sed 's/^/    /' > "${poststripfile}"
>    >         hg debugbundle .hg/strip-backup/* | grep "obsmarkers --" -A 100 | sed 1,2d > "${stripcontentfile}"
>    >         echo '### Backup markers ###'
>    >         cat "${stripcontentfile}"
>    >         echo '### diff <relevant> <backed-up> ###'
>    >         cmp "${markersfile}" "${stripcontentfile}" || diff -u "${markersfile}" "${stripcontentfile}"
>    >         echo '#################################'
> +  >         cat "${prestripfile}" "${poststripfile}" | sort | uniq -u > "${strippedfile}"
> +  >         echo '### Stripped markers ###'
> +  >         cat "${strippedfile}"
> +  >         echo '### diff <exclusive> <stripped> ###'
> +  >         cmp "${exclufile}" "${strippedfile}" || diff -u "${exclufile}" "${strippedfile}"
> +  >         echo '#################################'
> +  >         # restore and clean up repo for the next test
>    >         hg unbundle .hg/strip-backup/* | sed 's/^/# unbundling: /'
>    >         # clean up directory for the next test
>    >         rm .hg/strip-backup/*
> @@ -150,6 +162,9 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
> @@ -180,10 +195,16 @@ Actual testing
>        a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
> +  # unbundling: 2 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>    $ testrevs 'desc("C-A")'
> @@ -212,10 +233,17 @@ Actual testing
>        a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
> +  # unbundling: 3 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>  chain with prune children
> @@ -295,10 +323,15 @@ problematic)
>        29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files
> +  # unbundling: 1 new obsolescence markers
>    # unbundling: (run 'hg update' to get a working copy)
>  
>    $ testrevs 'desc("C-A1")'
> @@ -324,10 +357,15 @@ problematic)
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
> +  # unbundling: 1 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>  bundling multiple revisions
> @@ -378,10 +416,17 @@ bundling multiple revisions
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 3 changesets with 3 changes to 3 files (+1 heads)
> +  # unbundling: 3 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>  chain with precursors also pruned
> @@ -440,6 +485,9 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
> @@ -469,10 +517,15 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
> +  # unbundling: 1 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>    $ testrevs 'desc("C-A")'
> @@ -501,10 +554,17 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
> +  # unbundling: 3 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>  chain with missing prune
> @@ -532,7 +592,7 @@ setup
>  
>  (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
>  
> -  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup
> +  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
>  
>    $ hg up 'desc("ROOT")'
>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> @@ -574,10 +634,17 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files
> +  # unbundling: 3 new obsolescence markers
>    # unbundling: (run 'hg update' to get a working copy)
>  
>  chain with precursors also pruned
> @@ -603,7 +670,7 @@ setup
>  
>  (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
>  
> -  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup
> +  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
>  
>    $ hg up 'desc("ROOT")'
>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> @@ -645,10 +712,17 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files
> +  # unbundling: 3 new obsolescence markers
>    # unbundling: (run 'hg update' to get a working copy)
>  
>  Chain with fold and split
> @@ -730,6 +804,9 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
> @@ -755,6 +832,9 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
> @@ -780,6 +860,9 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
> @@ -805,6 +888,9 @@ Actual testing
>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
> @@ -857,10 +943,20 @@ Actual testing
>        c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
> +  # unbundling: 6 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>  Bundle multiple revisions
> @@ -1050,10 +1146,23 @@ Bundle multiple revisions
>        c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +      c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 5 changesets with 5 changes to 5 files (+4 heads)
> +  # unbundling: 9 new obsolescence markers
>    # unbundling: (run 'hg heads' to see heads)
>  
>  changeset pruned on its own
> @@ -1117,10 +1226,15 @@ Actual testing
>        cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 1 changesets with 1 changes to 1 files
> +  # unbundling: 1 new obsolescence markers
>    # unbundling: (run 'hg update' to get a working copy)
>    $ testrevs 'desc("C-")'
>    ### Matched revisions###
> @@ -1140,8 +1254,13 @@ Actual testing
>        cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>    ### diff <relevant> <backed-up> ###
>    #################################
> +  ### Stripped markers ###
> +      cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +  ### diff <exclusive> <stripped> ###
> +  #################################
>    # unbundling: adding changesets
>    # unbundling: adding manifests
>    # unbundling: adding file changes
>    # unbundling: added 2 changesets with 2 changes to 2 files
> +  # unbundling: 1 new obsolescence markers
>    # unbundling: (run 'hg update' to get a working copy)
> diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
> --- a/tests/test-obsolete.t
> +++ b/tests/test-obsolete.t
> @@ -1211,35 +1211,88 @@ Test ability to pull changeset with loca
>    o  0:a78f55e5508c (draft) [ ] 0
>    
>  
> +  $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no
> +  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-39c978dc-backup.hg (glob)
> +  $ hg debugobsolete
> +  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
> +  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
> +  $ hg log -G
> +  @  2:b0551702f918 (draft) [tip ] 2
> +  |
> +  o  1:e016b03fd86f (draft) [ ] 1
> +  |
> +  o  0:a78f55e5508c (draft) [ ] 0
> +  
> +  $ hg log -G --hidden
> +  @  2:b0551702f918 (draft) [tip ] 2
> +  |
> +  o  1:e016b03fd86f (draft) [ ] 1
> +  |
> +  o  0:a78f55e5508c (draft) [ ] 0
> +  
> +  $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg
> +  Stream params: sortdict([('Compression', 'BZ')])
> +  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
> +      e008cf2834908e5d6b0f792a9d4b0e2272260fb8
> +      f27abbcc1f77fb409cf9160482fe619541e2d605
> +  obsmarkers -- 'sortdict()'
> +      version: 1 (70 bytes)
> +      f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
> +
> +  $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg
> +  pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg
> +  searching for changes
> +  no changes found
> +  $ hg debugobsolete
> +  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
> +  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
> +  $ hg log -G
> +  @  2:b0551702f918 (draft) [tip ] 2
> +  |
> +  o  1:e016b03fd86f (draft) [ ] 1
> +  |
> +  o  0:a78f55e5508c (draft) [ ] 0
> +  
> +  $ hg log -G --hidden
> +  @  2:b0551702f918 (draft) [tip ] 2
> +  |
> +  o  1:e016b03fd86f (draft) [ ] 1
> +  |
> +  o  0:a78f55e5508c (draft) [ ] 0
> +  
> +
> +Testing that strip remove markers:
> +
>    $ hg strip -r 1 --config extensions.strip=
>    0 files updated, 0 files merged, 2 files removed, 0 files unresolved
> -  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob)
> +  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg (glob)
> +  $ hg debugobsolete
>    $ hg log -G
>    @  0:a78f55e5508c (draft) [tip ] 0
>    
>    $ hg log -G --hidden
>    @  0:a78f55e5508c (draft) [tip ] 0
>    
> -  $ hg debugbundle .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
> +  $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
>    Stream params: sortdict([('Compression', 'BZ')])
> -  changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])"
> +  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
>        e016b03fd86fcccc54817d120b90b751aaf367d6
> -      e008cf2834908e5d6b0f792a9d4b0e2272260fb8
> -      f27abbcc1f77fb409cf9160482fe619541e2d605
>        b0551702f918510f01ae838ab03a463054c67b46
>    obsmarkers -- 'sortdict()'
>        version: 1 (139 bytes)
>        e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>        f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>  
> -  $ hg pull .hg/strip-backup/*
> -  pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
> -  searching for changes
> +  $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
>    adding changesets
>    adding manifests
>    adding file changes
>    added 2 changesets with 2 changes to 2 files
> +  2 new obsolescence markers
>    (run 'hg update' to get a working copy)
> +  $ hg debugobsolete | sort
> +  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
> +  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
>    $ hg log -G
>    o  2:b0551702f918 (draft) [tip ] 2
>    |
> diff --git a/tests/test-subrepo-missing.t b/tests/test-subrepo-missing.t
> --- a/tests/test-subrepo-missing.t
> +++ b/tests/test-subrepo-missing.t
> @@ -108,7 +108,7 @@ check that --hidden is propagated to the
>  verify will warn if locked-in subrepo revisions are hidden or missing
>  
>    $ hg ci -m "amended subrepo (again)"
> -  $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip'
> +  $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip' --config devel.strip-obsmarkers=no
>    $ hg verify
>    checking changesets
>    checking manifests
> diff --git a/tests/testlib/exchange-obsmarker-util.sh b/tests/testlib/exchange-obsmarker-util.sh
> --- a/tests/testlib/exchange-obsmarker-util.sh
> +++ b/tests/testlib/exchange-obsmarker-util.sh
> @@ -32,6 +32,9 @@ evolution=all
>  # we need to strip some changeset for some test cases
>  hgext.strip=
>  
> +[devel]
> +strip-obsmarkers = no
> +
>  [alias]
>  # fix date used to create obsolete markers.
>  debugobsolete=debugobsolete -d '0 0'
Pierre-Yves David - June 3, 2017, 12:54 p.m.
On 06/03/2017 10:41 AM, Jun Wu wrote:
> I don't think this is correct in a distributed world.

Strip entirely removes information from the repository storage. That 
never played well with distribution and is not meant to. I see it as a 
maintenance command.

> It could potentially break divergence detection.

I'm not sure what you mean here, can you elaborate?

>
> Excerpts from Pierre-Yves David's message of 2017-06-01 15:39:50 +0200:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@octobus.net>
>> # Date 1495289999 -7200
>> #      Sat May 20 16:19:59 2017 +0200
>> # Node ID fb16a4d85cf46afbc12bb61f8d22784cef31d1dc
>> # Parent  2c44bd45fdeeb3a8bf1762af4a81af3914fadc29
>> # EXP-Topic obsstrip
>> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
>> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/  -r fb16a4d85cf4
>> strip: strip obsmarkers exclusive to the stripped changeset
>>
>> This is it, `hg strip --rev X` will now also remove obsolescence markers
>> exclusive to X. Since a previous changeset, the obsmarkers has been backed up
>> in the strip backup bundle, so it is possible to restore them.
>>
>> Note: stripping obsmarkers means the precursors of the stripped changeset might no
>> longer be obsolete after the strip.
>>
>> Stripping changeset without obsmarkers can be useful when building test case. So
>> It is possible to disable the stripping of obsmarkers using the
>> 'devel.strip-obsmarkers' config option.
>>
>> Test change have been carefully validated.
>>
>> diff --git a/mercurial/repair.py b/mercurial/repair.py
>> --- a/mercurial/repair.py
>> +++ b/mercurial/repair.py
>> @@ -122,6 +122,13 @@ def strip(ui, repo, nodelist, backup=Tru
>>      savebases = [cl.node(r) for r in saverevs]
>>      stripbases = [cl.node(r) for r in tostrip]
>>
>> +    stripobsidx = obsmarkers = ()
>> +    if repo.ui.configbool('devel', 'strip-obsmarkers', True):
>> +        obsmarkers = obsolete.exclusivemarkers(repo, stripbases)
>> +    if obsmarkers:
>> +        stripobsidx = [i for i, m in enumerate(repo.obsstore)
>> +                       if m in obsmarkers]
>> +
>>      # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), but
>>      # is much faster
>>      newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip)
>> @@ -185,6 +192,9 @@ def strip(ui, repo, nodelist, backup=Tru
>>                  if troffset == 0:
>>                      repo.store.markremoved(file)
>>
>> +            deleteobsmarkers(repo.obsstore, stripobsidx)
>> +            del repo.obsstore
>> +
>>          if tmpbundlefile:
>>              ui.note(_("adding branch\n"))
>>              f = vfs.open(tmpbundlefile, "rb")
>> diff --git a/tests/test-obsolete-bundle-strip.t b/tests/test-obsolete-bundle-strip.t
>> --- a/tests/test-obsolete-bundle-strip.t
>> +++ b/tests/test-obsolete-bundle-strip.t
>> @@ -80,13 +80,25 @@ obsmarkers. It also check the obsmarkers
>>    >     if [ $orphan -eq 0 ];
>>    >     then
>>    >         printf "# stripping: "
>> +  >         prestripfile="${prefix}-pre-strip.txt"
>> +  >         poststripfile="${prefix}-post-strip.txt"
>> +  >         strippedfile="${prefix}-stripped-markers.txt"
>> +  >         hg debugobsolete --hidden | sort | sed 's/^/    /' > "${prestripfile}"
>>    >         hg strip --hidden --rev "${revs}"
>> +  >         hg debugobsolete --hidden | sort | sed 's/^/    /' > "${poststripfile}"
>>    >         hg debugbundle .hg/strip-backup/* | grep "obsmarkers --" -A 100 | sed 1,2d > "${stripcontentfile}"
>>    >         echo '### Backup markers ###'
>>    >         cat "${stripcontentfile}"
>>    >         echo '### diff <relevant> <backed-up> ###'
>>    >         cmp "${markersfile}" "${stripcontentfile}" || diff -u "${markersfile}" "${stripcontentfile}"
>>    >         echo '#################################'
>> +  >         cat "${prestripfile}" "${poststripfile}" | sort | uniq -u > "${strippedfile}"
>> +  >         echo '### Stripped markers ###'
>> +  >         cat "${strippedfile}"
>> +  >         echo '### diff <exclusive> <stripped> ###'
>> +  >         cmp "${exclufile}" "${strippedfile}" || diff -u "${exclufile}" "${strippedfile}"
>> +  >         echo '#################################'
>> +  >         # restore and clean up repo for the next test
>>    >         hg unbundle .hg/strip-backup/* | sed 's/^/# unbundling: /'
>>    >         # clean up directory for the next test
>>    >         rm .hg/strip-backup/*
>> @@ -150,6 +162,9 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>> @@ -180,10 +195,16 @@ Actual testing
>>        a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
>> +  # unbundling: 2 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>    $ testrevs 'desc("C-A")'
>> @@ -212,10 +233,17 @@ Actual testing
>>        a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
>> +  # unbundling: 3 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>  chain with prune children
>> @@ -295,10 +323,15 @@ problematic)
>>        29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files
>> +  # unbundling: 1 new obsolescence markers
>>    # unbundling: (run 'hg update' to get a working copy)
>>
>>    $ testrevs 'desc("C-A1")'
>> @@ -324,10 +357,15 @@ problematic)
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
>> +  # unbundling: 1 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>  bundling multiple revisions
>> @@ -378,10 +416,17 @@ bundling multiple revisions
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 3 changesets with 3 changes to 3 files (+1 heads)
>> +  # unbundling: 3 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>  chain with precursors also pruned
>> @@ -440,6 +485,9 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>> @@ -469,10 +517,15 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
>> +  # unbundling: 1 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>    $ testrevs 'desc("C-A")'
>> @@ -501,10 +554,17 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
>> +  # unbundling: 3 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>  chain with missing prune
>> @@ -532,7 +592,7 @@ setup
>>
>>  (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
>>
>> -  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup
>> +  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
>>
>>    $ hg up 'desc("ROOT")'
>>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>> @@ -574,10 +634,17 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files
>> +  # unbundling: 3 new obsolescence markers
>>    # unbundling: (run 'hg update' to get a working copy)
>>
>>  chain with precursors also pruned
>> @@ -603,7 +670,7 @@ setup
>>
>>  (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
>>
>> -  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup
>> +  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
>>
>>    $ hg up 'desc("ROOT")'
>>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>> @@ -645,10 +712,17 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files
>> +  # unbundling: 3 new obsolescence markers
>>    # unbundling: (run 'hg update' to get a working copy)
>>
>>  Chain with fold and split
>> @@ -730,6 +804,9 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>> @@ -755,6 +832,9 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>> @@ -780,6 +860,9 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>> @@ -805,6 +888,9 @@ Actual testing
>>        a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>> @@ -857,10 +943,20 @@ Actual testing
>>        c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
>> +  # unbundling: 6 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>  Bundle multiple revisions
>> @@ -1050,10 +1146,23 @@ Bundle multiple revisions
>>        c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +      c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 5 changesets with 5 changes to 5 files (+4 heads)
>> +  # unbundling: 9 new obsolescence markers
>>    # unbundling: (run 'hg heads' to see heads)
>>
>>  changeset pruned on its own
>> @@ -1117,10 +1226,15 @@ Actual testing
>>        cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 1 changesets with 1 changes to 1 files
>> +  # unbundling: 1 new obsolescence markers
>>    # unbundling: (run 'hg update' to get a working copy)
>>    $ testrevs 'desc("C-")'
>>    ### Matched revisions###
>> @@ -1140,8 +1254,13 @@ Actual testing
>>        cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>    ### diff <relevant> <backed-up> ###
>>    #################################
>> +  ### Stripped markers ###
>> +      cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +  ### diff <exclusive> <stripped> ###
>> +  #################################
>>    # unbundling: adding changesets
>>    # unbundling: adding manifests
>>    # unbundling: adding file changes
>>    # unbundling: added 2 changesets with 2 changes to 2 files
>> +  # unbundling: 1 new obsolescence markers
>>    # unbundling: (run 'hg update' to get a working copy)
>> diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
>> --- a/tests/test-obsolete.t
>> +++ b/tests/test-obsolete.t
>> @@ -1211,35 +1211,88 @@ Test ability to pull changeset with loca
>>    o  0:a78f55e5508c (draft) [ ] 0
>>
>>
>> +  $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no
>> +  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-39c978dc-backup.hg (glob)
>> +  $ hg debugobsolete
>> +  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
>> +  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
>> +  $ hg log -G
>> +  @  2:b0551702f918 (draft) [tip ] 2
>> +  |
>> +  o  1:e016b03fd86f (draft) [ ] 1
>> +  |
>> +  o  0:a78f55e5508c (draft) [ ] 0
>> +
>> +  $ hg log -G --hidden
>> +  @  2:b0551702f918 (draft) [tip ] 2
>> +  |
>> +  o  1:e016b03fd86f (draft) [ ] 1
>> +  |
>> +  o  0:a78f55e5508c (draft) [ ] 0
>> +
>> +  $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg
>> +  Stream params: sortdict([('Compression', 'BZ')])
>> +  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
>> +      e008cf2834908e5d6b0f792a9d4b0e2272260fb8
>> +      f27abbcc1f77fb409cf9160482fe619541e2d605
>> +  obsmarkers -- 'sortdict()'
>> +      version: 1 (70 bytes)
>> +      f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>> +
>> +  $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg
>> +  pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg
>> +  searching for changes
>> +  no changes found
>> +  $ hg debugobsolete
>> +  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
>> +  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
>> +  $ hg log -G
>> +  @  2:b0551702f918 (draft) [tip ] 2
>> +  |
>> +  o  1:e016b03fd86f (draft) [ ] 1
>> +  |
>> +  o  0:a78f55e5508c (draft) [ ] 0
>> +
>> +  $ hg log -G --hidden
>> +  @  2:b0551702f918 (draft) [tip ] 2
>> +  |
>> +  o  1:e016b03fd86f (draft) [ ] 1
>> +  |
>> +  o  0:a78f55e5508c (draft) [ ] 0
>> +
>> +
>> +Testing that strip remove markers:
>> +
>>    $ hg strip -r 1 --config extensions.strip=
>>    0 files updated, 0 files merged, 2 files removed, 0 files unresolved
>> -  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob)
>> +  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg (glob)
>> +  $ hg debugobsolete
>>    $ hg log -G
>>    @  0:a78f55e5508c (draft) [tip ] 0
>>
>>    $ hg log -G --hidden
>>    @  0:a78f55e5508c (draft) [tip ] 0
>>
>> -  $ hg debugbundle .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
>> +  $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
>>    Stream params: sortdict([('Compression', 'BZ')])
>> -  changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])"
>> +  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
>>        e016b03fd86fcccc54817d120b90b751aaf367d6
>> -      e008cf2834908e5d6b0f792a9d4b0e2272260fb8
>> -      f27abbcc1f77fb409cf9160482fe619541e2d605
>>        b0551702f918510f01ae838ab03a463054c67b46
>>    obsmarkers -- 'sortdict()'
>>        version: 1 (139 bytes)
>>        e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>        f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
>>
>> -  $ hg pull .hg/strip-backup/*
>> -  pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
>> -  searching for changes
>> +  $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
>>    adding changesets
>>    adding manifests
>>    adding file changes
>>    added 2 changesets with 2 changes to 2 files
>> +  2 new obsolescence markers
>>    (run 'hg update' to get a working copy)
>> +  $ hg debugobsolete | sort
>> +  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
>> +  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
>>    $ hg log -G
>>    o  2:b0551702f918 (draft) [tip ] 2
>>    |
>> diff --git a/tests/test-subrepo-missing.t b/tests/test-subrepo-missing.t
>> --- a/tests/test-subrepo-missing.t
>> +++ b/tests/test-subrepo-missing.t
>> @@ -108,7 +108,7 @@ check that --hidden is propagated to the
>>  verify will warn if locked-in subrepo revisions are hidden or missing
>>
>>    $ hg ci -m "amended subrepo (again)"
>> -  $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip'
>> +  $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip' --config devel.strip-obsmarkers=no
>>    $ hg verify
>>    checking changesets
>>    checking manifests
>> diff --git a/tests/testlib/exchange-obsmarker-util.sh b/tests/testlib/exchange-obsmarker-util.sh
>> --- a/tests/testlib/exchange-obsmarker-util.sh
>> +++ b/tests/testlib/exchange-obsmarker-util.sh
>> @@ -32,6 +32,9 @@ evolution=all
>>  # we need to strip some changeset for some test cases
>>  hgext.strip=
>>
>> +[devel]
>> +strip-obsmarkers = no
>> +
>>  [alias]
>>  # fix date used to create obsolete markers.
>>  debugobsolete=debugobsolete -d '0 0'
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Denis Laxalde - June 3, 2017, 3:16 p.m.
Pierre-Yves David a écrit :
> On 06/03/2017 10:41 AM, Jun Wu wrote:
>> I don't think this is correct in a distributed world.
>
> Strip entirely removes information from the repository storage. That
> never played well with distribution and is not meant to. I see it as a
> maintenance command.

That's how I see it too. If you strip "something" locally that exists
elsewhere and then pull from there, you get "something" back. Is there a
difference about obsmarkers? On the other hand, when you do something
locally and then strip it, if you later push, the "stripped thing" will
not propagate ("stripped thing" being history modification here).
Jun Wu - June 3, 2017, 6:31 p.m.
Excerpts from Pierre-Yves David's message of 2017-06-03 14:54:00 +0200:
> [...]
> > I don't think this is correct in a distributed world.
> 
> Strip entirely removes information from the repository storage. That 
> never played well with distribution and is not meant to. I see it as a 
> maintenance command.

Good point. I agree.

> > It could potentially break divergence detection.
> 
> I'm not sure what you mean here, can you elaborate?

The case I was initially worried about turns out to be invalid.

I found another interesting case, though: if A was split into B and C.
Stripping C alone might either remove the marker which might be undesirable,
or allow "dangling" markers.
Pierre-Yves David - June 3, 2017, 7:39 p.m.
On 06/03/2017 08:31 PM, Jun Wu wrote:
> Excerpts from Pierre-Yves David's message of 2017-06-03 14:54:00 +0200:
>> [...]
>>> I don't think this is correct in a distributed world.
>>
>> Strip entirely removes information from the repository storage. That
>> never played well with distribution and is not meant to. I see it as a
>> maintenance command.
>
> Good point. I agree.
>
>>> It could potentially break divergence detection.
>>
>> I'm not sure what you mean here, can you elaborate?
>
> The case I was initially worried about turns out to be invalid.
>
> I found another interesting case, though: if A was split into B and C.
> Stripping C alone might either remove the marker which might be undesirable,
> or allow "dangling" markers.

We keep the split markers unless all the successors of the split are 
"stripped" (so in you list above, we gets "partially dangling" markers).

This match the current behavior of push and pull thatsynchronizes a 
split markers as soon as one of the successors is part of the operation.

Partially dangling has not been a too big concern so far. It is likely 
something we will study a bit more in the future but it is far down the 
priority list.

Cheers,
Jun Wu - June 3, 2017, 8:15 p.m.
Excerpts from Pierre-Yves David's message of 2017-06-03 21:39:37 +0200:
> We keep the split markers unless all the successors of the split are 
> "stripped" (so in you list above, we gets "partially dangling" markers).

That's not the current behavior. On 783394c0c978, the marker gets stripped.
Note: the current behavior is also fine to me.

> This match the current behavior of push and pull thatsynchronizes a 
> split markers as soon as one of the successors is part of the operation.
> 
> Partially dangling has not been a too big concern so far. It is likely 
> something we will study a bit more in the future but it is far down the 
> priority list.
> 
> Cheers,
>
Pierre-Yves David - June 3, 2017, 11:42 p.m.
On 06/03/2017 10:15 PM, Jun Wu wrote:
> Excerpts from Pierre-Yves David's message of 2017-06-03 21:39:37 +0200:
>> We keep the split markers unless all the successors of the split are
>> "stripped" (so in you list above, we gets "partially dangling" markers).
>
> That's not the current behavior. On 783394c0c978, the marker gets stripped.
> Note: the current behavior is also fine to me.

Hum yeah, some code + test cases about this got lost somewhere. Thanks 
for spotting this I'll send fixes for that case.

Cheers,
Mathias De Maré - Nov. 2, 2017, 8:49 a.m.
On 01-06-17 15:39, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1495289999 -7200
> #      Sat May 20 16:19:59 2017 +0200
> # Node ID fb16a4d85cf46afbc12bb61f8d22784cef31d1dc
> # Parent  2c44bd45fdeeb3a8bf1762af4a81af3914fadc29
> # EXP-Topic obsstrip
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r fb16a4d85cf4
> strip: strip obsmarkers exclusive to the stripped changeset
>
> This is it, `hg strip --rev X` will now also remove obsolescence markers
> exclusive to X. Since a previous changeset, the obsmarkers has been backed up
> in the strip backup bundle, so it is possible to restore them.
>
> Note: stripping obsmarkers means the precursors of the stripped changeset might no
> longer be obsolete after the strip.
>
> Stripping changeset without obsmarkers can be useful when building test case. So
> It is possible to disable the stripping of obsmarkers using the
> 'devel.strip-obsmarkers' config option.
>
> Test change have been carefully validated.

We recently upgrade to 4.3.3, and received some user complaints about 
this change.
They used 'hg strip' to remove in-development changesets they no longer 
need. This could be solved by having 'hg prune' in Mercurial itself (we 
don't have evolve enabled for our users). Unless there is already an 
alternative present?

Greetings,
Mathias
Augie Fackler - Nov. 2, 2017, 2:04 p.m.
> On Nov 2, 2017, at 04:49, Mathias De Maré <mathias.de_mare@nokia.com> wrote:
> 
> 
> On 01-06-17 15:39, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@octobus.net>
>> # Date 1495289999 -7200
>> #      Sat May 20 16:19:59 2017 +0200
>> # Node ID fb16a4d85cf46afbc12bb61f8d22784cef31d1dc
>> # Parent  2c44bd45fdeeb3a8bf1762af4a81af3914fadc29
>> # EXP-Topic obsstrip
>> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
>> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r fb16a4d85cf4
>> strip: strip obsmarkers exclusive to the stripped changeset
>> 
>> This is it, `hg strip --rev X` will now also remove obsolescence markers
>> exclusive to X. Since a previous changeset, the obsmarkers has been backed up
>> in the strip backup bundle, so it is possible to restore them.
>> 
>> Note: stripping obsmarkers means the precursors of the stripped changeset might no
>> longer be obsolete after the strip.
>> 
>> Stripping changeset without obsmarkers can be useful when building test case. So
>> It is possible to disable the stripping of obsmarkers using the
>> 'devel.strip-obsmarkers' config option.
>> 
>> Test change have been carefully validated.
> 
> We recently upgrade to 4.3.3, and received some user complaints about this change.
> They used 'hg strip' to remove in-development changesets they no longer need. This could be solved by having 'hg prune' in Mercurial itself (we don't have evolve enabled for our users). Unless there is already an alternative present?

`hg obsolete -r $REVS`?

> 
> Greetings,
> Mathias
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org <mailto:Mercurial-devel@mercurial-scm.org>
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel <https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel>

Patch

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -122,6 +122,13 @@  def strip(ui, repo, nodelist, backup=Tru
     savebases = [cl.node(r) for r in saverevs]
     stripbases = [cl.node(r) for r in tostrip]
 
+    stripobsidx = obsmarkers = ()
+    if repo.ui.configbool('devel', 'strip-obsmarkers', True):
+        obsmarkers = obsolete.exclusivemarkers(repo, stripbases)
+    if obsmarkers:
+        stripobsidx = [i for i, m in enumerate(repo.obsstore)
+                       if m in obsmarkers]
+
     # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), but
     # is much faster
     newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip)
@@ -185,6 +192,9 @@  def strip(ui, repo, nodelist, backup=Tru
                 if troffset == 0:
                     repo.store.markremoved(file)
 
+            deleteobsmarkers(repo.obsstore, stripobsidx)
+            del repo.obsstore
+
         if tmpbundlefile:
             ui.note(_("adding branch\n"))
             f = vfs.open(tmpbundlefile, "rb")
diff --git a/tests/test-obsolete-bundle-strip.t b/tests/test-obsolete-bundle-strip.t
--- a/tests/test-obsolete-bundle-strip.t
+++ b/tests/test-obsolete-bundle-strip.t
@@ -80,13 +80,25 @@  obsmarkers. It also check the obsmarkers
   >     if [ $orphan -eq 0 ];
   >     then
   >         printf "# stripping: "
+  >         prestripfile="${prefix}-pre-strip.txt"
+  >         poststripfile="${prefix}-post-strip.txt"
+  >         strippedfile="${prefix}-stripped-markers.txt"
+  >         hg debugobsolete --hidden | sort | sed 's/^/    /' > "${prestripfile}"
   >         hg strip --hidden --rev "${revs}"
+  >         hg debugobsolete --hidden | sort | sed 's/^/    /' > "${poststripfile}"
   >         hg debugbundle .hg/strip-backup/* | grep "obsmarkers --" -A 100 | sed 1,2d > "${stripcontentfile}"
   >         echo '### Backup markers ###'
   >         cat "${stripcontentfile}"
   >         echo '### diff <relevant> <backed-up> ###'
   >         cmp "${markersfile}" "${stripcontentfile}" || diff -u "${markersfile}" "${stripcontentfile}"
   >         echo '#################################'
+  >         cat "${prestripfile}" "${poststripfile}" | sort | uniq -u > "${strippedfile}"
+  >         echo '### Stripped markers ###'
+  >         cat "${strippedfile}"
+  >         echo '### diff <exclusive> <stripped> ###'
+  >         cmp "${exclufile}" "${strippedfile}" || diff -u "${exclufile}" "${strippedfile}"
+  >         echo '#################################'
+  >         # restore and clean up repo for the next test
   >         hg unbundle .hg/strip-backup/* | sed 's/^/# unbundling: /'
   >         # clean up directory for the next test
   >         rm .hg/strip-backup/*
@@ -150,6 +162,9 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
@@ -180,10 +195,16 @@  Actual testing
       a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
+  # unbundling: 2 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
   $ testrevs 'desc("C-A")'
@@ -212,10 +233,17 @@  Actual testing
       a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
+  # unbundling: 3 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
 chain with prune children
@@ -295,10 +323,15 @@  problematic)
       29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files
+  # unbundling: 1 new obsolescence markers
   # unbundling: (run 'hg update' to get a working copy)
 
   $ testrevs 'desc("C-A1")'
@@ -324,10 +357,15 @@  problematic)
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
+  # unbundling: 1 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
 bundling multiple revisions
@@ -378,10 +416,17 @@  bundling multiple revisions
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 3 changesets with 3 changes to 3 files (+1 heads)
+  # unbundling: 3 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
 chain with precursors also pruned
@@ -440,6 +485,9 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
@@ -469,10 +517,15 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
+  # unbundling: 1 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
   $ testrevs 'desc("C-A")'
@@ -501,10 +554,17 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
+  # unbundling: 3 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
 chain with missing prune
@@ -532,7 +592,7 @@  setup
 
 (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
 
-  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup
+  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
 
   $ hg up 'desc("ROOT")'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -574,10 +634,17 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files
+  # unbundling: 3 new obsolescence markers
   # unbundling: (run 'hg update' to get a working copy)
 
 chain with precursors also pruned
@@ -603,7 +670,7 @@  setup
 
 (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
 
-  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup
+  $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
 
   $ hg up 'desc("ROOT")'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -645,10 +712,17 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files
+  # unbundling: 3 new obsolescence markers
   # unbundling: (run 'hg update' to get a working copy)
 
 Chain with fold and split
@@ -730,6 +804,9 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
@@ -755,6 +832,9 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
@@ -780,6 +860,9 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
@@ -805,6 +888,9 @@  Actual testing
       a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
@@ -857,10 +943,20 @@  Actual testing
       c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
+  # unbundling: 6 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
 Bundle multiple revisions
@@ -1050,10 +1146,23 @@  Bundle multiple revisions
       c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+      c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 5 changesets with 5 changes to 5 files (+4 heads)
+  # unbundling: 9 new obsolescence markers
   # unbundling: (run 'hg heads' to see heads)
 
 changeset pruned on its own
@@ -1117,10 +1226,15 @@  Actual testing
       cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 1 changesets with 1 changes to 1 files
+  # unbundling: 1 new obsolescence markers
   # unbundling: (run 'hg update' to get a working copy)
   $ testrevs 'desc("C-")'
   ### Matched revisions###
@@ -1140,8 +1254,13 @@  Actual testing
       cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   ### diff <relevant> <backed-up> ###
   #################################
+  ### Stripped markers ###
+      cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  ### diff <exclusive> <stripped> ###
+  #################################
   # unbundling: adding changesets
   # unbundling: adding manifests
   # unbundling: adding file changes
   # unbundling: added 2 changesets with 2 changes to 2 files
+  # unbundling: 1 new obsolescence markers
   # unbundling: (run 'hg update' to get a working copy)
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -1211,35 +1211,88 @@  Test ability to pull changeset with loca
   o  0:a78f55e5508c (draft) [ ] 0
   
 
+  $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no
+  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-39c978dc-backup.hg (glob)
+  $ hg debugobsolete
+  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
+  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
+  $ hg log -G
+  @  2:b0551702f918 (draft) [tip ] 2
+  |
+  o  1:e016b03fd86f (draft) [ ] 1
+  |
+  o  0:a78f55e5508c (draft) [ ] 0
+  
+  $ hg log -G --hidden
+  @  2:b0551702f918 (draft) [tip ] 2
+  |
+  o  1:e016b03fd86f (draft) [ ] 1
+  |
+  o  0:a78f55e5508c (draft) [ ] 0
+  
+  $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg
+  Stream params: sortdict([('Compression', 'BZ')])
+  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
+      e008cf2834908e5d6b0f792a9d4b0e2272260fb8
+      f27abbcc1f77fb409cf9160482fe619541e2d605
+  obsmarkers -- 'sortdict()'
+      version: 1 (70 bytes)
+      f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+
+  $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg
+  pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg
+  searching for changes
+  no changes found
+  $ hg debugobsolete
+  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
+  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
+  $ hg log -G
+  @  2:b0551702f918 (draft) [tip ] 2
+  |
+  o  1:e016b03fd86f (draft) [ ] 1
+  |
+  o  0:a78f55e5508c (draft) [ ] 0
+  
+  $ hg log -G --hidden
+  @  2:b0551702f918 (draft) [tip ] 2
+  |
+  o  1:e016b03fd86f (draft) [ ] 1
+  |
+  o  0:a78f55e5508c (draft) [ ] 0
+  
+
+Testing that strip remove markers:
+
   $ hg strip -r 1 --config extensions.strip=
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob)
+  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg (glob)
+  $ hg debugobsolete
   $ hg log -G
   @  0:a78f55e5508c (draft) [tip ] 0
   
   $ hg log -G --hidden
   @  0:a78f55e5508c (draft) [tip ] 0
   
-  $ hg debugbundle .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
+  $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
   Stream params: sortdict([('Compression', 'BZ')])
-  changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])"
+  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
       e016b03fd86fcccc54817d120b90b751aaf367d6
-      e008cf2834908e5d6b0f792a9d4b0e2272260fb8
-      f27abbcc1f77fb409cf9160482fe619541e2d605
       b0551702f918510f01ae838ab03a463054c67b46
   obsmarkers -- 'sortdict()'
       version: 1 (139 bytes)
       e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
 
-  $ hg pull .hg/strip-backup/*
-  pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
-  searching for changes
+  $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
   adding changesets
   adding manifests
   adding file changes
   added 2 changesets with 2 changes to 2 files
+  2 new obsolescence markers
   (run 'hg update' to get a working copy)
+  $ hg debugobsolete | sort
+  e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
+  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
   $ hg log -G
   o  2:b0551702f918 (draft) [tip ] 2
   |
diff --git a/tests/test-subrepo-missing.t b/tests/test-subrepo-missing.t
--- a/tests/test-subrepo-missing.t
+++ b/tests/test-subrepo-missing.t
@@ -108,7 +108,7 @@  check that --hidden is propagated to the
 verify will warn if locked-in subrepo revisions are hidden or missing
 
   $ hg ci -m "amended subrepo (again)"
-  $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip'
+  $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip' --config devel.strip-obsmarkers=no
   $ hg verify
   checking changesets
   checking manifests
diff --git a/tests/testlib/exchange-obsmarker-util.sh b/tests/testlib/exchange-obsmarker-util.sh
--- a/tests/testlib/exchange-obsmarker-util.sh
+++ b/tests/testlib/exchange-obsmarker-util.sh
@@ -32,6 +32,9 @@  evolution=all
 # we need to strip some changeset for some test cases
 hgext.strip=
 
+[devel]
+strip-obsmarkers = no
+
 [alias]
 # fix date used to create obsolete markers.
 debugobsolete=debugobsolete -d '0 0'