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 776141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:24:18+00:00 2026-05-14T19:24:18+00:00

I’ve tried all the recommended conversion techniques Mostly they manage to get the latest

  • 0

I’ve tried all the recommended conversion techniques

Mostly they manage to get the latest version of the files right, but every one of them trashes my history. Many (most?) of the tags from my cvs project have at least one file in error when I run “hg up $tag”

My cvs repo is not all that complicated. Why can’t anything convert it?
I’d like to dump cvs and convert to mercurial, but not without history.

To recap my frustration:

I tried hg convert
(tried –branchsort,–timesort, fuzz=0)

I tried cvs2svn and then hg convert.

tailor does not work with recent versions of mercurial

fromcvs disappeared from the face of the earth

hg-cvs-import has been abandoned for 4 years and doesn’t work with recent versions of hg

I have tried using the two most recent versions of mercurial ( 1.5 and 1.5.1 ).

  • 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-05-14T19:24:19+00:00Added an answer on May 14, 2026 at 7:24 pm

    I realize now that there are certain fundamental incompatibilities between cvs tags and hg tags.

    In cvs, a version of a file have tags associated with its different versions.

    In hg, a version is an alias for a changeset . In other words the state of the working files at some snapshot in time

    The distinction is subtle, but important.

    It is possible to make a tagged release in cvs of a version that does not represent a snapshot in time. This is not possible in hg.

    Of course one could apply patches to get replicas. However, this would create a lot of new heads on the repository with arguably little benefit (assuming the cvs repo is still kept around for posterity).

    I’m afraid a perfect conversion from cvs to mercurial is not practical. Ry4an’s solution would work for those who care only about recreating the versions. I am more interested in the history and evolution of the source files.

    I wrote the following script to simply munge all the cvs tags in the $CVSROOT prior to the conversion. e.g tag “v321” becomes “v321_prehg”. That way developers will know those tags are not-authoritative and they must go back to the read-only cvs tree.

    #!/usr/bin/python
    import os
    import sys
    import stat
    
    def die(msg):
        sys.stderr.write(msg)
        sys.exit(1)
    
    cvsroot =os.getenv("CVSROOT")
    if cvsroot is None:
        die("CVSROOT not defined" )
    
    print "CVSROOT=%s" % cvsroot
    
    for rcsfile in os.popen("find %s -name '*,v'" % cvsroot).xreadlines():
        rcsfile = rcsfile.replace('\n','')
        print "rcsfile:%s" % rcsfile
        st=os.stat(rcsfile)
        if  st.st_mode & stat.S_IWUSR == 0:
            os.chmod(rcsfile,st.st_mode | stat.S_IWUSR)
    
        f = open(rcsfile,"r")
        inlines=f.readlines()
        f.close()
    
        outlines=[]
        insymbols=False
        symbolsDone=False
        for l in inlines:
            if insymbols and not symbolsDone:
                if l.find('\t') == 0:#tag line
                    l= l.replace(":","_prehg:",1)
                else:
                    symbolsDone=True
            else:
                if l == "symbols\n":
                    insymbols=True
            outlines.append(l)
    
        f = open(rcsfile,"w")
        f.writelines( outlines )
        f.close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.