Mercurial > hg
view tests/test-casecollision.t @ 52217:96b113d22b34 stable
rust-update: handle SIGINT from long-running update threads
The current code does not respond to ^C until after the Rust bit is finished
doing its work. This is expected, since Rust holds the GIL for the duration
of the call and does not call `PyErr_CheckSignals`. Freeing the GIL to do our
work does not really improve anything since the Rust threads are still going,
and the only way of cancelling a thread is by making it cooperate.
So we do the following:
- remember the SIGINT handler in hg-cpython and reset it after the call
into core (see inline comment in `update.rs` about this)
- make all update threads watch for a global `AtomicBool` being `true`,
and if so stop their work
- reset the global bool and exit early (i.e. before writing the dirstate)
- raise SIGINT from `hg-cpython` if update returns `InterruptReceived`
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 12 Nov 2024 12:52:13 +0100 |
parents | 0b8e076e878c |
children |
line wrap: on
line source
#require no-icasefs test file addition with colliding case $ hg init repo1 $ cd repo1 $ echo a > a $ echo A > A $ hg add a $ hg st A a ? A $ hg add --config ui.portablefilenames=abort A abort: possible case-folding collision for A [20] $ hg st A a ? A $ hg add A warning: possible case-folding collision for A $ hg st A A A a $ hg forget A $ hg st A a ? A $ hg add --config ui.portablefilenames=no A $ hg st A A A a $ mkdir b $ touch b/c b/D $ hg add b adding b/D adding b/c $ touch b/d b/C $ hg add b/C warning: possible case-folding collision for b/C $ hg add b/d warning: possible case-folding collision for b/d $ touch b/a1 b/a2 $ hg add b adding b/a1 adding b/a2 $ touch b/A2 b/a1.1 $ hg add b/a1.1 b/A2 warning: possible case-folding collision for b/A2 $ touch b/f b/F $ hg add b/f b/F warning: possible case-folding collision for b/f $ touch g G $ hg add g G warning: possible case-folding collision for g $ mkdir h H $ touch h/x H/x $ hg add h/x H/x warning: possible case-folding collision for h/x $ touch h/s H/s $ hg add h/s $ hg add H/s warning: possible case-folding collision for H/s case changing rename must not warn or abort $ echo c > c $ hg ci -qAmx $ hg mv c C $ cd ..