comparison mercurial/localrepo.py @ 7633:08cabecfa8a8

errors: move revlog errors - create error.py for exception classes to reduce demandloading - move revlog exceptions to it - change users to import error and drop revlog import if possible
author Matt Mackall <mpm@selenic.com>
date Sun, 11 Jan 2009 22:48:28 -0600
parents 4dd7b28003d2
children 1d54e2f6c0b7
comparison
equal deleted inserted replaced
7632:9626819b2e3d 7633:08cabecfa8a8
8 from node import bin, hex, nullid, nullrev, short 8 from node import bin, hex, nullid, nullrev, short
9 from i18n import _ 9 from i18n import _
10 import repo, changegroup 10 import repo, changegroup
11 import changelog, dirstate, filelog, manifest, context, weakref 11 import changelog, dirstate, filelog, manifest, context, weakref
12 import lock, transaction, stat, errno, ui, store 12 import lock, transaction, stat, errno, ui, store
13 import os, revlog, time, util, extensions, hook, inspect 13 import os, time, util, extensions, hook, inspect, error
14 import match as match_ 14 import match as match_
15 import merge as merge_ 15 import merge as merge_
16 16
17 class localrepository(repo.repository): 17 class localrepository(repo.repository):
18 capabilities = util.set(('lookup', 'changegroupsubset')) 18 capabilities = util.set(('lookup', 'changegroupsubset'))
175 else: 175 else:
176 prevtags = fp.read() 176 prevtags = fp.read()
177 else: 177 else:
178 try: 178 try:
179 prevtags = self.filectx('.hgtags', parent).data() 179 prevtags = self.filectx('.hgtags', parent).data()
180 except revlog.LookupError: 180 except error.LookupError:
181 pass 181 pass
182 fp = self.wfile('.hgtags', 'wb') 182 fp = self.wfile('.hgtags', 'wb')
183 if prevtags: 183 if prevtags:
184 fp.write(prevtags) 184 fp.write(prevtags)
185 185
330 for node in heads: 330 for node in heads:
331 c = self[node] 331 c = self[node]
332 rev = c.rev() 332 rev = c.rev()
333 try: 333 try:
334 fnode = c.filenode('.hgtags') 334 fnode = c.filenode('.hgtags')
335 except revlog.LookupError: 335 except error.LookupError:
336 continue 336 continue
337 ret.append((rev, node, fnode)) 337 ret.append((rev, node, fnode))
338 if fnode in last: 338 if fnode in last:
339 ret[last[fnode]] = None 339 ret[last[fnode]] = None
340 last[fnode] = len(ret) - 1 340 last[fnode] = len(ret) - 1