Changeset 185 in tracdarcs
- Timestamp:
- 06/11/10 16:05:16 (20 months ago)
- Hash name:
- 20100611140516-97f81-7eff9b8bd5140541eff4858d96bcf7b194974480
- Location:
- tracdarcs
- Files:
-
- 3 edited
-
components.py (modified) (2 diffs)
-
repository.py (modified) (3 diffs)
-
updatedb.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tracdarcs/components.py
r182 r185 44 44 possible_encodings = Option('darcs', 'possible_encodings', 'utf-8,iso8859-1', 45 45 "Specify possible repository encodings.") 46 47 eager_annotations = BoolOption('darcs', 'eager_annotations', 'false', 48 "Compute the annotation cache as soon as possible.") 46 49 47 50 # IRepositoryConnector methods … … 70 73 DarcsCommand.RUNNING_DARCSES = BoundedSemaphore(value=int(self.max_concurrent_darcses)) 71 74 72 return DarcsRepository(db, dir, self.env.log, darcs, possible_encodings, params) 75 return DarcsRepository(db, dir, self.env.log, darcs, possible_encodings, params, 76 self.eager_annotations) 73 77 74 78 # IWikiSyntaxProvider methods -
tracdarcs/repository.py
r184 r185 61 61 62 62 class DarcsRepository(Repository): 63 def __init__(self, db, path, log, darcscmd, possible_encodings, params): 63 def __init__(self, db, path, log, darcscmd, possible_encodings, 64 params, eager_annotations): 64 65 if IS_TRAC_0_12_OR_BETTER: 65 66 Repository.__init__(self, 'darcs:%s' % path, params, log) … … 72 73 self.log = log 73 74 self.id = get_repository_id(db, path) or 0 75 self.eager_annotations = eager_annotations 74 76 if IS_TRAC_0_10_X: 75 77 self.sync() … … 233 235 234 236 def sync(self, rev_callback=None, clean=False): 237 from dbutil import format_elapsed_time as trepr 238 235 239 # Import any new changesets, if any 236 update_darcsdb(self.db, self.__cmd, self.log, self.id, 237 rev_callback=rev_callback, clean=clean) 240 241 newrevs = update_darcsdb(self.db, self.__cmd, self.log, self.id, 242 rev_callback=rev_callback, clean=clean) 243 244 # In eager mode, precompute the content and the annotations for 245 # each file modified or added by latest changesets 246 247 if self.eager_annotations and newrevs: 248 i = 1 249 count = len(newrevs) 250 for rev in newrevs: 251 t0 = time.time() 252 253 c = self.get_changeset(rev) 254 for path,kind,change,prev_path,prev_rev in c.get_changes(): 255 if kind==Node.FILE and (change==Changeset.EDIT or change==Changeset.ADD): 256 node = self.get_node(path, rev) 257 node.get_content() 258 node.get_annotations() 259 260 t1 = time.time() 261 usec = (t1-t0) * 1e6 262 self.log.info('Preannotated changeset %d/%d: %s', i, count, trepr(usec)) 263 i += 1 238 264 239 265 class DarcsNode(Node): -
tracdarcs/updatedb.py
r180 r185 162 162 for rev in revscommitted: 163 163 rev_callback(rev) 164 165 return revscommitted 164 166 165 167 def get_last_hash(db, repo_id):
Note: See TracChangeset
for help on using the changeset viewer.