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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jun 3 12:54:00 UTC 2017


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 at 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 at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

-- 
Pierre-Yves David



More information about the Mercurial-devel mailing list