sapling/tests/test-hgext-repogenerator.t
Phil Cohen 487a3fb991 repogenerator: add new files and directories over time
Summary:
The megarepo generator now adds new directories and files automatically. We now pick folders and paths randomly, with a configurable number of subdirectories and a configurable length for the leaf filename, and a fixed alphabet.

The array of directories and leaf filenames are prorated: they start out constrained and grow as we approach our desired number of commits to generate (`repogenerator.numcommits`), so as not to be too sparse initially.

The directory array is randomized initially, so the above proration doesn't lead to a trivial edit pattern (e.g. everything in a/* initially.)

Lastly, we now stop generation when we hit our goal.

Reviewed By: quark-zju

Differential Revision: D7572968

fbshipit-source-id: b60d60b6262962ee114cb19b0989e6a1af8c0549
2018-04-13 21:51:54 -07:00

43 lines
1.0 KiB
Perl

$ newrepo
$ setconfig repogenerator.filenamedircount=2
$ setconfig repogenerator.filenameleaflength=1
$ setconfig repogenerator.numcommits=3
$ hg repogenerator --seed 1 --config extensions.repogenerator=
starting commit is: -1 (goal is 2)
created *, * sec elapsed (* commits/sec, * per hour, * per day) (glob)
$ hg log -G -r ::tip
o changeset: 2:26c418a67612
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: memory commit
|
o changeset: 1:331925392347
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: memory commit
|
o changeset: 0:af3f7799efa3
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: memory commit
$ hg up -C tip
13 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg log -r tip -T'{files}'
d/d/c f/n/p i/t/b n/y/p u/d/a y/n/h (no-eol)
$ ls */*/*
d/d/c
f/n/p
i/t/b
j/i/e
j/q/a
k/s/d
n/y/p
t/a/e
u/d/a
u/r/g
x/m/c
x/n/c
y/n/h