Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

tortoise: safe import of RepoError for hg tip (1.2)

Changeset e7e82226b776

Parent fcb23a0e6416

by Steve Borho

Changes to 2 files · Browse files at e7e82226b776 Showing diff from parent fcb23a0e6416 Diff from another changeset...

 
16
17
18
19
20
21
 
 
 
 
 
22
23
24
 
64
65
66
67
 
68
69
70
 
16
17
18
 
19
20
21
22
23
24
25
26
27
28
 
68
69
70
 
71
72
73
74
@@ -16,9 +16,13 @@
 import win32api  import _winreg  from mercurial import hg -from mercurial import repo as _repo  from thgutil import *   +try: + from mercurial.error import RepoError +except ImportError: + from mercurial.repo import RepoError +  # FIXME: quick workaround traceback caused by missing "closed"  # attribute in win32trace.  import sys @@ -64,7 +68,7 @@
  try:   repo = hg.repository(ui.ui(), path=root)   return repo - except _repo.RepoError: + except RepoError:   pass     return None
 
8
9
10
11
12
13
14
 
 
 
 
 
15
16
17
 
143
144
145
146
 
147
148
149
 
8
9
10
 
11
12
13
14
15
16
17
18
19
20
21
 
147
148
149
 
150
151
152
153
@@ -8,10 +8,14 @@
 from win32com.shell import shell, shellcon  import _winreg  from mercurial import hg, cmdutil, util -from mercurial import repo as _repo  import thgutil  import sys   +try: + from mercurial.error import RepoError +except ImportError: + from mercurial.repo import RepoError +  # FIXME: quick workaround traceback caused by missing "closed"  # attribute in win32trace.  from mercurial import ui @@ -143,7 +147,7 @@
  overlay_cache = {None : None}   cache_tick_count = win32api.GetTickCount()   return NOT_IN_REPO - except _repo.RepoError: + except RepoError:   # We aren't in a working tree   print "%s: not in repo" % pdir   overlay_cache[path] = UNKNOWN