Browse Source
CVS patchsets are imported with timestamps having an offset of +0000 (UTC). The cvs-authors file is already used to translate the CVS username to full name and email in the corresponding commit. Extend this file to support an optional timezone for calculating a user- specific timestamp offset. Signed-off-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
Chris Rorvick
12 years ago
committed by
Junio C Hamano
6 changed files with 361 additions and 7 deletions
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
#!/bin/sh |
||||
|
||||
test_description='git cvsimport timestamps' |
||||
. ./lib-cvs.sh |
||||
|
||||
setup_cvs_test_repository t9604 |
||||
|
||||
test_expect_success 'check timestamps are UTC (TZ=CST6CDT)' ' |
||||
|
||||
TZ=CST6CDT git cvsimport -p"-x" -C module-1 module && |
||||
git cvsimport -p"-x" -C module-1 module && |
||||
( |
||||
cd module-1 && |
||||
git log --format="%s %ai" |
||||
) >actual-1 && |
||||
cat >expect-1 <<-EOF && |
||||
Rev 16 2006-10-29 07:00:01 +0000 |
||||
Rev 15 2006-10-29 06:59:59 +0000 |
||||
Rev 14 2006-04-02 08:00:01 +0000 |
||||
Rev 13 2006-04-02 07:59:59 +0000 |
||||
Rev 12 2005-12-01 00:00:00 +0000 |
||||
Rev 11 2005-11-01 00:00:00 +0000 |
||||
Rev 10 2005-10-01 00:00:00 +0000 |
||||
Rev 9 2005-09-01 00:00:00 +0000 |
||||
Rev 8 2005-08-01 00:00:00 +0000 |
||||
Rev 7 2005-07-01 00:00:00 +0000 |
||||
Rev 6 2005-06-01 00:00:00 +0000 |
||||
Rev 5 2005-05-01 00:00:00 +0000 |
||||
Rev 4 2005-04-01 00:00:00 +0000 |
||||
Rev 3 2005-03-01 00:00:00 +0000 |
||||
Rev 2 2005-02-01 00:00:00 +0000 |
||||
Rev 1 2005-01-01 00:00:00 +0000 |
||||
EOF |
||||
test_cmp actual-1 expect-1 |
||||
' |
||||
|
||||
test_expect_success 'check timestamps with author-specific timezones' ' |
||||
|
||||
cat >cvs-authors <<-EOF && |
||||
user1=User One <user1@domain.org> |
||||
user2=User Two <user2@domain.org> CST6CDT |
||||
user3=User Three <user3@domain.org> EST5EDT |
||||
user4=User Four <user4@domain.org> MST7MDT |
||||
EOF |
||||
git cvsimport -p"-x" -A cvs-authors -C module-2 module && |
||||
( |
||||
cd module-2 && |
||||
git log --format="%s %ai %an" |
||||
) >actual-2 && |
||||
cat >expect-2 <<-EOF && |
||||
Rev 16 2006-10-29 01:00:01 -0600 User Two |
||||
Rev 15 2006-10-29 01:59:59 -0500 User Two |
||||
Rev 14 2006-04-02 03:00:01 -0500 User Two |
||||
Rev 13 2006-04-02 01:59:59 -0600 User Two |
||||
Rev 12 2005-11-30 17:00:00 -0700 User Four |
||||
Rev 11 2005-10-31 19:00:00 -0500 User Three |
||||
Rev 10 2005-09-30 19:00:00 -0500 User Two |
||||
Rev 9 2005-09-01 00:00:00 +0000 User One |
||||
Rev 8 2005-07-31 18:00:00 -0600 User Four |
||||
Rev 7 2005-06-30 20:00:00 -0400 User Three |
||||
Rev 6 2005-05-31 19:00:00 -0500 User Two |
||||
Rev 5 2005-05-01 00:00:00 +0000 User One |
||||
Rev 4 2005-03-31 17:00:00 -0700 User Four |
||||
Rev 3 2005-02-28 19:00:00 -0500 User Three |
||||
Rev 2 2005-01-31 18:00:00 -0600 User Two |
||||
Rev 1 2005-01-01 00:00:00 +0000 User One |
||||
EOF |
||||
test_cmp actual-2 expect-2 |
||||
' |
||||
|
||||
test_done |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
* -whitespace |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
history |
||||
val-tags |
@ -0,0 +1,264 @@
@@ -0,0 +1,264 @@
|
||||
head 1.16; |
||||
access; |
||||
symbols; |
||||
locks; strict; |
||||
comment @# @; |
||||
|
||||
|
||||
1.16 |
||||
date 2006.10.29.07.00.01; author user2; state Exp; |
||||
branches; |
||||
next 1.15; |
||||
|
||||
1.15 |
||||
date 2006.10.29.06.59.59; author user2; state Exp; |
||||
branches; |
||||
next 1.14; |
||||
|
||||
1.14 |
||||
date 2006.04.02.08.00.01; author user2; state Exp; |
||||
branches; |
||||
next 1.13; |
||||
|
||||
1.13 |
||||
date 2006.04.02.07.59.59; author user2; state Exp; |
||||
branches; |
||||
next 1.12; |
||||
|
||||
1.12 |
||||
date 2005.12.01.00.00.00; author user4; state Exp; |
||||
branches; |
||||
next 1.11; |
||||
|
||||
1.11 |
||||
date 2005.11.01.00.00.00; author user3; state Exp; |
||||
branches; |
||||
next 1.10; |
||||
|
||||
1.10 |
||||
date 2005.10.01.00.00.00; author user2; state Exp; |
||||
branches; |
||||
next 1.9; |
||||
|
||||
1.9 |
||||
date 2005.09.01.00.00.00; author user1; state Exp; |
||||
branches; |
||||
next 1.8; |
||||
|
||||
1.8 |
||||
date 2005.08.01.00.00.00; author user4; state Exp; |
||||
branches; |
||||
next 1.7; |
||||
|
||||
1.7 |
||||
date 2005.07.01.00.00.00; author user3; state Exp; |
||||
branches; |
||||
next 1.6; |
||||
|
||||
1.6 |
||||
date 2005.06.01.00.00.00; author user2; state Exp; |
||||
branches; |
||||
next 1.5; |
||||
|
||||
1.5 |
||||
date 2005.05.01.00.00.00; author user1; state Exp; |
||||
branches; |
||||
next 1.4; |
||||
|
||||
1.4 |
||||
date 2005.04.01.00.00.00; author user4; state Exp; |
||||
branches; |
||||
next 1.3; |
||||
|
||||
1.3 |
||||
date 2005.03.01.00.00.00; author user3; state Exp; |
||||
branches; |
||||
next 1.2; |
||||
|
||||
1.2 |
||||
date 2005.02.01.00.00.00; author user2; state Exp; |
||||
branches; |
||||
next 1.1; |
||||
|
||||
1.1 |
||||
date 2005.01.01.00.00.00; author user1; state Exp; |
||||
branches; |
||||
next ; |
||||
|
||||
|
||||
desc |
||||
@@ |
||||
|
||||
|
||||
1.16 |
||||
log |
||||
@Rev 16 |
||||
@ |
||||
text |
||||
@Rev 16 |
||||
@ |
||||
|
||||
|
||||
1.15 |
||||
log |
||||
@Rev 15 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 15 |
||||
@ |
||||
|
||||
|
||||
1.14 |
||||
log |
||||
@Rev 14 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 14 |
||||
@ |
||||
|
||||
|
||||
1.13 |
||||
log |
||||
@Rev 13 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 13 |
||||
@ |
||||
|
||||
|
||||
1.12 |
||||
log |
||||
@Rev 12 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 12 |
||||
@ |
||||
|
||||
|
||||
1.11 |
||||
log |
||||
@Rev 11 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 11 |
||||
@ |
||||
|
||||
|
||||
1.10 |
||||
log |
||||
@Rev 10 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 10 |
||||
@ |
||||
|
||||
|
||||
1.9 |
||||
log |
||||
@Rev 9 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 9 |
||||
@ |
||||
|
||||
|
||||
1.8 |
||||
log |
||||
@Rev 8 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 8 |
||||
@ |
||||
|
||||
|
||||
1.7 |
||||
log |
||||
@Rev 7 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 7 |
||||
@ |
||||
|
||||
|
||||
1.6 |
||||
log |
||||
@Rev 6 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 6 |
||||
@ |
||||
|
||||
|
||||
1.5 |
||||
log |
||||
@Rev 5 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 5 |
||||
@ |
||||
|
||||
|
||||
1.4 |
||||
log |
||||
@Rev 4 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 4 |
||||
@ |
||||
|
||||
|
||||
1.3 |
||||
log |
||||
@Rev 3 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 3 |
||||
@ |
||||
|
||||
|
||||
1.2 |
||||
log |
||||
@Rev 2 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 2 |
||||
@ |
||||
|
||||
|
||||
1.1 |
||||
log |
||||
@Rev 1 |
||||
@ |
||||
text |
||||
@d1 1 |
||||
a1 1 |
||||
Rev 1 |
||||
@ |
Loading…
Reference in new issue