Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable thgrepo: catch IO and Windows errors from hg.repository()

Changeset b34e65b2675c

Parent fd8ed135b4ea

by Steve Borho

Changes to one file · Browse files at b34e65b2675c Showing diff from parent fd8ed135b4ea Diff from another changeset...

 
45
46
47
48
49
50
51
52
 
 
 
 
 
 
 
 
53
54
55
 
45
46
47
 
 
 
 
 
48
49
50
51
52
53
54
55
56
57
58
@@ -45,11 +45,14 @@
  if create or path not in _repocache:   if _ui is None:   _ui = uimod.ui() - repo = hg.repository(_ui, path, create) - repo._pyqtobj = ThgRepoWrapper(repo) - repo.__class__ = _extendrepo(repo) - _repocache[path] = repo - return repo + try: + repo = hg.repository(_ui, path, create) + repo._pyqtobj = ThgRepoWrapper(repo) + repo.__class__ = _extendrepo(repo) + _repocache[path] = repo + return repo + except EnvironmentError: + raise error.RepoError('Cannot open repository at %s' % path)   if not os.path.exists(os.path.join(path, '.hg/')):   del _repocache[path]   # this error must be in local encoding