diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1657,10 +1657,7 @@ else: paths = rcutil.userrcpath() - for f in paths: - if os.path.exists(f): - break - else: + if not any(os.path.exists(f) for f in paths): if opts.get('global'): samplehgrc = uimod.samplehgrcs['global'] elif opts.get('local'):