[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

cvs2svn: log conversion

From: Dmitry Mikhin <dmitrym_at_acres.com.au>
Date: 2004-02-11 07:05:06 CET

The attached repo illustrates a problem with preserving log messages in
cvs2svn conversion.

The problem: the log is truncated if the file was removed in some revisions,
then restored.

Minor problem (may be not a problem at all): cvs log shows when a file was
initially added on a branch. The message is not available in svn repo upon
conversion.

Procedure:

1. subversion r 8612 trunk, built as RPM on RH9

2. converted a repo (the whole thing, the attachment is an excerpt)

3. checked out cvs and svn versions, trunk only

4. compared logs using the attached script (you may need to adjust paths)

[dmitrym@manjushri svn]$ ./comp.sh
Compare the logs for './src/util/cpl2grd.F' ... failed!
Compare the logs for './src/util/Makefile.am' ... failed!
Compare the logs for './src/util/.cvsignore' ... failed!
Compare the logs for './docs/gcpem3.ps' ... failed!
Compare the logs for './docs/ecua4p.ps' ... failed!
Compare the logs for './docs/Makefile.am' ... failed!
Compare the logs for './docs/peictca.ps' ... failed!
Compare the logs for './docs/.cvsignore' ... failed!
Compare the logs for './docs/gcpem2.ps' ... failed!
Comparison FAILED!
[dmitrym@manjushri svn]$

Note: only the files where conversion failed were included in the test repo.
The actual repository has 510 files in the trunk, so the failure rate is
9/510 ~ 2%.

5. Examining the difference manually:

SVN version:

[dmitrym@manjushri util]$ pwd
/home/dmitrym/tmp/svn-test/r8612/svn/test2/src/util
[dmitrym@manjushri util]$ ls
cpl2grd.F Makefile.am
[dmitrym@manjushri util]$ svn log cpl2grd.F
------------------------------------------------------------------------
r21 | dmitrym | 2003-06-20 17:10:51 +0930 (Fri, 20 Jun 2003) | 2 lines

File restored.

------------------------------------------------------------------------
[dmitrym@manjushri util]$ svn log Makefile.am
------------------------------------------------------------------------
r25 | dmitrym | 2003-07-14 13:43:46 +0930 (Mon, 14 Jul 2003) | 2 lines

Added ram2grd. Link cpl2grd and ram2grd with FLIBS explicitly.

------------------------------------------------------------------------
r20 | dmitrym | 2003-06-20 17:08:51 +0930 (Fri, 20 Jun 2003) | 2 lines

Added converter for RAM's tl.grid.

------------------------------------------------------------------------
r11 | dmitrym | 2003-01-21 19:24:28 +1030 (Tue, 21 Jan 2003) | 2 lines

New-style tests directory.

------------------------------------------------------------------------
[dmitrym@manjushri util]$

CVS version:

[dmitrym@manjushri util]$ pwd
/home/dmitrym/tmp/svn-test/cvs/test2/src/util
[dmitrym@manjushri util]$ ls
cpl2grd.F CVS Makefile.am
[dmitrym@manjushri util]$ cvs log -N -b cpl2grd.F

RCS file: /home/dmitrym/repository/test2/src/util/cpl2grd.F,v
Working file: cpl2grd.F
head: 1.4
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 6; selected revisions: 4
description:
----------------------------
revision 1.4
date: 2003/06/20 07:40:51; author: dmitrym; state: Exp; lines: +2 -2
File restored.
----------------------------
revision 1.3
date: 2003/01/17 05:48:03; author: dmitrym; state: dead; lines: +0 -0
Removed stuff not used in the current version.
----------------------------
revision 1.2
date: 2003/01/15 06:22:58; author: dmitrym; state: Exp; lines: +51 -36
branches: 1.2.6;
Brought in the files from the current OWWE.

WARNING:
This is an inconsistent bundle of files that does not correspond to any
version in particular. It is just a convenient stop-over during the import
of the model into CVS.
----------------------------
revision 1.1
date: 2003/01/15 05:30:30; author: dmitrym; state: Exp;
branches: 1.1.1;
Initial revision
=============================================================================
[dmitrym@manjushri util]$ cvs log -N -b Makefile.am

RCS file: /home/dmitrym/repository/test2/src/util/Makefile.am,v
Working file: Makefile.am
head: 1.5
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 6; selected revisions: 5
description:
----------------------------
revision 1.5
date: 2003/07/14 04:13:46; author: dmitrym; state: Exp; lines: +6 -0
Added ram2grd. Link cpl2grd and ram2grd with FLIBS explicitly.
----------------------------
revision 1.4
date: 2003/06/20 07:38:51; author: dmitrym; state: Exp; lines: +14 -0
Added converter for RAM's tl.grid.
----------------------------
revision 1.3
date: 2003/01/21 08:54:28; author: dmitrym; state: Exp; lines: +4 -46
New-style tests directory.
----------------------------
revision 1.2
date: 2003/01/17 05:48:03; author: dmitrym; state: dead; lines: +0 -0
Removed stuff not used in the current version.
----------------------------
revision 1.1
date: 2003/01/15 06:22:58; author: dmitrym; state: Exp;
branches: 1.1.6;
Brought in the files from the current OWWE.

WARNING:
This is an inconsistent bundle of files that does not correspond to any
version in particular. It is just a convenient stop-over during the import
of the model into CVS.
=============================================================================
[dmitrym@manjushri util]$

Note that the file cpl2grd.F is dead in revision 1.3 and the file
Makefile.am is dead in revision 1.2. Subversion includes the logs only after
the files were resurrected, although it knows about their existence in the
earlier revisions as well:

[dmitrym_at_manjushri svn]$ svn ls -r 3 svn+ssh://manjushri/test2/trunk/src/util
.cvsignore
Makefile.am
cpl2grd.F
[dmitrym_at_manjushri svn]$ svn ls -r 9 svn+ssh://manjushri/test2/trunk/src/util
.cvsignore
Makefile.am
cpl2grd.F
[dmitrym_at_manjushri svn]$ svn ls -r 10 svn+ssh://manjushri/test2/trunk/src/util
svn: URL non-existent in that revision
[dmitrym_at_manjushri svn]$ svn ls -r 12 svn+ssh://manjushri/test2/trunk/src/util
.cvsignore
Makefile.am
[dmitrym_at_manjushri svn]$ svn ls -r 20 svn+ssh://manjushri/test2/trunk/src/util
.cvsignore
Makefile.am
[dmitrym_at_manjushri svn]$ svn ls -r 22 svn+ssh://manjushri/test2/trunk/src/util
.cvsignore
Makefile.am
cpl2grd.F
[dmitrym@manjushri svn]$

The files in the doc directory have the mentioned minor problem. Check for yourself.

Attachments:

A. the comparison script comp.sh

B. the test CVS repo

Dmitry

#!/bin/sh

dir="test2"
svn_path="."
cvs_path="../../cvs"
current=`pwd`

list=`cd ${svn_path}/${dir} && find . -type f | grep -v '.svn'`

counter=0
max_counter=1000
failed="no"
for name in $list
do
  bn=`basename $name`
  log=`echo $name | sed 's/^\.\///;s/\//_/g;s/\./_/g'`
  cvs_log=${current}/${log}.cvs.$$
  svn_log=${current}/${log}.svn.$$
# echo $name $bn $cvs_log $svn_log
  echo -n "Compare the logs for '"${name}"' ..."
  (cd ${svn_path}/${dir} && svn log ${name} | sed -e '/^-----*$/d;/^r.* lines$/,/^$/d;/^$/d' > $svn_log)
  (cd ${cvs_path}/${dir} && cvs log -N -b ${name} | sed -n '/^description:$/,$p' | sed '/^description:$/d;/^----*$/d;/^revision [0-9]/d;/^date: [0-9].*author.*/d;/^branches: [0-9]/d;/^====*$/d;/^$/d' > $cvs_log)
  diff $cvs_log $svn_log > /dev/null 2>&1 && {
    echo " OK"
    rm -f $cvs_log $svn_log
  } || {
    echo " failed!"
    failed="yes"
  }
  counter=`expr $counter \+ 1`
  test $counter -gt $max_counter && break
done

test "x$failed" = "xyes" && {
  echo "Comparison FAILED!"
} || {
  echo "Comparison succeeded!"
}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Wed Feb 11 21:27:08 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.