HomeSoftware Heritage

fix expansion of multiple RCS keywords on a line via rsync

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

fix expansion of multiple RCS keywords on a line via rsync

The function RcsKeywords.expand_keyword() is used to expand keywords
when fetching an origin over rsync. This function failed to process
multiple keywords on a single line, even though the existing code
already keeps looping in an attempt to expand multiple keywords.

For example, consider this line from a file in the ccvs CVS repository:

#ident	"@(#)cvs/contrib/pcl-cvs:$Name:  $Id$"

Here, a regular CVS server expands both keywords on this line.

The Name keyword is special; It expands only if an explicit tag name was
given on the CVS command line. This keyword always expands to an empty
string for now, until perhaps one day the CVS loader learns about tags.

Our regular expression which attempts to match keywords on a line splits
the above example into two match groups:

1: #ident	"@(#)cvs/contrib/pcl-cvs:$Name:  $
2: Id$

The Name keyword was then expanded as expected, but the Id keyword was missed.
To fix this, attempt another match starting from the terminating character of
the previous match, such that we match the following two strings:

1: #ident	"@(#)cvs/contrib/pcl-cvs:$Name:  $
2: $Id$

Now our CVS loader expands both keywords like the CVS server does.
Add new test data to confirm that this works as intended.

Details

Provenance
stspAuthored on Nov 24 2021, 12:13 PM
stspPushed on Dec 4 2021, 5:29 PM
Differential Revision
D6708: fix expansion of multiple RCS keywords on a line via rsync
Tasks
T3691: Implement CVS loader
Build Status
Buildable 25366
Build 39648: test-and-buildJenkins console · Jenkins

Commit No Longer Exists

This commit no longer exists in the repository.