tests/artifacts/scripts/generate-churning-bundle.py
changeset 43110 1fcf79e9943a
parent 43076 2372284d9457
child 45830 c102b704edb5
equal deleted inserted replaced
43109:f244da1fc4c6 43110:1fcf79e9943a
    60     if iteridx is None:
    60     if iteridx is None:
    61         current = ''
    61         current = ''
    62     else:
    62     else:
    63         current = str(iteridx)
    63         current = str(iteridx)
    64 
    64 
    65     for idx in xrange(NB_LINES):
    65     for idx in range(NB_LINES):
    66         do_change_line = True
    66         do_change_line = True
    67         if oldcontent is not None and ALWAYS_CHANGE_LINES < idx:
    67         if oldcontent is not None and ALWAYS_CHANGE_LINES < idx:
    68             do_change_line = not ((idx - iteridx) % OTHER_CHANGES)
    68             do_change_line = not ((idx - iteridx) % OTHER_CHANGES)
    69 
    69 
    70         if do_change_line:
    70         if do_change_line:
   111     try:
   111     try:
   112         os.chdir(tmpdir)
   112         os.chdir(tmpdir)
   113         hg('init')
   113         hg('init')
   114         updatefile(FILENAME, None)
   114         updatefile(FILENAME, None)
   115         hg('commit', '--addremove', '--message', 'initial commit')
   115         hg('commit', '--addremove', '--message', 'initial commit')
   116         for idx in xrange(1, NB_CHANGESET + 1):
   116         for idx in range(1, NB_CHANGESET + 1):
   117             if sys.stdout.isatty():
   117             if sys.stdout.isatty():
   118                 print("generating commit #%d/%d" % (idx, NB_CHANGESET))
   118                 print("generating commit #%d/%d" % (idx, NB_CHANGESET))
   119             if (idx % PERIOD_BRANCHING) == 0:
   119             if (idx % PERIOD_BRANCHING) == 0:
   120                 move_back = MOVE_BACK_MIN + (idx % MOVE_BACK_RANGE)
   120                 move_back = MOVE_BACK_MIN + (idx % MOVE_BACK_RANGE)
   121                 hg('update', ".~%d" % move_back)
   121                 hg('update', ".~%d" % move_back)