git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [OT] ancestor branch in cvsps is wrong for branch-of-branch
@ 2005-11-01  3:51 Chris Shoemaker
  2005-11-09 22:26 ` [PATCH] CVSps fixed, git-cvsimport still buggy (WAS: [OT] ancestor branch in cvsps is wrong for branch-of-branch) Chris Shoemaker
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Shoemaker @ 2005-11-01  3:51 UTC (permalink / raw)
  To: cvsps, David Mansfield; +Cc: git

[ Maybe the git list is interested in a problem with cvsps? ]

Summary: When creating a patchset for the first modification in a
branch-off-a-branch, cvsps (version 2.1) declares that the ancestor
branch is HEAD.  Presumably this is because the file in the patchset
hadn't been modified since it was on HEAD.  But this means that files
that are *added* to the first branch are never counted as added to the
branch-off-a-branch.

Figure:

-HEAD-(add file 'a')--+-------------------------
                       \
                        \-stable-(add file 'b')-+
                                                 \
                                                  \-dev-(change 'a')-->

In CVS, branch "dev" clearly contains both 'a' and 'b'.  But cvsps
makes it look like this:

                        /-dev-(change 'a') ---->
                       /
-HEAD-(add file 'a')--+-------------------------
                       \
                        \-stable-(add file 'b')---->

So that in the imported git repository, the "dev" branch contains ONLY
'a'.

Below are: a script to reproduce this example, the cvs log output, and
cvsps output.  It's clear from the cvs log that 'b' has the 'dev'
symbolic tag, so it seems like we should be able to recreate 'dev'.

Before I look into fixing this, I wanted to see if there were any
comments from the list.  David?

-chris

#!/bin/sh
dirname=`date +"%Y%m%d%H%M%S"`
mkdir $dirname && cd $dirname

# create the repository
mkdir cvsroot && cd cvsroot
export CVSROOT=`pwd`
cd ..
cvs init

# import an empty project
mkdir project && cd project
cvs import -m "Create initial repo" project yoyo start
cd ..
rmdir project

# checkout the project
cvs co project && cd project

# create a new file on HEAD
echo 1 >a
cvs add a
cvs ci -m "added file a to HEAD" a

# create and switch to "stable" branch
cvs tag -b stable
cvs update -r stable 

# add a new file to stable branch
echo 2 > b
cvs add b
cvs ci -m "added file b to 'stable' branch" b

# create and switch to "dev" branch from "stable"
cvs tag -b dev
cvs update -r dev

# modify file 'a' on "dev" branch
echo "change" >> a
cvs ci -m "changed file a on dev branch" a

# see what CVS thinks the "dev" branch looks like
cd ..
rm -rf project
cvs checkout -r dev project
ls project && echo "Note how b is PRESENT"

# check output of cvsps
cd project
cvs log > ../cvslog
cd ..
cvsps -A --test-log cvslog project > cvsps.out

# check behavior of git-cvsimport
git-cvsimport -i -d $CVSROOT -C project.git project
cd project.git
git-checkout -f dev
ls && echo "Note how b is ABSENT!"
#***********EOF*********************

cvsps output
---------------------
PatchSet 1 
Date: 2005/10/31 22:30:46
Author: chris
Branch: HEAD
Tag: (none) 
Log:
added file a to HEAD

Members: 
	a:INITIAL->1.1 

---------------------
PatchSet 2 
Date: 2005/10/31 22:30:47
Author: chris
Branch: stable
Ancestor branch: HEAD
Tag: (none) 
Log:
added file b to 'stable' branch

Members: 
	b:1.1->1.1.2.1 

---------------------
PatchSet 3 
Date: 2005/10/31 22:30:48
Author: chris
Branch: dev
Ancestor branch: HEAD
Tag: (none) 
Log:
changed file a on dev branch

Members: 
	a:1.1->1.1.4.1 

******************EOF*********
cvs log output
RCS file: /home/chris/import/20051031223046/cvsroot/project/a,v
Working file: a
head: 1.1
branch:
locks: strict
access list:
symbolic names:
	dev: 1.1.0.4
	stable: 1.1.0.2
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
----------------------------
revision 1.1
date: 2005/11/01 03:30:46;  author: chris;  state: Exp;
branches:  1.1.4;
added file a to HEAD
----------------------------
revision 1.1.4.1
date: 2005/11/01 03:30:48;  author: chris;  state: Exp;  lines: +1 -0
changed file a on dev branch
=============================================================================

RCS file: /home/chris/import/20051031223046/cvsroot/project/Attic/b,v
Working file: b
head: 1.1
branch:
locks: strict
access list:
symbolic names:
	dev: 1.1.2.1.0.2
	stable: 1.1.0.2
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
----------------------------
revision 1.1
date: 2005/11/01 03:30:47;  author: chris;  state: dead;
branches:  1.1.2;
file b was initially added on branch stable.
----------------------------
revision 1.1.2.1
date: 2005/11/01 03:30:47;  author: chris;  state: Exp;  lines: +1 -0
added file b to 'stable' branch
=============================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-10  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01  3:51 [OT] ancestor branch in cvsps is wrong for branch-of-branch Chris Shoemaker
2005-11-09 22:26 ` [PATCH] CVSps fixed, git-cvsimport still buggy (WAS: [OT] ancestor branch in cvsps is wrong for branch-of-branch) Chris Shoemaker
2005-11-10  1:41   ` CVSps fixed; git-cvsimport works, too Chris Shoemaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).