comparison mercurial/configitems.py @ 38526:313a940d49a3

ui: add an uninterruptable context manager that can block SIGINT The blocking of SIGINT is not done by default, but my hope is that we will one day. This was inspired by Facebook's "nointerrupt" extension, which is a bit more heavy-handed than this (whole commands are treated as unsafe to interrupt). A future patch will enable this for varying bits of Mercurial that are performing unsafe operations. It's intentional that the KeyboardInterrupt is raised as the context manager exits: during the span of the context manager interrupting Mercurial could lead to data loss, but typically those spans are fairly narrow, so we can let the unsafe block complete and then terminate hg (which will leave the repo in a consistent state, even if it's not the user's desired state). .. api:: New context manager ``ui.uninterruptable()`` to mark portions of a command as potentially unsafe places to interrupt Mercurial with Control-C or similar. Differential Revision: https://phab.mercurial-scm.org/D3716
author Augie Fackler <augie@google.com>
date Wed, 27 Jun 2018 10:47:14 -0400
parents da2a7d8354b2
children 85da230c316a
comparison
equal deleted inserted replaced
38525:c153f440682f 38526:313a940d49a3
558 default=False, 558 default=False,
559 ) 559 )
560 coreconfigitem('experimental', 'mergedriver', 560 coreconfigitem('experimental', 'mergedriver',
561 default=None, 561 default=None,
562 ) 562 )
563 coreconfigitem('experimental', 'nointerrupt', default=False)
564 coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True)
565
563 coreconfigitem('experimental', 'obsmarkers-exchange-debug', 566 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
564 default=False, 567 default=False,
565 ) 568 )
566 coreconfigitem('experimental', 'remotenames', 569 coreconfigitem('experimental', 'remotenames',
567 default=False, 570 default=False,