#19 Docinfo fields with CVS keywords

closed-fixed
None
5
2004-03-30
2004-03-30
No

I think there's a bug here, but others may disagree.

If a document has a docinfo with the field:

:Version: $Revision: 1.1 $

the parser rips out the cruft around the actual
revision number and leaves just "1.1" as the field
value. However, if anything else exists on the line,
such as:

:Version: $Revision: 1.1 $ (de la versión en Inglés
1.18)

the RCS/CVS cruft isn't ripped out, leaving the value
unchanged. I think the RCS/CVS cruft should be handled
in either case, so the field value is the string "1.1
(de la versión en Inglés 1.18)". This is probably an
unusual example, but I think it's important, since this
is how I've recommended that versioning be handled for
translations on python.org. ;-)

This particular example is taken from the Spanish
translation of the Python FAQ:

http://www.python.org/doc/faq/es/general.ht

Discussion

  • Fred L. Drake, Jr.

    Patch to allow more flexible recognition of RCS/CVS keywords

     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    I've attached a patch for this that allows additional text
    around the RCS/CVS $keywords$. The test has been modified
    to test the additional behavior.

    The patch also makes the test not be fragile when the CVS
    sandbox was created using the -kk option, which impacts
    expansion of the $keywords$. The test now always uses data
    with the keywords expanded, as expected.

    I'll give this a day or so to allow objections to the
    behavioral change to surface before committing.

     
  • David Goodger

    David Goodger - 2004-03-30

    Logged In: YES
    user_id=7733

    The patch looks good to me! The only thing left is the
    reStructuredText spec; I'll check in that change.

     
  • Fred L. Drake, Jr.

    • status: open --> closed-fixed
     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    Sounds like a few days went past quickly!

    Committed as:

    docutils/utils.py 1.30
    docutils/transforms/frontmatter.py 1.15
    test/test_transforms/test_docinfo.py 1.9

     

Log in to post a comment.