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

  • Home
  • SEARCH
  • 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 3965376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:27:18+00:00 2026-05-20T03:27:18+00:00

I’m converting a big (with about 9000 changesets) Subversion repository to Mercurial. It is

  • 0

I’m converting a big (with about 9000 changesets) Subversion repository to Mercurial. It is coupled with Trac issue tracking system, so the commit logs have many cross-references to other revision IDs as well as ticket numbers.

I’m trying hgsubversion and convert extension. Both seems to work well with our repository, but the revision IDs referred in commit logs are not converted.

(The Trac part is rather simple — we can just scan the database and convert all occurrences of revision ID reference.)

So, I modified the source code of convert extension like this:

(mercurial_sink class in hg.py)

def _rewritedesc(self, desc, source, revmap):
    # Only for subversion source.
    # We assume that no future revision is mentioned in commit logs.
    rx_revision = re.compile(r'(r(\d+)|\[(\d+)\])') # it's actually defined in module header.
    def replacer(m):
        if m is None:
            return m.group(0)
        new_revid = revmap.get(source.source.revid(m.group(2) or m.group(3)))
        print 'converting commit log : %s -> [%s]' % (m.group(0), new_revid)
        if new_revid is None:
            return m.group(0)
        return '[%s]' % new_revid[:12]
    return rx_revision.sub(replacer, desc)

def putcommit(self, files, copies, parents, commit, source, revmap):
    ...
    text = self._rewritedesc(commit.desc, source, revmap)
    ...

It seems to work, but the problem is that conversion process does not scan changesets in which order they are committed. There are many missing conversion results.

Actually, convert extension provides several sorting options including “sourcesort” which processes the changesets in the commit order, but it’s supported only for mercurial sources. “datesort” seems to work better in this way than “branchsort”, but not as good as I want.

I surveyed whether I can modify commit logs after conversion process is complete (at that time, we have a complete revision ID map generated by the extension), but it’s impossible–there are known hacks using mq and histedit extension but they changes the reivision ID.

Is there any folk who tried to do this or help me?

  • 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-20T03:27:19+00:00Added an answer on May 20, 2026 at 3:27 am

    How about doing a two-step conversion? First convert the repository to Mercurial from SVN. Then run the convert extension again on your new Hg repository to convert all the descriptions? You should be able to use sourcesort then.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.