tests/test-censor.t
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 27 Dec 2019 18:50:40 -0500
changeset 43990 37458d8b0c1e
parent 43433 13b8097dccbf
child 47390 65b86f516ba2
permissions -rw-r--r--
tests: drop unused local variable assignments in remotefilelog Flagged by PyCharm. Differential Revision: https://phab.mercurial-scm.org/D7758
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37406
8c37c3220ebc tests: skip test-censor.t when using simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
     1
#require no-reposimplestore
8c37c3220ebc tests: skip test-censor.t when using simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
     2
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     4
  > [extensions]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     5
  > censor=
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     6
  > EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
     7
  $ cp $HGRCPATH $HGRCPATH.orig
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
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
    10
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    11
  $ hg init r
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    12
  $ cd r
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    13
  $ 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
    14
  $ 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
    15
  $ hg add target bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    16
  $ hg ci -m init
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
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
    19
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    20
  $ cd ..
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    21
  $ hg clone r rpull
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    22
  updating to branch default
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    23
  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
    24
  $ cd r
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    25
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    26
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
    27
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
    28
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    29
  $ echo 'Tainted file' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    30
  $ echo 'Passwords: hunter2' >> target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    31
  $ 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
    32
  $ 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
    33
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    34
  $ echo 'hunter3' >> target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    35
  $ 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
    36
  $ 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
    37
  $ 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
    38
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    39
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
    40
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
    41
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    42
  $ 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
    43
  $ 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
    44
  $ 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
    45
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    46
  $ hg update -r $C2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    47
  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
    48
  $ 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
    49
  $ 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
    50
  created new head
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    51
  $ 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
    52
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    53
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
    54
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
    55
  $ 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
    56
  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
    57
  $ 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
    58
  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
    59
  $ 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
    60
  Tainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    61
  Passwords: hunter2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    62
  hunter3
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    63
  $ 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
    64
  Tainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    65
  Passwords: hunter2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    66
  $ 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
    67
  Initially untainted file
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
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
    70
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    71
  $ 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
    72
  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
    73
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    74
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    75
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
    76
25806
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    77
(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
    78
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    79
  $ 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
    80
  $ 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
    81
  $ 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
    82
  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
    83
  $ 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
    84
  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
    85
  $ 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
    86
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    87
  (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
    88
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    89
  $ 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
    90
  Tainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    91
  Passwords: hunter2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    92
  $ 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
    93
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    94
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
    95
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
    96
25806
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    97
(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
    98
5e18f6e39006 censor: make various path forms available like other Mercurial commands
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24361
diff changeset
    99
  $ 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
   100
  $ 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
   101
  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
   102
  $ 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
   103
  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
   104
  $ 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
   105
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   106
  (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
   107
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   108
  $ 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
   109
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   110
  (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
   111
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   112
  $ 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
   113
  Initially untainted file
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
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
   116
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   117
  $ 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
   118
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   119
  (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
   120
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   121
  $ 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
   122
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   123
  (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
   124
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   125
  $ 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
   126
  reverting bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   127
  reverting target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   128
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   129
  (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
   130
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   131
  $ 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
   132
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   133
  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
   134
  $ 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
   135
  reverting target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   136
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   137
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   138
  $ 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
   139
  reverting bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   140
  reverting target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   141
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   142
  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
   143
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   144
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
   145
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   146
  $ 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
   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 $C2 bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   149
  Normal file v2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   150
  $ 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
   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
  $ 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
   153
  Normal file here
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   154
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   155
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
   156
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   157
  $ 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
   158
  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
   159
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   160
  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
   161
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   162
  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
   163
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   164
  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
   165
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   166
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
   167
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   168
  $ cp $HGRCPATH.orig $HGRCPATH
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   169
  $ cat >> $HGRCPATH <<EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   170
  > [censor]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   171
  > policy = abort
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   172
  > EOF
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
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
   175
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   176
  $ hg verify
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   177
  checking changesets
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   178
  checking manifests
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   179
  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
   180
  checking files
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   181
   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
   182
   target@2: censored file data
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 39480
diff changeset
   183
  checked 5 changesets with 7 changes to 2 files
24347
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   184
  2 integrity errors encountered!
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   185
  (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
   186
  [1]
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
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
   189
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   190
  $ hg update -r $C2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   191
  abort: censored node: 1e0247a9a4b7
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   192
  (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
   193
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   194
  $ hg update -r $C1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   195
  abort: censored node: 613bc869fceb
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   196
  (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
   197
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   198
  $ hg update -r 0
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
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   201
  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
   202
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   203
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
   204
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   205
  $ cp $HGRCPATH.orig $HGRCPATH
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   206
  $ cat >> $HGRCPATH <<EOF
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   207
  > [censor]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   208
  > policy = ignore
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   209
  > EOF
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
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
   212
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   213
  $ hg verify
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   214
  checking changesets
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   215
  checking manifests
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   216
  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
   217
  checking files
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 39480
diff changeset
   218
  checked 5 changesets with 7 changes to 2 files
24347
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
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
   221
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   222
  $ hg update -r $C2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   223
  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
   224
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   225
  $ hg update -r $C1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   226
  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
   227
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   228
  $ hg update -r 0
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   229
  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
   230
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   231
  Initially untainted file
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   232
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   233
  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
   234
  $ cat target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   235
  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
   236
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   237
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
   238
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
   239
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   240
  $ hg update -r $H1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   241
  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
   242
  $ C3=$H1
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   243
  $ 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
   244
  $ 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
   245
  $ 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
   246
  $ 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
   247
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   248
  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
   249
  $ hg merge -r $C3
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   250
  merging target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   251
  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
   252
  (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
   253
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   254
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
   255
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   256
  $ 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
   257
  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
   258
  $ 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
   259
  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
   260
  (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
   261
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   262
  $ echo 'twiddling thumbs' > bystander
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   263
  $ 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
   264
  $ 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
   265
  $ 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
   266
  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
   267
  (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
   268
  [255]
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
Cannot censor working directory
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   271
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   272
  $ 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
   273
  $ 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
   274
  $ 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
   275
  $ hg update -r "$H2^"
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   276
  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
   277
  $ hg censor -r . target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   278
  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
   279
  (clean/delete/update first)
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   280
  [255]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   281
  $ hg update -r $H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   282
  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
   283
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   284
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
   285
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   286
  $ C4=$H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   287
  $ hg rm target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   288
  $ 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
   289
  $ 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
   290
  $ 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
   291
  $ 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
   292
  $ 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
   293
  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
   294
  $ echo 'fresh start' > target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   295
  $ hg add target
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   296
  $ 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
   297
  $ 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
   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
  fresh start
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   300
  $ 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
   301
  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
   302
  [1]
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   303
  $ 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
   304
  $ 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
   305
  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
   306
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   307
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
   308
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39489
diff changeset
   309
  $ 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
   310
  > do
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   311
  >   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
   312
  > done
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   313
  $ 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
   314
  $ 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
   315
  $ C5=$H2
1bcfecbbf569 censor: add censor command to hgext with basic client-side tests
Mike Edgar <adgar@google.com>
parents:
diff changeset
   316
  $ 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
   317
  $ 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
   318
  $ 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
   319
  $ 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
   320
  $ 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
   321
  $ 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
   322
  fresh start
24348
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
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
   325
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   326
  $ cd ..
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   327
  $ 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
   328
  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
   329
  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
   330
  $ cd rclone
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 $H1 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   332
  advanced head H1
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 $H2~5 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   334
  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
   335
  $ 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
   336
  $ 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
   337
  $ 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
   338
  Initially untainted file
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   339
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   340
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   341
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   342
  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
   343
  checking files
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 39480
diff changeset
   344
  checked 12 changesets with 13 changes to 2 files
24348
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
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
   347
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   348
  $ cd ../rpull
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   349
  $ 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
   350
  Initially untainted file
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   351
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   352
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   353
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   354
  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
   355
  checking files
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 39480
diff changeset
   356
  checked 1 changesets with 2 changes to 2 files
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   357
  $ hg pull -r $H1 -r $H2
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
   358
  pulling from $TESTTMP/r
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   359
  searching for changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   360
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   361
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   362
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   363
  added 11 changesets with 11 changes to 2 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 32940
diff changeset
   364
  new changesets 186fb27560c3:683e4645fded
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   365
  (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
   366
  $ hg update 4
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   367
  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
   368
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   369
  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
   370
  $ 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
   371
  advanced head H1
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 $H2~5 target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   373
  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
   374
  $ 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
   375
  $ 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
   376
  $ 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
   377
  Initially untainted file
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   378
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   379
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   380
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   381
  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
   382
  checking files
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 39480
diff changeset
   383
  checked 12 changesets with 13 changes to 2 files
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   384
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   385
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
   386
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   387
  $ 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
   388
  $ 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
   389
  created new head
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   390
  $ 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
   391
  $ REV=$H3
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   392
  $ 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
   393
  $ 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
   394
  $ 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
   395
  $ CLEANREV=$H2
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
  Passwords: hunter2hunter2
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   398
  $ 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
   399
  $ 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
   400
  $ 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
   401
  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
   402
  $ hg push -f -r $H2
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
   403
  pushing to $TESTTMP/r
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   404
  searching for changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   405
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   406
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   407
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   408
  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
   409
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   410
  $ cd ../r
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   411
  $ 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
   412
  $ 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
   413
  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
   414
  $ hg update $CLEANREV
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   415
  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
   416
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   417
  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
   418
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   419
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
   420
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   421
  $ 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
   422
  13 changesets found
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   423
  $ cd ../rclone
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   424
  $ hg unbundle ../pwbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   425
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   426
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   427
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   428
  added 2 changesets with 2 changes to 2 files (+1 heads)
39480
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 37406
diff changeset
   429
  new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   430
  (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
   431
  $ 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
   432
  $ 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
   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 update $CLEANREV
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   435
  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
   436
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   437
  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
   438
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   439
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   440
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   441
  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
   442
  checking files
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 39480
diff changeset
   443
  checked 14 changesets with 15 changes to 2 files
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   444
43433
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   445
Grepping only warns, doesn't error out
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   446
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   447
  $ cd ../rpull
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   448
  $ hg grep 'Normal file'
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   449
  bystander:Normal file v2
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   450
  $ hg grep nothing
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   451
  target:Re-sanitized; nothing to see here
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   452
  $ hg grep --diff 'Normal file'
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   453
  cannot search in censored file: target:7
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   454
  cannot search in censored file: target:10
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   455
  cannot search in censored file: target:12
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   456
  bystander:6:-:Normal file v2
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   457
  cannot search in censored file: target:1
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   458
  cannot search in censored file: target:2
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   459
  cannot search in censored file: target:3
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   460
  bystander:2:-:Normal file here
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   461
  bystander:2:+:Normal file v2
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   462
  bystander:0:+:Normal file here
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   463
  $ hg grep --diff nothing
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   464
  cannot search in censored file: target:7
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   465
  cannot search in censored file: target:10
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   466
  cannot search in censored file: target:12
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   467
  target:13:+:Re-sanitized; nothing to see here
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   468
  cannot search in censored file: target:1
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   469
  cannot search in censored file: target:2
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   470
  cannot search in censored file: target:3
13b8097dccbf grep: warn on censored revisions instead of erroring out
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 39707
diff changeset
   471
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   472
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
   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 ../rimport
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   475
  $ 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
   476
  12 changesets found
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   477
  $ cd ../rimport
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   478
  $ 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
   479
  pulling from ../r
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 8 changesets with 10 changes to 2 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 32940
diff changeset
   484
  new changesets e97f55b2665a:dcbaf17bf3a1
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   485
  (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
   486
  $ hg unbundle splitbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   487
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   488
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   489
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   490
  added 6 changesets with 5 changes to 2 files (+1 heads)
39480
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 37406
diff changeset
   491
  new changesets efbe78065929:683e4645fded (6 drafts)
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   492
  (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
   493
  $ hg update $H2
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   494
  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
   495
  $ cat target
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   496
  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
   497
  $ hg verify
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   498
  checking changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   499
  checking manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   500
  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
   501
  checking files
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 39480
diff changeset
   502
  checked 14 changesets with 15 changes to 2 files
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   503
  $ cd ../r
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   504
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   505
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
   506
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   507
  $ hg init ../rinit
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   508
  $ 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
   509
  $ 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
   510
  1 changesets found
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   511
  $ cd ../rinit
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   512
  $ hg unbundle initbundle
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   513
  adding changesets
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   514
  adding manifests
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   515
  adding file changes
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   516
  added 1 changesets with 2 changes to 2 files
39480
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 37406
diff changeset
   517
  new changesets e97f55b2665a (1 drafts)
24348
b7f936f47f2b censor: add exchange tests, via local push/pull and bundle/unbundle
Mike Edgar <adgar@google.com>
parents: 24347
diff changeset
   518
  (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
   519
  $ hg cat -r 0 target