tests/test-status-committed-and-ignored.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Thu, 04 Apr 2024 14:15:32 +0100
branchstable
changeset 51572 13c004b54cbe
parent 50329 edcc35a4f1dc
permissions -rw-r--r--
wireprotoserver: ensure that output stream gets flushed on exception Previously flush was happening due to Python finalizer being run on `BufferedWriter`. With upgrade to Python 3.11 this started randomly failing. My guess is that the finalizer on the raw `FileIO` object may be running before the finalizer of `BufferedWriter` has a chance to run. At any rate, since we're not relying on finalizers in the happy case we should also not rely on them in case of exception.

#testcases dirstate-v1 dirstate-v2

#if dirstate-v2
  $ cat >> $HGRCPATH << EOF
  > [format]
  > use-dirstate-v2=1
  > [storage]
  > dirstate-v2.slow-path=allow
  > EOF
#endif

  $ rm -rf r

  $ hg init r
  $ cd r
  $ mkdir d1
  $ mkdir d2
  $ touch d1/f d2/f
  $ hg commit -Am '.'
  adding d1/f
  adding d2/f
  $ echo 'syntax:re' >> .hgignore
  $ echo '^d1$' >> .hgignore
  $ hg commit -Am "ignore d1"
  adding .hgignore

Now d1 is a directory that's both committed and ignored.
Untracked files in d2 are still shown, but ones in d1 are ignored:

  $ touch d1/g
  $ touch d2/g
  $ RAYON_NUM_THREADS=1 hg status
  ? d2/g