tests/test-sparse-profiles.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 10 Jul 2017 21:39:49 -0700
changeset 33374 4dc04cdf2520
parent 33337 de324547c751
child 33551 1d1779734c99
permissions -rw-r--r--
sparse: move config updating function into core As part of the move, the ui argument was dropped. Additional fixups will be made in a follow-up commit.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
test sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
  $ hg init myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
  $ cd myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
  $ cat > .hg/hgrc <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  > [extensions]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  > sparse=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
  > purge=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  > strip=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
  > rebase=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  $ echo a > index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
  $ echo x > data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
  $ echo z > readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
  $ cat > webpage.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
  > # frontend sparse profile
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
  > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
  $ cat > backend.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
  > # backend sparse profile
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
  > *.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
  $ hg ci -Aqm 'initial'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
    28
  $ hg debugsparse --include '*.sparse'
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
Verify enabling a single profile works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
    32
  $ hg debugsparse --enable-profile webpage.sparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
Verify enabling two profiles works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
    40
  $ hg debugsparse --enable-profile backend.sparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    46
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
Verify disabling a profile works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
    49
  $ hg debugsparse --disable-profile webpage.sparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
Verify that a profile is updated across multiple commits
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
  $ cat > webpage.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
  > # frontend sparse profile
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
  > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
  $ cat > backend.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
  > # backend sparse profile
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
  > *.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
  > *.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
  $ echo foo >> data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
  $ hg ci -m 'edit profile'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
  readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
  $ hg up -q 0
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    80
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    84
  $ hg up -q 1
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    86
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
  readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    89
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    90
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    91
Introduce a conflicting .hgsparse change
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    92
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    93
  $ hg up -q 0
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    94
  $ cat > backend.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    95
  > # Different backend sparse profile
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    96
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    97
  > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    98
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    99
  $ echo bar >> data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   100
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   101
  $ hg ci -qAm "edit profile other"
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   102
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   103
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   104
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   105
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   106
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   107
Verify conflicting merge pulls in the conflicting changes
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   108
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   109
  $ hg merge 1
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   110
  temporarily included 1 file(s) in the sparse checkout for merging
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   111
  merging backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
  merging data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   113
  warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark')
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   114
  warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark')
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   115
  0 files updated, 0 files merged, 0 files removed, 2 files unresolved
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   116
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   117
  [1]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   118
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   119
  $ rm *.orig
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   120
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   121
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   122
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   124
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   125
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   126
Verify resolving the merge removes the temporarily unioned files
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   127
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   128
  $ cat > backend.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   129
  > # backend sparse profile
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   130
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   131
  > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   132
  > *.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   133
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   134
  $ hg resolve -m backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   135
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   136
  $ cat > data.py <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   137
  > x
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   138
  > foo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   139
  > bar
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   140
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   141
  $ hg resolve -m data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   142
  (no more unresolved files)
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   143
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   144
  $ hg ci -qAm "merge profiles"
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   145
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   146
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   147
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   148
  readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   149
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   150
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   151
  $ hg cat -r . data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   152
  x
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   153
  foo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   154
  bar
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   155
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   156
Verify stripping refreshes dirstate
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   157
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
  $ hg strip -q -r .
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   159
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   160
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   161
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   162
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   163
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   164
Verify rebase conflicts pulls in the conflicting changes
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   165
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   166
  $ hg up -q 1
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   167
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   168
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   169
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   170
  readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   171
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   172
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   173
  $ hg rebase -d 2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   174
  rebasing 1:a2b1de640a62 "edit profile"
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   175
  temporarily included 1 file(s) in the sparse checkout for merging
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   176
  merging backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   177
  merging data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   178
  warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark')
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   179
  warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark')
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   180
  unresolved conflicts (see hg resolve, then hg rebase --continue)
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   181
  [1]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   182
  $ rm *.orig
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   183
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   184
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   185
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   186
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   187
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   188
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   189
Verify resolving conflict removes the temporary files
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   190
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   191
  $ cat > backend.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   192
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   193
  > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   194
  > *.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   195
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   196
  $ hg resolve -m backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   197
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   198
  $ cat > data.py <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   199
  > x
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   200
  > foo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   201
  > bar
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   202
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   203
  $ hg resolve -m data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   204
  (no more unresolved files)
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   205
  continue: hg rebase --continue
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   206
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   207
  $ hg rebase -q --continue
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   208
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   209
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   210
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   211
  readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   212
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   213
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   214
  $ hg cat -r . data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   215
  x
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   216
  foo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   217
  bar
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   218
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   219
Test checking out a commit that does not contain the sparse profile. The
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   220
warning message can be suppressed by setting missingwarning = false in
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   221
[sparse] section of your config:
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   222
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
   223
  $ hg debugsparse --reset
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   224
  $ hg rm *.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   225
  $ hg commit -m "delete profiles"
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   226
  $ hg up -q ".^"
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
   227
  $ hg debugsparse --enable-profile backend.sparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   228
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   229
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   230
  readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   231
  $ hg up tip | grep warning
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   232
  warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   233
  [1]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   234
  $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   235
  data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   236
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   237
  readme.txt
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
   238
  $ hg debugsparse --disable-profile backend.sparse | grep warning
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   239
  warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   240
  [1]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   241
  $ cat >> .hg/hgrc <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   242
  > [sparse]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   243
  > missingwarning = false
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   244
  > EOF
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
   245
  $ hg debugsparse --enable-profile backend.sparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   246
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   247
  $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   248
33337
de324547c751 tests: stabilize on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 33293
diff changeset
   249
#if unix-permissions
de324547c751 tests: stabilize on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 33293
diff changeset
   250
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   251
Test file permissions changing across a sparse profile change
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   252
  $ hg init sparseperm
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   253
  $ cd sparseperm
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   254
  $ cat > .hg/hgrc <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   255
  > [extensions]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   256
  > sparse=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   257
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   258
  $ touch a b
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   259
  $ cat > .hgsparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   260
  > a
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   261
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   262
  $ hg commit -Aqm 'initial'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   263
  $ chmod a+x b
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   264
  $ hg commit -qm 'make executable'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   265
  $ cat >> .hgsparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   266
  > b
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   267
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   268
  $ hg commit -qm 'update profile'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   269
  $ hg up -q 0
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
   270
  $ hg debugsparse --enable-profile .hgsparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   271
  $ hg up -q 2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   272
  $ ls -l b
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   273
  -rwxr-xr-x* b (glob)
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   274
33337
de324547c751 tests: stabilize on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 33293
diff changeset
   275
#endif