Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

cachethg: delay repository creation until tests pass

There's no point in creating a repository if the path does
not pass local-drive, include-path, or exclude-path checks.
Also, the 'if excludepaths:' was redundant

Changeset fdabc3748980

Parent dad9f5680957

by Steve Borho

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

 
152
153
154
155
156
157
158
159
160
161
162
163
164
 
167
168
169
170
 
171
172
173
174
175
176
177
178
179
180
181
182
 
 
 
 
 
 
 
 
 
 
 
183
184
185
 
152
153
154
 
 
 
 
 
 
 
155
156
157
 
160
161
162
 
163
164
165
166
167
168
 
 
 
 
 
 
 
169
170
171
172
173
174
175
176
177
178
179
180
181
182
@@ -152,13 +152,6 @@
  cache_tick_count = GetTickCount()   debugf("overlayicons disabled")   return NOT_IN_REPO - - tc1 = GetTickCount() - real = os.path.realpath(root) - if not repo or (repo.root != root and repo.root != real): - repo = hg.repository(ui.ui(), path=root) - debugf("hg.repository() took %g ticks", (GetTickCount() - tc1)) -   if localonly and thgutil.netdrive_status(path):   debugf("%s: is a network drive", path)   overlay_cache = {None: None} @@ -167,19 +160,23 @@
  if includepaths:   for p in includepaths:   if path.startswith(p): - break; + break   else:   debugf("%s: is not in an include path", path)   overlay_cache = {None: None}   cache_tick_count = GetTickCount()   return NOT_IN_REPO - if excludepaths: - for p in excludepaths: - if path.startswith(p): - debugf("%s: is in an exclude path", path) - overlay_cache = {None: None} - cache_tick_count = GetTickCount() - return NOT_IN_REPO + for p in excludepaths: + if path.startswith(p): + debugf("%s: is in an exclude path", path) + overlay_cache = {None: None} + cache_tick_count = GetTickCount() + return NOT_IN_REPO + tc1 = GetTickCount() + real = os.path.realpath(root) + if not repo or (repo.root != root and repo.root != real): + repo = hg.repository(ui.ui(), path=root) + debugf("hg.repository() took %g ticks", (GetTickCount() - tc1))   except RepoError:   # We aren't in a working tree   debugf("%s: not in repo", pdir)