tests/test-tags.t
changeset 13272 5ccdca7df211
parent 12763 93c4da6c4416
child 13446 1e497df514e2
equal deleted inserted replaced
13271:952baa2f3325 13272:5ccdca7df211
     1 Helper functions:
     1 Helper functions:
     2 
     2 
     3   $ cacheexists() {
     3   $ cacheexists() {
     4   >   [ -f .hg/tags.cache ] && echo "tag cache exists" || echo "no tag cache"
     4   >   [ -f .hg/cache/tags ] && echo "tag cache exists" || echo "no tag cache"
     5   > }
     5   > }
     6 
     6 
     7   $ dumptags() {
     7   $ dumptags() {
     8   >     rev=$1
     8   >     rev=$1
     9   >     echo "rev $rev: .hgtags:"
     9   >     echo "rev $rev: .hgtags:"
    34   $ cacheexists
    34   $ cacheexists
    35   tag cache exists
    35   tag cache exists
    36 
    36 
    37 Try corrupting the cache
    37 Try corrupting the cache
    38 
    38 
    39   $ printf 'a b' > .hg/tags.cache
    39   $ printf 'a b' > .hg/cache/tags
    40   $ hg identify
    40   $ hg identify
    41   .hg/tags.cache is corrupt, rebuilding it
    41   .hg/cache/tags is corrupt, rebuilding it
    42   acb14030fe0a tip
    42   acb14030fe0a tip
    43   $ cacheexists
    43   $ cacheexists
    44   tag cache exists
    44   tag cache exists
    45   $ hg identify
    45   $ hg identify
    46   acb14030fe0a tip
    46   acb14030fe0a tip
    67   $ hg identify
    67   $ hg identify
    68   b9154636be93 tip
    68   b9154636be93 tip
    69 
    69 
    70 Repeat with cold tag cache:
    70 Repeat with cold tag cache:
    71 
    71 
    72   $ rm -f .hg/tags.cache
    72   $ rm -f .hg/cache/tags
    73   $ hg identify
    73   $ hg identify
    74   b9154636be93 tip
    74   b9154636be93 tip
    75 
    75 
    76 And again, but now unable to write tag cache:
    76 And again, but now unable to write tag cache:
    77 
    77 
    78   $ rm -f .hg/tags.cache
    78   $ rm -f .hg/cache/tags
    79   $ chmod 555 .hg
    79   $ chmod 555 .hg
    80   $ hg identify
    80   $ hg identify
    81   b9154636be93 tip
    81   b9154636be93 tip
    82   $ chmod 755 .hg
    82   $ chmod 755 .hg
    83 
    83 
   214   rev 4: .hgtags:
   214   rev 4: .hgtags:
   215   bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
   215   bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
   216 
   216 
   217 Dump cache:
   217 Dump cache:
   218 
   218 
   219   $ cat .hg/tags.cache
   219   $ cat .hg/cache/tags
   220   4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
   220   4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
   221   3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0
   221   3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0
   222   2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d
   222   2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d
   223   
   223   
   224   78391a272241d70354aa14c874552cad6b51bb42 bar
   224   78391a272241d70354aa14c874552cad6b51bb42 bar
   323   $ hg --config extensions.mq= strip 4
   323   $ hg --config extensions.mq= strip 4
   324   saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
   324   saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
   325   $ hg tags                  # partly stale
   325   $ hg tags                  # partly stale
   326   tip                                4:735c3ca72986
   326   tip                                4:735c3ca72986
   327   bar                                0:bbd179dfa0a7
   327   bar                                0:bbd179dfa0a7
   328   $ rm -f .hg/tags.cache
   328   $ rm -f .hg/cache/tags
   329   $ hg tags                  # cold cache
   329   $ hg tags                  # cold cache
   330   tip                                4:735c3ca72986
   330   tip                                4:735c3ca72986
   331   bar                                0:bbd179dfa0a7
   331   bar                                0:bbd179dfa0a7
   332 
   332 
   333 Test tag rank with 3 heads:
   333 Test tag rank with 3 heads: