Mercurial > hg-stable
comparison tests/test-revert.t @ 23158:33a67fa048bf
test-revert: temporarily sort by input states instead of output filename
The next patch will change the names of the files produced by the
script in test-revert. In order to reduce the size and increase the
clarity of the next patch, make the order produced by the internal
'gen-revert-cases.py filelist' command independent of the filenames.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 17 Oct 2014 06:27:43 -0700 |
parents | 0e80564a6f3c |
children | 20d3e2d73432 |
comparison
equal
deleted
inserted
replaced
23157:0e80564a6f3c | 23158:33a67fa048bf |
---|---|
463 > wccontent['untracked-revert'] = wccontent['revert'] | 463 > wccontent['untracked-revert'] = wccontent['revert'] |
464 > wccontent['untracked-wc'] = wccontent['wc'] | 464 > wccontent['untracked-wc'] = wccontent['wc'] |
465 > | 465 > |
466 > # build the combination of possible states | 466 > # build the combination of possible states |
467 > combination = [] | 467 > combination = [] |
468 > for ctxkey, ctxvalue in ctxcontent.iteritems(): | 468 > for ctxkey, ctxvalue in sorted(ctxcontent.iteritems()): |
469 > for wckey in wccontent: | 469 > for wckey in sorted(wccontent): |
470 > base, parent = ctxvalue | 470 > base, parent = ctxvalue |
471 > if (base == parent and 'revert' in wckey): | 471 > if (base == parent and 'revert' in wckey): |
472 > continue | 472 > continue |
473 > if not base and 'revert' in wckey: | 473 > if not base and 'revert' in wckey: |
474 > continue | 474 > continue |
475 > if not parent and 'deleted' in wckey: | 475 > if not parent and 'deleted' in wckey: |
476 > continue | 476 > continue |
477 > filename = "%s_%s" % (ctxkey, wckey) | 477 > filename = "%s_%s" % (ctxkey, wckey) |
478 > combination.append((filename, base, parent, | 478 > combination.append((filename, base, parent, |
479 > wccontent[wckey](ctxvalue))) | 479 > wccontent[wckey](ctxvalue))) |
480 > | |
481 > # make sure we have stable output | |
482 > combination.sort() | |
483 > | 480 > |
484 > # retrieve the state we must generate | 481 > # retrieve the state we must generate |
485 > target = sys.argv[1] | 482 > target = sys.argv[1] |
486 > | 483 > |
487 > # compute file content | 484 > # compute file content |