| 1 |
|
| 2 |
|
| 3 |
import sys, testlifter, tempfile, os |
| 4 |
|
| 5 |
testlifter.verbose += sys.argv[1:].count("-v") |
| 6 |
|
| 7 |
uncorrected = """\ |
| 8 |
Rev 16 2006-10-29 07:00:01 +0000 |
| 9 |
Rev 15 2006-10-29 06:59:59 +0000 |
| 10 |
Rev 14 2006-04-02 08:00:01 +0000 |
| 11 |
Rev 13 2006-04-02 07:59:59 +0000 |
| 12 |
Rev 12 2005-12-01 00:00:00 +0000 |
| 13 |
Rev 11 2005-11-01 00:00:00 +0000 |
| 14 |
Rev 10 2005-10-01 00:00:00 +0000 |
| 15 |
Rev 9 2005-09-01 00:00:00 +0000 |
| 16 |
Rev 8 2005-08-01 00:00:00 +0000 |
| 17 |
Rev 7 2005-07-01 00:00:00 +0000 |
| 18 |
Rev 6 2005-06-01 00:00:00 +0000 |
| 19 |
Rev 5 2005-05-01 00:00:00 +0000 |
| 20 |
Rev 4 2005-04-01 00:00:00 +0000 |
| 21 |
Rev 3 2005-03-01 00:00:00 +0000 |
| 22 |
Rev 2 2005-02-01 00:00:00 +0000 |
| 23 |
Rev 1 2005-01-01 00:00:00 +0000 |
| 24 |
""" |
| 25 |
|
| 26 |
cc = testlifter.ConvertComparison(stem="t9604", module="module") |
| 27 |
cc.repo.retain = ("-k" in sys.argv[1:]) |
| 28 |
cc.compare_tree("branch", "master", True) |
| 29 |
cc.command_returns("cd t9604-git >/dev/null; git log --format='%s %ai'", uncorrected) |
| 30 |
cc.cleanup() |
| 31 |
|
| 32 |
authormap = """\ |
| 33 |
user1=User One <[email protected]> |
| 34 |
user2=User Two <[email protected]> CST6CDT |
| 35 |
user3=User Three <[email protected]> EST5EDT |
| 36 |
user4=User Four <[email protected]> MST7MDT |
| 37 |
""" |
| 38 |
|
| 39 |
corrected="""\ |
| 40 |
Rev 16 2006-10-29 01:00:01 -0600 User Two |
| 41 |
Rev 15 2006-10-29 01:59:59 -0500 User Two |
| 42 |
Rev 14 2006-04-02 03:00:01 -0500 User Two |
| 43 |
Rev 13 2006-04-02 01:59:59 -0600 User Two |
| 44 |
Rev 12 2005-11-30 17:00:00 -0700 User Four |
| 45 |
Rev 11 2005-10-31 19:00:00 -0500 User Three |
| 46 |
Rev 10 2005-09-30 19:00:00 -0500 User Two |
| 47 |
Rev 9 2005-09-01 00:00:00 +0000 User One |
| 48 |
Rev 8 2005-07-31 18:00:00 -0600 User Four |
| 49 |
Rev 7 2005-06-30 20:00:00 -0400 User Three |
| 50 |
Rev 6 2005-05-31 19:00:00 -0500 User Two |
| 51 |
Rev 5 2005-05-01 00:00:00 +0000 User One |
| 52 |
Rev 4 2005-03-31 17:00:00 -0700 User Four |
| 53 |
Rev 3 2005-02-28 19:00:00 -0500 User Three |
| 54 |
Rev 2 2005-01-31 18:00:00 -0600 User Two |
| 55 |
Rev 1 2005-01-01 00:00:00 +0000 User One |
| 56 |
""" |
| 57 |
|
| 58 |
afp = open(tempfile.mktemp(), "w") |
| 59 |
afp.write(authormap) |
| 60 |
afp.flush() |
| 61 |
cc = testlifter.ConvertComparison(stem="t9604", module="module", |
| 62 |
options="-A %s" % afp.name) |
| 63 |
cc.repo.retain = ("-k" in sys.argv[1:]) |
| 64 |
cc.compare_tree("branch", "master", True) |
| 65 |
cc.command_returns("cd t9604-git >/dev/null; git log --format='%s %ai %an'", corrected) |
| 66 |
os.remove(afp.name) |
| 67 |
afp.close() |
| 68 |
cc.cleanup() |