Mercurial > public > mercurial-scm > hg-stable
comparison contrib/synthrepo.py @ 21926:6c36dc6cd61a stable 3.1-rc
merge default into stable for 3.1 code freeze
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 19 Jul 2014 00:10:22 -0500 |
parents | 503bb3af70fe |
children | 054ec0212718 |
comparison
equal
deleted
inserted
replaced
21876:584bbfd1b50d | 21926:6c36dc6cd61a |
---|---|
332 break | 332 break |
333 del lines[random.randrange(0, len(lines))] | 333 del lines[random.randrange(0, len(lines))] |
334 for __ in xrange(add): | 334 for __ in xrange(add): |
335 lines.insert(random.randint(0, len(lines)), makeline()) | 335 lines.insert(random.randint(0, len(lines)), makeline()) |
336 path = fctx.path() | 336 path = fctx.path() |
337 changes[path] = context.memfilectx(path, | 337 changes[path] = context.memfilectx(repo, path, |
338 '\n'.join(lines) + '\n') | 338 '\n'.join(lines) + '\n') |
339 for __ in xrange(pick(filesremoved)): | 339 for __ in xrange(pick(filesremoved)): |
340 path = random.choice(mfk) | 340 path = random.choice(mfk) |
341 for __ in xrange(10): | 341 for __ in xrange(10): |
342 path = random.choice(mfk) | 342 path = random.choice(mfk) |
352 path.append(random.choice(words)) | 352 path.append(random.choice(words)) |
353 path.append(random.choice(words)) | 353 path.append(random.choice(words)) |
354 path = '/'.join(filter(None, path)) | 354 path = '/'.join(filter(None, path)) |
355 data = '\n'.join(makeline() | 355 data = '\n'.join(makeline() |
356 for __ in xrange(pick(linesinfilesadded))) + '\n' | 356 for __ in xrange(pick(linesinfilesadded))) + '\n' |
357 changes[path] = context.memfilectx(path, data) | 357 changes[path] = context.memfilectx(repo, path, data) |
358 def filectxfn(repo, memctx, path): | 358 def filectxfn(repo, memctx, path): |
359 data = changes[path] | 359 data = changes[path] |
360 if data is None: | 360 if data is None: |
361 raise IOError | 361 raise IOError |
362 return data | 362 return data |