Show More
@@ -369,14 +369,14 b' def synthesize(ui, repo, descpath, **opt' | |||||
369 | while not validpath(path): |
|
369 | while not validpath(path): | |
370 | path = pickpath() |
|
370 | path = pickpath() | |
371 | data = '%s contents\n' % path |
|
371 | data = '%s contents\n' % path | |
372 |
files[path] = |
|
372 | files[path] = data | |
373 | dir = os.path.dirname(path) |
|
373 | dir = os.path.dirname(path) | |
374 | while dir and dir not in dirs: |
|
374 | while dir and dir not in dirs: | |
375 | dirs.add(dir) |
|
375 | dirs.add(dir) | |
376 | dir = os.path.dirname(dir) |
|
376 | dir = os.path.dirname(dir) | |
377 |
|
377 | |||
378 | def filectxfn(repo, memctx, path): |
|
378 | def filectxfn(repo, memctx, path): | |
379 | return files[path] |
|
379 | return context.memfilectx(repo, path, files[path]) | |
380 |
|
380 | |||
381 | ui.progress(_synthesizing, None) |
|
381 | ui.progress(_synthesizing, None) | |
382 | message = 'synthesized wide repo with %d files' % (len(files),) |
|
382 | message = 'synthesized wide repo with %d files' % (len(files),) | |
@@ -444,14 +444,12 b' def synthesize(ui, repo, descpath, **opt' | |||||
444 | for __ in xrange(add): |
|
444 | for __ in xrange(add): | |
445 | lines.insert(random.randint(0, len(lines)), makeline()) |
|
445 | lines.insert(random.randint(0, len(lines)), makeline()) | |
446 | path = fctx.path() |
|
446 | path = fctx.path() | |
447 |
changes[path] = |
|
447 | changes[path] = '\n'.join(lines) + '\n' | |
448 | '\n'.join(lines) + '\n') |
|
|||
449 | for __ in xrange(pick(filesremoved)): |
|
448 | for __ in xrange(pick(filesremoved)): | |
450 | path = random.choice(mfk) |
|
449 | path = random.choice(mfk) | |
451 | for __ in xrange(10): |
|
450 | for __ in xrange(10): | |
452 | path = random.choice(mfk) |
|
451 | path = random.choice(mfk) | |
453 | if path not in changes: |
|
452 | if path not in changes: | |
454 | changes[path] = None |
|
|||
455 | break |
|
453 | break | |
456 | if filesadded: |
|
454 | if filesadded: | |
457 | dirs = list(pctx.dirs()) |
|
455 | dirs = list(pctx.dirs()) | |
@@ -466,9 +464,11 b' def synthesize(ui, repo, descpath, **opt' | |||||
466 | pathstr = '/'.join(filter(None, path)) |
|
464 | pathstr = '/'.join(filter(None, path)) | |
467 | data = '\n'.join(makeline() |
|
465 | data = '\n'.join(makeline() | |
468 | for __ in xrange(pick(linesinfilesadded))) + '\n' |
|
466 | for __ in xrange(pick(linesinfilesadded))) + '\n' | |
469 |
changes[pathstr] = |
|
467 | changes[pathstr] = data | |
470 | def filectxfn(repo, memctx, path): |
|
468 | def filectxfn(repo, memctx, path): | |
471 |
|
|
469 | if path not in changes: | |
|
470 | return None | |||
|
471 | return context.memfilectx(repo, path, changes[path]) | |||
472 | if not changes: |
|
472 | if not changes: | |
473 | continue |
|
473 | continue | |
474 | if revs: |
|
474 | if revs: |
General Comments 0
You need to be logged in to leave comments.
Login now