Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:29:46+00:00 2026-06-05T02:29:46+00:00

In preparation for a migration to Mercurial, I would like to make some systematic

  • 0

In preparation for a migration to Mercurial, I would like to make some systematic changes to many thousands of ,v files. (I’ll be editing copies of the originals, I hasten to add.)

Examples of the sorts of changes I’m after:

  1. For each revision whose message begins with some text that indicates a known username (e.g. [Fred Bloggs]), if the username in the comment matches the Author in the ,v file, then delete the unnecessary username text from the commit message
  2. If the ,v contains a useful description, append it to the commit message for revision 1.1 (cvs2hg ignores the description – but lots of our CVS files actually came from RCS, where it was easy to put the initial commit message into the description field by mistake)
  3. For edits made from certain shared user accounts, adjust the author, depending on the contents of the commit message.

Things I’ve considered:

  1. Running ‘cvs log’ on each individual ,v file – parsing the output, and using rcs -m to change this history. Problems with this include:
    • there doesn’t seem to be a way to pass a text file to rcs -m – so if the revision message contained singled and/or or double quotes, or spanned multiple lines, it would be quite a challenge quoting it correctly in the script
    • I can’t see an rcs or cvs facility to change the author name associated with a revision
    • less importantly, it would be likely to start a huge number of processes – which I think could get slow
  2. Writing Python to parse the ,v file, and adjust the contents. Problems with this include:
    • we have a mixture of line-endings in our ,v files – including some binary files that should have been text, and vice-versa – so great care would be needed to not corrupt the files
    • care would be needed for quoting of the @ character in any commit messages, if it fell on the start of the line in a multi-line comment
    • care would also be needed on revisions where the last line of the committed file was changed, and doesn’t have a newline – meaning that the ,v has a @ at the very end of a line, instead of being preceded by \n
  3. Clone the version of cvs2hg that we are using, and try to adjust its code to make the desired edits in-place

Are there any other approaches that would be less work, or any existing code that implements this kind of functionality?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:29:47+00:00Added an answer on June 5, 2026 at 2:29 am

    Your first approach may be the best one. I know that in Perl, handling quotation marks and multiple lines wouldn’t be a problem. For example:

    my $revision = ...;
    my $log_message = ...;
    system('rcs', "-m$revision:$log_message", $filename);
    

    where $log_message can contain any arbitrary text. Since the string doesn’t go through the shell, newlines and other metacharacters won’t be reinterpreted. I’m sure you can do the same thing in Python.

    (As for your second approach, I wouldn’t expect line endings to be a problem. If you have Unix-style \n endings and Windows-style \r\n endings, you can just treat the trailing \r as part of the line, and everything should stay consistent. I’m making some assumptions here about the layout of ,v files.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an project in NetBeans. I made some preparations to make database migration
I am writing some android code in preparation for a graphics intensive app I
I'm working through some android tutorials right now in preparation for a two week
In preparation for the upcoming Google Code Jam, I've started working on some problems.
I'm doing some simple tests (in preparation for a larger project) to call an
I'm doing some past exam papers in preparation for a forthcoming exam, and have
In preparation of a future application design, I've started some investigations on CQRS-style applications
I'm working on some test preparation material and stuck on this problem. Show a
I have been doing some reading in preparation for starting my first WCF project
I'm trying to convert a Mercurial repository to move all the files into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.