tests/test-narrow.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 24 Nov 2022 04:04:19 +0100
changeset 49670 2fd8750f3722
parent 49069 a31e9840178e
child 50646 c814101560d9
permissions -rw-r--r--
emitrevision: if we need to compute a delta on the fly, try p1 or p2 first Falling back to `prev` does not yield any real value on modern storage and result in pathological changes to be created on the other side. Doing a delta against a parent will likely be smaller (helping the network) and will be safer to apply on the client (helping future pulls by Triggering intermediate snapshop where they will be needed by later deltas).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
     1
#testcases flat tree
40386
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
     2
#testcases lfs-on lfs-off
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
     3
42930
0b81fd0aa2a1 tests: move a config write to top of file since it applies to all tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 42893
diff changeset
     4
  $ cat >> $HGRCPATH << EOF
0b81fd0aa2a1 tests: move a config write to top of file since it applies to all tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 42893
diff changeset
     5
  > [experimental]
0b81fd0aa2a1 tests: move a config write to top of file since it applies to all tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 42893
diff changeset
     6
  > evolution=createmarkers
0b81fd0aa2a1 tests: move a config write to top of file since it applies to all tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 42893
diff changeset
     7
  > EOF
0b81fd0aa2a1 tests: move a config write to top of file since it applies to all tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 42893
diff changeset
     8
40386
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
     9
#if lfs-on
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
    10
  $ cat >> $HGRCPATH <<EOF
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
    11
  > [extensions]
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
    12
  > lfs =
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
    13
  > EOF
4a81d82474e9 lfs: consult the narrow matcher when extracting pointers from ctx (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 39552
diff changeset
    14
#endif
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    15
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    16
  $ . "$TESTDIR/narrow-library.sh"
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    17
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    18
#if tree
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    19
  $ cat << EOF >> $HGRCPATH
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    20
  > [experimental]
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    21
  > treemanifest = 1
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    22
  > EOF
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    23
#endif
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    24
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    25
  $ hg init master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    26
  $ cd master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
  $ cat >> .hg/hgrc <<EOF
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    28
  > [narrow]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    29
  > serveellipses=True
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    30
  > EOF
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    31
  $ for x in `$TESTDIR/seq.py 0 10`
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    32
  > do
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    33
  >   mkdir d$x
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    34
  >   echo $x > d$x/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    35
  >   hg add d$x/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    36
  >   hg commit -m "add d$x/f"
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    37
  > done
39361
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    38
  $ hg log -T "{rev}: {desc}\n"
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    39
  10: add d10/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    40
  9: add d9/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    41
  8: add d8/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    42
  7: add d7/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    43
  6: add d6/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    44
  5: add d5/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    45
  4: add d4/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    46
  3: add d3/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    47
  2: add d2/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    48
  1: add d1/f
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
    49
  0: add d0/f
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    50
  $ cd ..
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    51
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    52
Error if '.' or '..' are in the directory to track.
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    53
  $ hg clone --narrow ssh://user@dummy/master foo --include ./asdf
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    54
  abort: "." and ".." are not allowed in narrowspec paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    55
  [255]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    56
  $ hg clone --narrow ssh://user@dummy/master foo --include asdf/..
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    57
  abort: "." and ".." are not allowed in narrowspec paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    58
  [255]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    59
  $ hg clone --narrow ssh://user@dummy/master foo --include a/./c
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    60
  abort: "." and ".." are not allowed in narrowspec paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    61
  [255]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    62
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    63
Names with '.' in them are OK.
46902
631001150e13 narrow: add capabilities for local repos, not just remote peers
Charles Chamberlain <cchamberlain@janestreet.com>
parents: 46606
diff changeset
    64
  $ hg clone --narrow ./master should-work --include a/.b/c
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    65
  requesting all changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    66
  adding changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    67
  adding manifests
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    68
  adding file changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    69
  added 1 changesets with 0 changes to 0 files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    70
  new changesets * (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    71
  updating to branch default
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    72
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    73
49069
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    74
The "narrow" repo requirement is ignored by [debugupgraderepo]
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    75
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    76
#if tree
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    77
  $ (cd should-work; hg debugupgraderepo)
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    78
  abort: cannot upgrade repository; unsupported source requirement: treemanifest
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    79
  [255]
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    80
#else
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    81
  $ (cd should-work; hg debugupgraderepo | grep 'no format upgrades found in existing repository')
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    82
  (no format upgrades found in existing repository)
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    83
#endif
a31e9840178e narrow: support debugupgraderepo
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 47439
diff changeset
    84
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    85
Test repo with local changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    86
  $ hg clone --narrow ssh://user@dummy/master narrow-local-changes --include d0 --include d3 --include d6
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    87
  requesting all changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    88
  adding changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    89
  adding manifests
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    90
  adding file changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    91
  added 6 changesets with 3 changes to 3 files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    92
  new changesets *:* (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    93
  updating to branch default
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    94
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    95
  $ cd narrow-local-changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    96
  $ echo local change >> d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    97
  $ hg ci -m 'local change to d0'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    98
  $ hg co '.^'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    99
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   100
  $ echo local change >> d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   101
  $ hg ci -m 'local hidden change to d3'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   102
  created new head
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   103
  $ hg ci --amend -m 'local change to d3'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   104
  $ hg tracked --removeinclude d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   105
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   106
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   107
  looking for local changes to affected paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   108
  The following changeset(s) or their ancestors have local changes not on the remote:
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   109
  * (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   110
  abort: local changes found
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   111
  (use --force-delete-local-changes to ignore)
46117
6cc269bd1c29 errors: raise more specifc errors from narrowcommands
Martin von Zweigbergk <martinvonz@google.com>
parents: 42945
diff changeset
   112
  [20]
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   113
Check that nothing was removed by the failed attempts
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   114
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   115
  I path:d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   116
  I path:d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   117
  I path:d6
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   118
  $ hg files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   119
  d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   120
  d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   121
  d6/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   122
  $ find *
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   123
  d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   124
  d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   125
  d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   126
  d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   127
  d6
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   128
  d6/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   129
  $ hg verify -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   130
Force deletion of local changes
39361
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   131
  $ hg log -T "{rev}: {desc} {outsidenarrow}\n"
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   132
  8: local change to d3 
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   133
  6: local change to d0 
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   134
  5: add d10/f outsidenarrow
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   135
  4: add d6/f 
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   136
  3: add d5/f outsidenarrow
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   137
  2: add d3/f 
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   138
  1: add d2/f outsidenarrow
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   139
  0: add d0/f 
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   140
  $ hg tracked --removeinclude d0 --force-delete-local-changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   141
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   142
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   143
  looking for local changes to affected paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   144
  The following changeset(s) or their ancestors have local changes not on the remote:
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   145
  * (glob)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   146
  moving unwanted changesets to backup
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   147
  saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   148
  deleting data/d0/f.i (reporevlogstore !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   149
  deleting meta/d0/00manifest.i (tree !)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   150
  deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   151
  deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   152
  deleting data/d0/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   153
  deleting unwanted files from working copy
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   154
39361
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   155
  $ hg log -T "{rev}: {desc} {outsidenarrow}\n"
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   156
  7: local change to d3 
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   157
  5: add d10/f outsidenarrow
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   158
  4: add d6/f 
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   159
  3: add d5/f outsidenarrow
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   160
  2: add d3/f 
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   161
  1: add d2/f outsidenarrow
5ebfb7cc6f2c tests: use {rev} instead of {node|short} and (glob) in narrow tests
Martin von Zweigbergk <martinvonz@google.com>
parents: 37415
diff changeset
   162
  0: add d0/f outsidenarrow
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   163
Can restore stripped local changes after widening
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   164
  $ hg tracked --addinclude d0 -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   165
  $ hg unbundle .hg/strip-backup/*-narrow.hg -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   166
  $ hg --hidden co -r 'desc("local change to d0")' -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   167
  $ cat d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   168
  0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   169
  local change
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   170
Pruned commits affecting removed paths should not prevent narrowing
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   171
  $ hg co '.^'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   172
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   173
  $ hg debugobsolete `hg log -T '{node}' -r 'desc("local change to d0")'`
42893
34a46d48d24e debugobsolete: also issue the "new obsmarkers" messsage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42415
diff changeset
   174
  1 new obsolescence markers
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   175
  obsoleted 1 changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   176
  $ hg tracked --removeinclude d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   177
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   178
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   179
  looking for local changes to affected paths
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   180
  moving unwanted changesets to backup
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   181
  saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   182
  deleting data/d0/f.i (reporevlogstore !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   183
  deleting meta/d0/00manifest.i (tree !)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   184
  deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   185
  deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   186
  deleting data/d0/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   187
  deleting unwanted files from working copy
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   188
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   189
Updates off of stripped commit if necessary
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   190
  $ hg co -r 'desc("local change to d3")' -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   191
  $ echo local change >> d6/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   192
  $ hg ci -m 'local change to d6'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   193
  $ hg tracked --removeinclude d3 --force-delete-local-changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   194
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   195
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   196
  looking for local changes to affected paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   197
  The following changeset(s) or their ancestors have local changes not on the remote:
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   198
  * (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   199
  * (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   200
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   201
  moving unwanted changesets to backup
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   202
  saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   203
  deleting data/d3/f.i (reporevlogstore !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   204
  deleting meta/d3/00manifest.i (tree !)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   205
  deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   206
  deleting data/d3/f/99fa7136105a15e2045ce3d9152e4837c5349e4d (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   207
  deleting data/d3/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   208
  deleting unwanted files from working copy
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   209
  $ hg log -T '{desc}\n' -r .
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   210
  add d10/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   211
Updates to nullid if necessary
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   212
  $ hg tracked --addinclude d3 -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   213
  $ hg co null -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   214
  $ mkdir d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   215
  $ echo local change > d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   216
  $ hg add d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   217
  $ hg ci -m 'local change to d3'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   218
  created new head
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   219
  $ hg tracked --removeinclude d3 --force-delete-local-changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   220
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   221
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   222
  looking for local changes to affected paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   223
  The following changeset(s) or their ancestors have local changes not on the remote:
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   224
  * (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   225
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   226
  moving unwanted changesets to backup
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   227
  saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   228
  deleting data/d3/f.i (reporevlogstore !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   229
  deleting meta/d3/00manifest.i (tree !)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   230
  deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   231
  deleting data/d3/f/5ce0767945cbdbca3b924bb9fbf5143f72ab40ac (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   232
  deleting data/d3/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   233
  deleting unwanted files from working copy
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   234
  $ hg id
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   235
  000000000000
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   236
  $ cd ..
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   237
40829
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   238
Narrowing doesn't resurrect old commits (unlike what regular `hg strip` does)
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   239
  $ hg clone --narrow ssh://user@dummy/master narrow-obsmarkers --include d0 --include d3 -q
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   240
  $ cd narrow-obsmarkers
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   241
  $ echo a >> d0/f2
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   242
  $ hg add d0/f2
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   243
  $ hg ci -m 'modify d0/'
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   244
  $ echo a >> d3/f2
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   245
  $ hg add d3/f2
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   246
  $ hg commit --amend -m 'modify d0/ and d3/'
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   247
  $ hg log -T "{rev}: {desc}\n"
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   248
  5: modify d0/ and d3/
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   249
  3: add d10/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   250
  2: add d3/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   251
  1: add d2/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   252
  0: add d0/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   253
  $ hg tracked --removeinclude d3 --force-delete-local-changes -q
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   254
  $ hg log -T "{rev}: {desc}\n"
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   255
  3: add d10/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   256
  2: add d3/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   257
  1: add d2/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   258
  0: add d0/f
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   259
  $ cd ..
77173267878b narrow: don't resurrect old commits when narrowing (don't strip obsmarkers)
Martin von Zweigbergk <martinvonz@google.com>
parents: 40386
diff changeset
   260
40866
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   261
Widening doesn't lose bookmarks
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   262
  $ hg clone --narrow ssh://user@dummy/master widen-bookmarks --include d0 -q
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   263
  $ cd widen-bookmarks
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   264
  $ hg bookmark my-bookmark
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   265
  $ hg log -T "{rev}: {desc} {bookmarks}\n"
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   266
  1: add d10/f my-bookmark
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   267
  0: add d0/f 
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   268
  $ hg tracked --addinclude d3 -q
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   269
  $ hg log -T "{rev}: {desc} {bookmarks}\n"
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   270
  3: add d10/f my-bookmark
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   271
  2: add d3/f 
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   272
  1: add d2/f 
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   273
  0: add d0/f 
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   274
  $ cd ..
21e7c73af75f tests: test that narrow preserves bookmarks on widen
Martin von Zweigbergk <martinvonz@google.com>
parents: 40829
diff changeset
   275
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   276
Can remove last include, making repo empty
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   277
  $ hg clone --narrow ssh://user@dummy/master narrow-empty --include d0 -r 5
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   278
  adding changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   279
  adding manifests
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   280
  adding file changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   281
  added 2 changesets with 1 changes to 1 files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   282
  new changesets *:* (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   283
  updating to branch default
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   284
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   285
  $ cd narrow-empty
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   286
  $ hg tracked --removeinclude d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   287
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   288
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   289
  looking for local changes to affected paths
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   290
  deleting data/d0/f.i (reporevlogstore !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   291
  deleting meta/d0/00manifest.i (tree !)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   292
  deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   293
  deleting data/d0/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   294
  deleting unwanted files from working copy
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   295
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   296
  $ hg files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   297
  [1]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   298
  $ test -d d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   299
  [1]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   300
Do some work in the empty clone
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   301
  $ hg diff --change .
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   302
  $ hg branch foo
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   303
  marked working directory as branch foo
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   304
  (branches are permanent and global, did you want a bookmark?)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   305
  $ hg ci -m empty
42358
45c18f7345c1 narrow: consider empty commits to be "inside the narrow spec" for templates
Danny Hooper <hooper@google.com>
parents: 40866
diff changeset
   306
  $ hg log -T "{rev}: {desc} {outsidenarrow}\n"
45c18f7345c1 narrow: consider empty commits to be "inside the narrow spec" for templates
Danny Hooper <hooper@google.com>
parents: 40866
diff changeset
   307
  2: empty 
45c18f7345c1 narrow: consider empty commits to be "inside the narrow spec" for templates
Danny Hooper <hooper@google.com>
parents: 40866
diff changeset
   308
  1: add d5/f outsidenarrow
45c18f7345c1 narrow: consider empty commits to be "inside the narrow spec" for templates
Danny Hooper <hooper@google.com>
parents: 40866
diff changeset
   309
  0: add d0/f outsidenarrow
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   310
  $ hg pull -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   311
Can widen the empty clone
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   312
  $ hg tracked --addinclude d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   313
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   314
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   315
  saved backup bundle to $TESTTMP/narrow-empty/.hg/strip-backup/*-widen.hg (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   316
  adding changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   317
  adding manifests
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   318
  adding file changes
47439
86418ad637d1 narrowbundle: use new context manager for silencing the ui
Martin von Zweigbergk <martinvonz@google.com>
parents: 47026
diff changeset
   319
  added 4 changesets with 1 changes to 1 files (+1 heads)
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   320
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   321
  I path:d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   322
  $ hg files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   323
  d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   324
  $ find *
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   325
  d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   326
  d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   327
  $ cd ..
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   328
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   329
TODO(martinvonz): test including e.g. d3/g and then removing it once
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   330
https://bitbucket.org/Google/narrowhg/issues/6 is fixed
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   331
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   332
  $ hg clone --narrow ssh://user@dummy/master narrow --include d0 --include d3 --include d6 --include d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   333
  requesting all changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   334
  adding changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   335
  adding manifests
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   336
  adding file changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   337
  added 8 changesets with 4 changes to 4 files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   338
  new changesets *:* (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   339
  updating to branch default
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   340
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   341
  $ cd narrow
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   342
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   343
  I path:d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   344
  I path:d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   345
  I path:d6
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   346
  I path:d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   347
  $ hg tracked --removeinclude d6
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   348
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   349
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   350
  looking for local changes to affected paths
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   351
  deleting data/d6/f.i (reporevlogstore !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   352
  deleting meta/d6/00manifest.i (tree !)
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   353
  deleting data/d6/f/7339d30678f451ac8c3f38753beeb4cf2e1655c7 (reposimplestore !)
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   354
  deleting data/d6/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   355
  deleting unwanted files from working copy
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   356
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   357
  I path:d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   358
  I path:d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   359
  I path:d9
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   360
#if repofncache
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   361
  $ hg debugrebuildfncache
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   362
  fncache already up to date
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   363
#endif
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   364
  $ find *
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   365
  d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   366
  d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   367
  d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   368
  d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   369
  d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   370
  d9/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   371
  $ hg verify -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   372
  $ hg tracked --addexclude d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   373
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   374
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   375
  looking for local changes to affected paths
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   376
  deleting data/d3/f.i (reporevlogstore !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   377
  deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   378
  deleting data/d3/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   379
  deleting unwanted files from working copy
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   380
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   381
  I path:d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   382
  I path:d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   383
  I path:d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   384
  X path:d3/f
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   385
#if repofncache
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   386
  $ hg debugrebuildfncache
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   387
  fncache already up to date
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   388
#endif
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   389
  $ find *
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   390
  d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   391
  d0/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   392
  d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   393
  d9/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   394
  $ hg verify -q
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   395
  $ hg tracked --addexclude d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   396
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   397
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   398
  looking for local changes to affected paths
37347
e82a59bfc5e8 tests: conditionalize test output for simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36163
diff changeset
   399
  deleting data/d0/f.i (reporevlogstore !)
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
   400
  deleting meta/d0/00manifest.i (tree !)
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   401
  deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   402
  deleting data/d0/f/index (reposimplestore !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   403
  deleting unwanted files from working copy
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   404
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   405
  I path:d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   406
  I path:d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   407
  X path:d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   408
  X path:d3/f
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   409
#if repofncache
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   410
  $ hg debugrebuildfncache
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   411
  fncache already up to date
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37347
diff changeset
   412
#endif
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   413
  $ find *
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   414
  d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   415
  d9/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   416
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   417
Make a 15 of changes to d9 to test the path without --verbose
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   418
(Note: using regexes instead of "* (glob)" because if the test fails, it
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   419
produces more sensible diffs)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   420
  $ hg tracked
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   421
  I path:d3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   422
  I path:d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   423
  X path:d0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   424
  X path:d3/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   425
  $ for x in `$TESTDIR/seq.py 1 15`
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   426
  > do
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   427
  >   echo local change >> d9/f
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   428
  >   hg commit -m "change $x to d9/f"
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   429
  > done
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   430
  $ hg tracked --removeinclude d9
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   431
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   432
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   433
  looking for local changes to affected paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   434
  The following changeset(s) or their ancestors have local changes not on the remote:
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   435
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   436
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   437
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   438
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   439
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   440
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   441
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   442
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   443
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   444
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   445
  ...and 5 more, use --verbose to list all
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   446
  abort: local changes found
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   447
  (use --force-delete-local-changes to ignore)
46117
6cc269bd1c29 errors: raise more specifc errors from narrowcommands
Martin von Zweigbergk <martinvonz@google.com>
parents: 42945
diff changeset
   448
  [20]
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   449
Now test it *with* verbose.
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   450
  $ hg tracked --removeinclude d9 --verbose
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   451
  comparing with ssh://user@dummy/master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   452
  searching for changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   453
  looking for local changes to affected paths
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   454
  The following changeset(s) or their ancestors have local changes not on the remote:
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   455
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   456
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   457
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   458
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   459
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   460
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   461
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   462
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   463
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   464
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   465
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   466
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   467
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   468
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   469
  ^[0-9a-f]{12}$ (re)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   470
  abort: local changes found
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   471
  (use --force-delete-local-changes to ignore)
46117
6cc269bd1c29 errors: raise more specifc errors from narrowcommands
Martin von Zweigbergk <martinvonz@google.com>
parents: 42945
diff changeset
   472
  [20]
42945
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   473
  $ cd ..
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   474
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   475
Test --auto-remove-includes
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   476
  $ hg clone --narrow ssh://user@dummy/master narrow-auto-remove -q \
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   477
  > --include d0 --include d1 --include d2
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   478
  $ cd narrow-auto-remove
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   479
  $ echo a >> d0/f
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   480
  $ hg ci -m 'local change to d0'
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   481
  $ hg co '.^'
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   482
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   483
  $ echo a >> d1/f
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   484
  $ hg ci -m 'local change to d1'
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   485
  created new head
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   486
  $ hg debugobsolete $(hg log -T '{node}' -r 'desc("local change to d0")')
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   487
  1 new obsolescence markers
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   488
  obsoleted 1 changesets
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   489
  $ echo n | hg tracked --auto-remove-includes --config ui.interactive=yes
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   490
  comparing with ssh://user@dummy/master
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   491
  searching for changes
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   492
  looking for unused includes to remove
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   493
  path:d0
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   494
  path:d2
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   495
  remove these unused includes (yn)? n
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   496
  $ hg tracked --auto-remove-includes
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   497
  comparing with ssh://user@dummy/master
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   498
  searching for changes
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   499
  looking for unused includes to remove
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   500
  path:d0
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   501
  path:d2
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   502
  remove these unused includes (yn)? y
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   503
  looking for local changes to affected paths
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   504
  moving unwanted changesets to backup
42945
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   505
  saved backup bundle to $TESTTMP/narrow-auto-remove/.hg/strip-backup/*-narrow.hg (glob)
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   506
  deleting data/d0/f.i
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   507
  deleting data/d2/f.i
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   508
  deleting meta/d0/00manifest.i (tree !)
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   509
  deleting meta/d2/00manifest.i (tree !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   510
  deleting unwanted files from working copy
42945
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   511
  $ hg tracked
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   512
  I path:d1
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   513
  $ hg files
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   514
  d1/f
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   515
  $ hg tracked --auto-remove-includes
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   516
  comparing with ssh://user@dummy/master
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   517
  searching for changes
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   518
  looking for unused includes to remove
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42930
diff changeset
   519
  found no unused includes
46477
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   520
Test --no-backup
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   521
  $ hg tracked --addinclude d0 --addinclude d2 -q
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   522
  $ hg unbundle .hg/strip-backup/*-narrow.hg -q
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   523
  $ rm .hg/strip-backup/*
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   524
  $ hg tracked --auto-remove-includes --no-backup
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   525
  comparing with ssh://user@dummy/master
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   526
  searching for changes
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   527
  looking for unused includes to remove
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   528
  path:d0
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   529
  path:d2
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   530
  remove these unused includes (yn)? y
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   531
  looking for local changes to affected paths
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   532
  deleting unwanted changesets
46477
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   533
  deleting data/d0/f.i
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   534
  deleting data/d2/f.i
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   535
  deleting meta/d0/00manifest.i (tree !)
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   536
  deleting meta/d2/00manifest.i (tree !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   537
  deleting unwanted files from working copy
46477
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   538
  $ ls .hg/strip-backup/
46605
946a07f08906 tests: demonstrate assertion error when modifying working copy while narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   539
946a07f08906 tests: demonstrate assertion error when modifying working copy while narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   540
946a07f08906 tests: demonstrate assertion error when modifying working copy while narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   541
Test removing include while concurrently modifying file in that path
946a07f08906 tests: demonstrate assertion error when modifying working copy while narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   542
  $ hg clone --narrow ssh://user@dummy/master narrow-concurrent-modify -q \
946a07f08906 tests: demonstrate assertion error when modifying working copy while narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   543
  > --include d0 --include d1
946a07f08906 tests: demonstrate assertion error when modifying working copy while narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   544
  $ cd narrow-concurrent-modify
46606
ced66295ea90 narrow: remove assertion about working copy being clean
Martin von Zweigbergk <martinvonz@google.com>
parents: 46605
diff changeset
   545
  $ hg --config 'hooks.pretxnopen = echo modified >> d0/f' tracked --removeinclude d0
ced66295ea90 narrow: remove assertion about working copy being clean
Martin von Zweigbergk <martinvonz@google.com>
parents: 46605
diff changeset
   546
  comparing with ssh://user@dummy/master
ced66295ea90 narrow: remove assertion about working copy being clean
Martin von Zweigbergk <martinvonz@google.com>
parents: 46605
diff changeset
   547
  searching for changes
ced66295ea90 narrow: remove assertion about working copy being clean
Martin von Zweigbergk <martinvonz@google.com>
parents: 46605
diff changeset
   548
  looking for local changes to affected paths
ced66295ea90 narrow: remove assertion about working copy being clean
Martin von Zweigbergk <martinvonz@google.com>
parents: 46605
diff changeset
   549
  deleting data/d0/f.i
ced66295ea90 narrow: remove assertion about working copy being clean
Martin von Zweigbergk <martinvonz@google.com>
parents: 46605
diff changeset
   550
  deleting meta/d0/00manifest.i (tree !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46902
diff changeset
   551
  deleting unwanted files from working copy
46606
ced66295ea90 narrow: remove assertion about working copy being clean
Martin von Zweigbergk <martinvonz@google.com>
parents: 46605
diff changeset
   552
  not deleting possibly dirty file d0/f