tests/test-sparse-with-safe-share.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Mon, 15 Apr 2024 16:33:37 +0100
branchstable
changeset 51571 74230abb2504
parent 48494 b74ee41addee
permissions -rw-r--r--
match: strengthen visit_children_set invariant, Recursive means "all files" My previous interpretation of "Recursive" was too relaxed: I thought it instructed the caller to do something like this: > you can stop calling `visit_children_set` because you'll need to descend into > every directory recursively, but you should still check every file if it > matches or not Whereas the real instruction seems to be: > I guarantee that everything in this subtree matches, you can stop > querying the matcher for all files and dirs altogether. The evidence to support this: - the test actually passes with the stronger invariant, revealing no exceptions from this rule - the implementation of `visit_children_set` for `DifferenceMatcher` clearly relies on this requirement, so it must hold for that not to lead to bugs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48493
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     1
Same with share-safe
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     2
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     3
  $ echo "[format]"         >> $HGRCPATH
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     4
  $ echo "use-share-safe = True" >> $HGRCPATH
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     5
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     6
  $ cd $TESTTMP
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     7
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     8
  $ hg init myrepo
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
     9
  $ cd myrepo
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    10
  $ cat > .hg/hgrc <<EOF
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    11
  > [extensions]
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    12
  > sparse=
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    13
  > EOF
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    14
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    15
  $ echo a > show
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    16
  $ echo x > hide
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    17
  $ hg ci -Aqm 'initial'
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    18
48494
b74ee41addee sparse: lock the store when updating requirements config
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 48493
diff changeset
    19
Regression test: checks that this command correctly locks the store
b74ee41addee sparse: lock the store when updating requirements config
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 48493
diff changeset
    20
before updating the store [requirements] config.
48493
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    21
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    22
  $ hg up -q 0
50330d481640 sparse: demonstrate a bug when used with safe-share
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
    23
  $ hg debugsparse --include 'hide'