tests/test-censor.t
author Sean Farley <sean@farley.io>
Tue, 15 Dec 2015 16:01:45 -0800
branchstable
changeset 27531 84d686cb62c4
parent 25806 5e18f6e39006
child 32940 75be14993fda
permissions -rw-r--r--
cmdutil: use crecordmod.checkcurses Instead of blindly trusting the user's experimental.crecord, we use checkcurses to abstract that logic so that we can handle the case where python was not built with curses.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     2
  > [extensions]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     3
  > censor=
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     4
  > EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     5
  $ cp $HGRCPATH $HGRCPATH.orig
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     6
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     7
Create repo with unimpeachable content
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     8
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     9
  $ hg init r
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    10
  $ cd r
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    11
  $ echo 'Initially untainted file' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    12
  $ echo 'Normal file here' > bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    13
  $ hg add target bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    14
  $ hg ci -m init
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    15
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    16
Clone repo so we can test pull later
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    17
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    18
  $ cd ..
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    19
  $ hg clone r rpull
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    20
  updating to branch default
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    21
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    22
  $ cd r
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    23
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    24
Introduce content which will ultimately require censorship. Name the first
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    25
censored node C1, second C2, and so on
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    26
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    27
  $ echo 'Tainted file' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    28
  $ echo 'Passwords: hunter2' >> target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    29
  $ hg ci -m taint target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    30
  $ C1=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    31
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    32
  $ echo 'hunter3' >> target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    33
  $ echo 'Normal file v2' > bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    34
  $ hg ci -m moretaint target bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    35
  $ C2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    36
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    37
Add a new sanitized versions to correct our mistake. Name the first head H1,
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    38
the second head H2, and so on
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    39
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    40
  $ echo 'Tainted file is now sanitized' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    41
  $ hg ci -m sanitized target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    42
  $ H1=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    43
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    44
  $ hg update -r $C2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    45
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    46
  $ echo 'Tainted file now super sanitized' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    47
  $ hg ci -m 'super sanitized' target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    48
  created new head
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    49
  $ H2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    50
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    51
Verify target contents before censorship at each revision
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    52
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
    53
  $ hg cat -r $H1 target
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    54
  Tainted file is now sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    55
  $ hg cat -r $H2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    56
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    57
  $ hg cat -r $C2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    58
  Tainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    59
  Passwords: hunter2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    60
  hunter3
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    61
  $ hg cat -r $C1 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    62
  Tainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    63
  Passwords: hunter2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    64
  $ hg cat -r 0 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    65
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    66
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    67
Try to censor revision with too large of a tombstone message
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    68
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    69
  $ hg censor -r $C1 -t 'blah blah blah blah blah blah blah blah bla' target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    70
  abort: censor tombstone must be no longer than censored data
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    71
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    72
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    73
Censor revision with 2 offenses
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    74
25806
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    75
(this also tests file pattern matching: path relative to cwd case)
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    76
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    77
  $ mkdir -p foo/bar/baz
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    78
  $ hg --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
    79
  $ hg cat -r $H1 target
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    80
  Tainted file is now sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    81
  $ hg cat -r $H2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    82
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    83
  $ hg cat -r $C2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    84
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    85
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    86
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    87
  $ hg cat -r $C1 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    88
  Tainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    89
  Passwords: hunter2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    90
  $ hg cat -r 0 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    91
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    92
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    93
Censor revision with 1 offense
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    94
25806
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    95
(this also tests file pattern matching: with 'path:' scheme)
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    96
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    97
  $ hg --cwd foo/bar/baz censor -r $C1 path:target
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
    98
  $ hg cat -r $H1 target
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    99
  Tainted file is now sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   100
  $ hg cat -r $H2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   101
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   102
  $ hg cat -r $C2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   103
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   104
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   105
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   106
  $ hg cat -r $C1 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   107
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   108
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   109
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   110
  $ hg cat -r 0 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   111
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   112
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   113
Can only checkout target at uncensored revisions, -X is workaround for --all
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   114
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   115
  $ hg revert -r $C2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   116
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   117
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   118
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   119
  $ hg revert -r $C1 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   120
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   121
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   122
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   123
  $ hg revert -r $C1 --all
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   124
  reverting bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   125
  reverting target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   126
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   127
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   128
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   129
  $ hg revert -r $C1 --all -X target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   130
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   131
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   132
  $ hg revert -r 0 --all
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   133
  reverting target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   134
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   135
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   136
  $ hg revert -r $H2 --all
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   137
  reverting bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   138
  reverting target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   139
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   140
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   141
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   142
Uncensored file can be viewed at any revision
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   143
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   144
  $ hg cat -r $H1 bystander
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   145
  Normal file v2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   146
  $ hg cat -r $C2 bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   147
  Normal file v2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   148
  $ hg cat -r $C1 bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   149
  Normal file here
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   150
  $ hg cat -r 0 bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   151
  Normal file here
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   152
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   153
Can update to children of censored revision
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   154
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   155
  $ hg update -r $H1
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   156
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   157
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   158
  Tainted file is now sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   159
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   160
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   161
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   162
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   163
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   164
Set censor policy to abort in trusted $HGRC so hg verify fails
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   165
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   166
  $ cp $HGRCPATH.orig $HGRCPATH
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   167
  $ cat >> $HGRCPATH <<EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   168
  > [censor]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   169
  > policy = abort
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   170
  > EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   171
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   172
Repo fails verification due to censorship
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   173
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   174
  $ hg verify
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   175
  checking changesets
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   176
  checking manifests
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   177
  crosschecking files in changesets and manifests
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   178
  checking files
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   179
   target@1: censored file data
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   180
   target@2: censored file data
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   181
  2 files, 5 changesets, 7 total revisions
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   182
  2 integrity errors encountered!
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   183
  (first damaged changeset appears to be 1)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   184
  [1]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   185
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   186
Cannot update to revision with censored data
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   187
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   188
  $ hg update -r $C2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   189
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   190
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   191
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   192
  $ hg update -r $C1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   193
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   194
  (set censor.policy to ignore errors)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   195
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   196
  $ hg update -r 0
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   197
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   198
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   199
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   200
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   201
Set censor policy to ignore in trusted $HGRC so hg verify passes
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   202
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   203
  $ cp $HGRCPATH.orig $HGRCPATH
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   204
  $ cat >> $HGRCPATH <<EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   205
  > [censor]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   206
  > policy = ignore
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   207
  > EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   208
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   209
Repo passes verification with warnings with explicit config
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   210
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   211
  $ hg verify
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   212
  checking changesets
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   213
  checking manifests
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   214
  crosschecking files in changesets and manifests
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   215
  checking files
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   216
  2 files, 5 changesets, 7 total revisions
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   217
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   218
May update to revision with censored data with explicit config
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   219
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   220
  $ hg update -r $C2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   221
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   222
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   223
  $ hg update -r $C1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   224
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   225
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   226
  $ hg update -r 0
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   227
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   228
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   229
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   230
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   231
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   232
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   233
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   234
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   235
Can merge in revision with censored data. Test requires one branch of history
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   236
with the file censored, but we can't censor at a head, so advance H1.
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   237
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   238
  $ hg update -r $H1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   239
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   240
  $ C3=$H1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   241
  $ echo 'advanced head H1' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   242
  $ hg ci -m 'advance head H1' target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   243
  $ H1=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   244
  $ hg censor -r $C3 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   245
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   246
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   247
  $ hg merge -r $C3
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   248
  merging target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   249
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   250
  (branch merge, don't forget to commit)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   251
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   252
Revisions present in repository heads may not be censored
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   253
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   254
  $ hg update -C -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   255
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   256
  $ hg censor -r $H2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   257
  abort: cannot censor file in heads (78a8fc215e79)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   258
  (clean/delete and commit first)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   259
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   260
  $ echo 'twiddling thumbs' > bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   261
  $ hg ci -m 'bystander commit'
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   262
  $ H2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   263
  $ hg censor -r "$H2^" target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   264
  abort: cannot censor file in heads (efbe78065929)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   265
  (clean/delete and commit first)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   266
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   267
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   268
Cannot censor working directory
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   269
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   270
  $ echo 'seriously no passwords' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   271
  $ hg ci -m 'extend second head arbitrarily' target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   272
  $ H2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   273
  $ hg update -r "$H2^"
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   274
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   275
  $ hg censor -r . target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   276
  abort: cannot censor working directory
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   277
  (clean/delete/update first)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   278
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   279
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   280
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   281
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   282
Can re-add file after being deleted + censored
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   283
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   284
  $ C4=$H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   285
  $ hg rm target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   286
  $ hg ci -m 'delete target so it may be censored'
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   287
  $ H2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   288
  $ hg censor -r $C4 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   289
  $ hg cat -r $C4 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   290
  $ hg cat -r "$H2^^" target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   291
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   292
  $ echo 'fresh start' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   293
  $ hg add target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   294
  $ hg ci -m reincarnated target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   295
  $ H2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   296
  $ hg cat -r $H2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   297
  fresh start
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   298
  $ hg cat -r "$H2^" target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   299
  target: no such file in rev 452ec1762369
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   300
  [1]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   301
  $ hg cat -r $C4 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   302
  $ hg cat -r "$H2^^^" target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   303
  Tainted file now super sanitized
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   304
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   305
Can censor after revlog has expanded to no longer permit inline storage
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   306
24361
8de8cd34f2e3 tests: replace uses of 'seq' with portable 'seq.py'
Matt Harbison <matt_harbison@yahoo.com>
parents: 24348
diff changeset
   307
  $ for x in `python $TESTDIR/seq.py 0 50000`
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   308
  > do
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   309
  >   echo "Password: hunter$x" >> target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   310
  > done
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   311
  $ hg ci -m 'add 100k passwords'
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   312
  $ H2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   313
  $ C5=$H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   314
  $ hg revert -r "$H2^" target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   315
  $ hg ci -m 'cleaned 100k passwords'
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   316
  $ H2=`hg id --debug -i`
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   317
  $ hg censor -r $C5 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   318
  $ hg cat -r $C5 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   319
  $ hg cat -r $H2 target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   320
  fresh start
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   321
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   322
Repo with censored nodes can be cloned and cloned nodes are censored
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   323
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   324
  $ cd ..
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   325
  $ hg clone r rclone
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   326
  updating to branch default
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   327
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   328
  $ cd rclone
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   329
  $ hg cat -r $H1 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   330
  advanced head H1
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   331
  $ hg cat -r $H2~5 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   332
  Tainted file now super sanitized
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   333
  $ hg cat -r $C2 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   334
  $ hg cat -r $C1 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   335
  $ hg cat -r 0 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   336
  Initially untainted file
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   337
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   338
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   339
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   340
  crosschecking files in changesets and manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   341
  checking files
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   342
  2 files, 12 changesets, 13 total revisions
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   343
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   344
Repo cloned before tainted content introduced can pull censored nodes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   345
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   346
  $ cd ../rpull
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   347
  $ hg cat -r tip target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   348
  Initially untainted file
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   349
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   350
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   351
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   352
  crosschecking files in changesets and manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   353
  checking files
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   354
  2 files, 1 changesets, 2 total revisions
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   355
  $ hg pull -r $H1 -r $H2
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   356
  pulling from $TESTTMP/r (glob)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   357
  searching for changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   358
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   359
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   360
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   361
  added 11 changesets with 11 changes to 2 files (+1 heads)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   362
  (run 'hg heads' to see heads, 'hg merge' to merge)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   363
  $ hg update 4
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   364
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   365
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   366
  Tainted file now super sanitized
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   367
  $ hg cat -r $H1 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   368
  advanced head H1
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   369
  $ hg cat -r $H2~5 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   370
  Tainted file now super sanitized
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   371
  $ hg cat -r $C2 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   372
  $ hg cat -r $C1 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   373
  $ hg cat -r 0 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   374
  Initially untainted file
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   375
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   376
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   377
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   378
  crosschecking files in changesets and manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   379
  checking files
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   380
  2 files, 12 changesets, 13 total revisions
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   381
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   382
Censored nodes can be pushed if they censor previously unexchanged nodes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   383
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   384
  $ echo 'Passwords: hunter2hunter2' > target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   385
  $ hg ci -m 're-add password from clone' target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   386
  created new head
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   387
  $ H3=`hg id --debug -i`
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   388
  $ REV=$H3
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   389
  $ echo 'Re-sanitized; nothing to see here' > target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   390
  $ hg ci -m 're-sanitized' target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   391
  $ H2=`hg id --debug -i`
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   392
  $ CLEANREV=$H2
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   393
  $ hg cat -r $REV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   394
  Passwords: hunter2hunter2
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   395
  $ hg censor -r $REV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   396
  $ hg cat -r $REV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   397
  $ hg cat -r $CLEANREV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   398
  Re-sanitized; nothing to see here
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   399
  $ hg push -f -r $H2
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   400
  pushing to $TESTTMP/r (glob)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   401
  searching for changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   402
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   403
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   404
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   405
  added 2 changesets with 2 changes to 1 files (+1 heads)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   406
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   407
  $ cd ../r
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   408
  $ hg cat -r $REV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   409
  $ hg cat -r $CLEANREV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   410
  Re-sanitized; nothing to see here
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   411
  $ hg update $CLEANREV
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   412
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   413
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   414
  Re-sanitized; nothing to see here
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   415
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   416
Censored nodes can be bundled up and unbundled in another repo
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   417
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   418
  $ hg bundle --base 0 ../pwbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   419
  13 changesets found
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   420
  $ cd ../rclone
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   421
  $ hg unbundle ../pwbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   422
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   423
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   424
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   425
  added 2 changesets with 2 changes to 2 files (+1 heads)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   426
  (run 'hg heads .' to see heads, 'hg merge' to merge)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   427
  $ hg cat -r $REV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   428
  $ hg cat -r $CLEANREV target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   429
  Re-sanitized; nothing to see here
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   430
  $ hg update $CLEANREV
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   431
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   432
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   433
  Re-sanitized; nothing to see here
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   434
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   435
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   436
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   437
  crosschecking files in changesets and manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   438
  checking files
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   439
  2 files, 14 changesets, 15 total revisions
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   440
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   441
Censored nodes can be imported on top of censored nodes, consecutively
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   442
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   443
  $ hg init ../rimport
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   444
  $ hg bundle --base 1 ../rimport/splitbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   445
  12 changesets found
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   446
  $ cd ../rimport
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   447
  $ hg pull -r $H1 -r $H2 ../r
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   448
  pulling from ../r
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   449
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   450
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   451
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   452
  added 8 changesets with 10 changes to 2 files (+1 heads)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   453
  (run 'hg heads' to see heads, 'hg merge' to merge)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   454
  $ hg unbundle splitbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   455
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   456
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   457
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   458
  added 6 changesets with 5 changes to 2 files (+1 heads)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   459
  (run 'hg heads .' to see heads, 'hg merge' to merge)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   460
  $ hg update $H2
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   461
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   462
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   463
  Re-sanitized; nothing to see here
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   464
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   465
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   466
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   467
  crosschecking files in changesets and manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   468
  checking files
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   469
  2 files, 14 changesets, 15 total revisions
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   470
  $ cd ../r
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   471
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   472
Can import bundle where first revision of a file is censored
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   473
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   474
  $ hg init ../rinit
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   475
  $ hg censor -r 0 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   476
  $ hg bundle -r 0 --base null ../rinit/initbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   477
  1 changesets found
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   478
  $ cd ../rinit
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   479
  $ hg unbundle initbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   480
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   481
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   482
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   483
  added 1 changesets with 2 changes to 2 files
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   484
  (run 'hg update' to get a working copy)
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   485
  $ hg cat -r 0 target