tests/test-repair-strip.t
author Lucas Moscovicz <lmoscovicz@fb.com>
Mon, 10 Feb 2014 17:38:43 -0800
changeset 20521 1850a7f5fb66
parent 20008 e54a078153f7
child 22047 8fb6844a4ff1
permissions -rw-r--r--
revset: changed spanset implementation to take hidden revisions into account Hidden revisions are now excluded from the spanset. Now this doesn't break for people using changeset evolution.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20008
e54a078153f7 tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
     1
#if unix-permissions no-root
14022
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
  $ echo "[extensions]" >> $HGRCPATH
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
  $ echo "mq=">> $HGRCPATH
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
  $ teststrip() {
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
  >   hg -q up -C $1
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
  >   echo % before update $1, strip $2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
  >   hg parents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
  >   chmod -$3 $4
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
  >   hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
  >   echo % after update $1, strip $2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
  >   chmod +$3 $4
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
  >   hg verify
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
  >   echo % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
  >   if [ -f .hg/store/journal ]; then
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
  >       sed -e 's/\.i[^\n]*/\.i/' .hg/store/journal
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
  >   else
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
  >       echo "(no journal)"
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
  >   fi
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
  >   ls .hg/store/journal >/dev/null 2>&1 && hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
  >   ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
  >   rm -rf .hg/strip-backup
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
  > }
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
  $ hg init test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
  $ cd test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
  $ echo a > a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
  $ hg -q ci -m "a" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
  $ echo b > b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
  $ hg -q ci -m "b" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
  $ echo b2 >> b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
  $ hg -q ci -m "b2" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
  $ echo c > c
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    35
  $ hg -q ci -m "c" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
  $ teststrip 0 2 w .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
  % before update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
  changeset:   0:cb9a9f314b8b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
  user:        test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
  date:        Thu Jan 01 00:00:00 1970 +0000
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
  summary:     a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
  
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
  saved backup bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
  transaction abort!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
  failed to truncate data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
  rollback failed - please run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
  strip failed, full bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    48
  abort: Permission denied .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    49
  % after update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
  abandoned transaction found - run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    51
  checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
  checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
  crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    54
  checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    55
   b@?: rev 1 points to nonexistent changeset 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
   (expected 1)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
   b@?: 736c29771fba not in manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    58
  warning: orphan revlog 'data/c.i'
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    59
  2 files, 2 changesets, 3 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    60
  2 warnings encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    61
  2 integrity errors encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    62
  % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    63
  00changelog.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    64
  00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    65
  data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    66
  data/c.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    67
  rolling back interrupted transaction
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    68
  checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    69
  checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    70
  crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    71
  checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    72
  2 files, 2 changesets, 2 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    73
  $ teststrip 0 2 r .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    74
  % before update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    75
  changeset:   0:cb9a9f314b8b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    76
  user:        test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    77
  date:        Thu Jan 01 00:00:00 1970 +0000
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    78
  summary:     a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    79
  
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    80
  abort: Permission denied .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    81
  % after update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    82
  checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    83
  checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    84
  crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    85
  checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    86
  3 files, 4 changesets, 4 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    87
  % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    88
  (no journal)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    89
  $ teststrip 0 2 w .hg/store/00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    90
  % before update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    91
  changeset:   0:cb9a9f314b8b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    92
  user:        test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    93
  date:        Thu Jan 01 00:00:00 1970 +0000
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    94
  summary:     a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    95
  
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    96
  saved backup bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    97
  transaction abort!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    98
  failed to truncate 00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    99
  rollback failed - please run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   100
  strip failed, full bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   101
  abort: Permission denied .hg/store/00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   102
  % after update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   103
  abandoned transaction found - run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   104
  checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   105
  checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   106
   manifest@?: rev 2 points to nonexistent changeset 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   107
   manifest@?: 3362547cdf64 not in changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   108
   manifest@?: rev 3 points to nonexistent changeset 3
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   109
   manifest@?: 265a85892ecb not in changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   110
  crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   111
   c@3: in manifest but not in changeset
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   112
  checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   113
   b@?: rev 1 points to nonexistent changeset 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   114
   (expected 1)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   115
   c@?: rev 0 points to nonexistent changeset 3
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   116
  3 files, 2 changesets, 4 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   117
  1 warnings encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   118
  7 integrity errors encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   119
  (first damaged changeset appears to be 3)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   120
  % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   121
  00changelog.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   122
  00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   123
  data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   124
  data/c.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   125
  rolling back interrupted transaction
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   126
  checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   127
  checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   128
  crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   129
  checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   130
  2 files, 2 changesets, 2 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   131
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15443
diff changeset
   132
  $ cd ..
20008
e54a078153f7 tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   133
e54a078153f7 tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   134
#endif