mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
8a3a99ba21
Summary: Be a better citizen under system python path. Fix all tests issues and change setup.py to use glob pattern to include all extensions. Test Plan: Run tests and `make local`. Also build and install the package and run `hg sl` in major repos. Reviewers: #mercurial, ttung, rmcelroy Reviewed By: rmcelroy Subscribers: rmcelroy, durham, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D3534311 Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2
68 lines
1.5 KiB
Perl
68 lines
1.5 KiB
Perl
Dummy extension simulating long running command
|
|
$ cat > sleepext.py <<EOF
|
|
> import time
|
|
> import itertools
|
|
>
|
|
> from mercurial import cmdutil
|
|
> from mercurial.i18n import _
|
|
>
|
|
> cmdtable = {}
|
|
> command = cmdutil.command(cmdtable)
|
|
>
|
|
> @command('sleep', [], _('TIME'), norepo=True)
|
|
> def sleep(ui, sleeptime="1", **opts):
|
|
>
|
|
> for _i in itertools.repeat(None, int(sleeptime)):
|
|
> time.sleep(1)
|
|
>
|
|
> ui.warn("%s second(s) passed\n" % sleeptime)
|
|
> EOF
|
|
|
|
Set up repository
|
|
$ hg init repo
|
|
$ cd repo
|
|
$ cat >> $HGRCPATH << EOF
|
|
> [extensions]
|
|
> sleepext = ../sleepext.py
|
|
> EOF
|
|
|
|
Test ctrl-c
|
|
$ timeout -s 2 1 hg sleep 2
|
|
interrupted!
|
|
[124]
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
> nointerrupt = $TESTDIR/../hgext3rd/nointerrupt.py
|
|
> [alias]
|
|
> slumber = sleep
|
|
> [nointerrupt]
|
|
> attend-sleep = True
|
|
> attend-update = True
|
|
> EOF
|
|
|
|
$ timeout -s 2 1 hg sleep 2
|
|
interrupted!
|
|
[124]
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
> interactiveonly = False
|
|
> EOF
|
|
|
|
$ timeout -s 2 1 hg sleep 2
|
|
==========================
|
|
Interrupting Mercurial may leave your repo in a bad state.
|
|
If you really want to interrupt your current command, press
|
|
CTRL-C again.
|
|
==========================
|
|
2 second(s) passed
|
|
[124]
|
|
|
|
$ timeout -s 2 1 hg slum 2
|
|
==========================
|
|
Interrupting Mercurial may leave your repo in a bad state.
|
|
If you really want to interrupt your current command, press
|
|
CTRL-C again.
|
|
==========================
|
|
2 second(s) passed
|
|
[124]
|