KeyError exceptions importing from CVS
Frank A. Kingswood
frank at kingswood-consulting.co.uk
Fri Feb 8 14:59:28 CST 2008
Frank Kingswood wrote:
> I'm getting KeyError exceptions importing from CVS:
I've worked when this happens. The CVS repository has files checked in
initially on a branch, so the INITIAL->1.1 is missing from the cvsps output.
Assume you have a CVS directory checked out, then create a file for
which the initial version is on a branch. Here's a script that will
create such a file in your cwd:
# we need a existing branch, so create a file and tag it
echo one >file_one
cvs add file_one
cvs ci -m initial file_one
cvs tag -b branch_name file_one
# now make the branch the default for the working directory
cvs update -f -r branch_name
# add a new file, which will be on the branch
echo hello >file_two
cvs add file_two
cvs ci -m "new file on branch" file_two
The output from cvs log file_two:
RCS file: /tmp/repository/Attic/file_two,v
Working file: file_two
head: 1.1
branch:
locks: strict
access list:
symbolic names:
branch_name: 1.1.0.2
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
----------------------------
revision 1.1
date: 2008/02/08 20:33:32; author: fk; state: dead;
branches: 1.1.2;
file file_two was initially added on branch branch_name.
----------------------------
revision 1.1.2.1
date: 2008/02/08 20:33:32; author: fk; state: Exp; lines: +1 -0
new file on branch
=============================================================================
The output from cvsps -A -u --cvs-direct -q:
---------------------
PatchSet 1
Date: 2008/02/08 20:33:28
Author: fk
Branch: HEAD
Tag: (none)
Log:
initial
Members:
file_one:INITIAL->1.1
---------------------
PatchSet 2
Date: 2008/02/08 20:33:32
Author: fk
Branch: branch_name
Ancestor branch: HEAD
Tag: (none)
Log:
new file on branch
Members:
file_two:1.1->1.1.2.1
When convert/cvs.py tries to add the 1.1->1.1.2.1 patchset it can not
find 1.1 in the filerevids dictionary and fails with a KeyError, as
shown before.
Frank
More information about the Mercurial-devel
mailing list