tests/test-obsolete-bundle-strip.t
changeset 32487 f475446b4837
child 32488 176d1a0ce385
equal deleted inserted replaced
32486:1df80eff24cf 32487:f475446b4837
       
     1 ==================================================
       
     2 Test obsmarkers interaction with bundle and strip
       
     3 ==================================================
       
     4 
       
     5 In practice, this file does not yet contains any tests for bundle and strip.
       
     6 But their will be some soon (tm).
       
     7 
       
     8 For now this test check the logic computing markers relevant to a set of
       
     9 revision. That logic will be use by "hg bundle" to select the markers to
       
    10 include, and strip to find the markers to backup.
       
    11 
       
    12 Setup a repository with various case
       
    13 ====================================
       
    14 
       
    15 Config setup
       
    16 ------------
       
    17 
       
    18   $ cat >> $HGRCPATH <<EOF
       
    19   > [ui]
       
    20   > # simpler log output
       
    21   > logtemplate = "{node|short}: {desc}\n"
       
    22   > 
       
    23   > [experimental]
       
    24   > # enable evolution
       
    25   > evolution = all
       
    26   > 
       
    27   > # include obsmarkers in bundle
       
    28   > evolution.bundle-obsmarker = yes
       
    29   > 
       
    30   > [extensions]
       
    31   > # needed for some tests
       
    32   > strip =
       
    33   > [defaults]
       
    34   > # we'll query many hidden changeset
       
    35   > debugobsolete = --hidden
       
    36   > EOF
       
    37 
       
    38   $ mkcommit() {
       
    39   >    echo "$1" > "$1"
       
    40   >    hg add "$1"
       
    41   >    hg ci -m "$1"
       
    42   > }
       
    43 
       
    44   $ getid() {
       
    45   >    hg log --hidden --template '{node}\n' --rev "$1"
       
    46   > }
       
    47 
       
    48   $ mktestrepo () {
       
    49   >     [ -n "$1" ] || exit 1
       
    50   >     cd $TESTTMP
       
    51   >     hg init $1
       
    52   >     cd $1
       
    53   >     mkcommit ROOT
       
    54   > }
       
    55 
       
    56 root setup
       
    57 -------------
       
    58 
       
    59 simple chain
       
    60 ============
       
    61 
       
    62 .    A0
       
    63 .   ⇠ø⇠◔ A1
       
    64 .    |/
       
    65 .    ●
       
    66 
       
    67 setup
       
    68 -----
       
    69 
       
    70   $ mktestrepo simple-chain
       
    71   $ mkcommit 'C-A0'
       
    72   $ hg up 'desc("ROOT")'
       
    73   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    74   $ mkcommit 'C-A1'
       
    75   created new head
       
    76   $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'`
       
    77   $ hg debugobsolete `getid 'desc("C-A0")'` a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1
       
    78   $ hg debugobsolete a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 `getid 'desc("C-A1")'`
       
    79 
       
    80   $ hg up 'desc("ROOT")'
       
    81   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    82   $ hg log --hidden -G
       
    83   o  cf2c22470d67: C-A1
       
    84   |
       
    85   | x  84fcb0dfe17b: C-A0
       
    86   |/
       
    87   @  ea207398892e: ROOT
       
    88   
       
    89   $ hg debugobsolete
       
    90   a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    91   84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    92   a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    93 
       
    94 Actual testing
       
    95 --------------
       
    96 
       
    97   $ hg debugobsolete --rev 'desc("C-A0")'
       
    98   a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    99   $ hg debugobsolete --rev 'desc("C-A1")'
       
   100   84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   101   a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   102   a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}