mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 14:58:03 +03:00
1dcb7966fc
Summary: These are the tests that passed after adding "$ eagerepo". I attempted to turn on eagerepo for all tests that didn't contain "$ eagerepo" or "configure modern". Reviewed By: quark-zju Differential Revision: D44445379 fbshipit-source-id: b283be6d5249f74e11a3205622961e457587e93b
74 lines
1.6 KiB
Perl
74 lines
1.6 KiB
Perl
#chg-compatible
|
|
|
|
$ eagerepo
|
|
$ setconfig workingcopy.ruststatus=False
|
|
$ enable grpcheck
|
|
$ setconfig config.use-rust=false
|
|
|
|
mock os.getgroups and grp.getgrnam
|
|
|
|
$ newext mockgrp <<EOF
|
|
> import os, grp
|
|
> def _getgroups():
|
|
> return map(int, os.environ.get('HGMOCKGRPS', '1000').split())
|
|
> class _grp(object):
|
|
> def __init__(self, gid):
|
|
> self.gr_gid = gid
|
|
> def _getgrnam(name):
|
|
> if name == 'users':
|
|
> gid = 1000
|
|
> elif name == 'devs':
|
|
> gid = 2000
|
|
> else:
|
|
> raise KeyError()
|
|
> return _grp(gid)
|
|
> os.getgroups = _getgroups
|
|
> grp.getgrnam = _getgrnam
|
|
> EOF
|
|
|
|
$ readconfig <<EOF
|
|
> [grpcheck]
|
|
> groups = users, devs
|
|
> warning = You should be in %s group.
|
|
> overrides.chgserver.idletimeout = 3
|
|
> overrides.ui.foo = bar
|
|
> EOF
|
|
|
|
when the user is not in those groups, warnings are printed
|
|
|
|
$ newrepo
|
|
You should be in devs group.
|
|
$ hg log
|
|
You should be in devs group.
|
|
$ HGMOCKGRPS=100 hg log
|
|
You should be in users group.
|
|
$ HGMOCKGRPS='100 1000' hg log
|
|
You should be in devs group.
|
|
|
|
customized warning message
|
|
|
|
$ hg --config grpcheck.warning=foo log
|
|
foo
|
|
|
|
no warning if HGPLAIN or grpcheck.warning is empty
|
|
|
|
$ hg --config grpcheck.warning= log
|
|
$ HGPLAIN=1 hg log
|
|
|
|
warning does not affect write action (commit)
|
|
|
|
$ touch a
|
|
$ hg commit -A a -m a
|
|
You should be in devs group.
|
|
$ hg log -T '{node}\n'
|
|
You should be in devs group.
|
|
3903775176ed42b1458a6281db4a0ccf4d9f287a
|
|
|
|
config overrides
|
|
|
|
$ HGPLAIN=1 hg config chgserver.idletimeout
|
|
3
|
|
$ cd .. # use repo ui
|
|
$ HGPLAIN=1 hg config ui.foo
|
|
bar
|