comparison mercurial/localrepo.py @ 38986:ac0a87160012

localrepo: better error when a repo exists but we lack permissions Claiming "repository foo not found" when the repository does exist causes confusion regularly ("where is the typo?"). Differential Revision: https://phab.mercurial-scm.org/D4122
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
date Sat, 04 Aug 2018 21:31:46 -0400
parents 576eef1ab43d
children a915db9a5e77
comparison
equal deleted inserted replaced
38985:d85b0d81112b 38986:ac0a87160012
493 "00changelog.i", 493 "00changelog.i",
494 '\0\0\0\2' # represents revlogv2 494 '\0\0\0\2' # represents revlogv2
495 ' dummy changelog to prevent using the old repo layout' 495 ' dummy changelog to prevent using the old repo layout'
496 ) 496 )
497 else: 497 else:
498 try:
499 self.vfs.stat()
500 except OSError as inst:
501 if inst.errno != errno.ENOENT:
502 raise
498 raise error.RepoError(_("repository %s not found") % path) 503 raise error.RepoError(_("repository %s not found") % path)
499 elif create: 504 elif create:
500 raise error.RepoError(_("repository %s already exists") % path) 505 raise error.RepoError(_("repository %s already exists") % path)
501 else: 506 else:
502 try: 507 try: