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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:57:44+00:00 2026-05-25T17:57:44+00:00

This is a pretty esoteric question, so just to make clear here from the

  • 0

This is a pretty esoteric question, so just to make clear here from the start: I am not talking about converting from svn to git, git to mercurial, or mercurial to git. I am talking about a complex situation that has arisen from taking advantage of “cross-system” plugins that allow Mercurial to interoperate, to some extent, with git and SVN.

For some time I have used the hg-subversion plugin to Mercurial to “track” an upstream SVN repository on code.google.com. Thanks to this plugin, Mercurial considers the repository to be “related” and is able to pull in just changes that have occurred since I last pulled from the repo. This allows me to maintain my own, private Mercurial repository that includes private changesets, branches, tags, etc., but which periodically syncs up and merges with the changes that have been occurring on the upstream SVN repo.

The upstream repo has moved, cleanly, from SVN to git. When I say cleanly, I mean they have taken with them the entire commit tree, or at least the part affecting the default/master branch that I care about.

I am now in a situation where I have a Mercurial repository that is up-to-date merged with the very last checkin on the now-defunct SVN repository, and I want to start pulling in changes from the new upstream git repository, starting at the change that occurred just after the svn repository was moved to github.

I can use the wonderful hg-git plugin to pull changes from this repository, but as the current repository has no notion of being “related” to the git upstream repo, it will pull ALL changes, including all the changes whose mirror-image changesets are already present in my repository.

So what I’m looking for is advice for how I can get my Mercurial repository to consider itself, via hg-git, related to the upstream git repository, and also consider all the appropriate commits from the git repository as “already pulled” for purposes of maintaining changeset parity.

I see that internally hg-git appears to use a file .hg/git-mapfile which I presume maps changesets between the upstream git and the local Mercurial repository. This is probably a clue.

What’s the easiest way to get my local Mercurial repository into such a state where it essentially behaves as though it started as a clone of the upstream git repository, but maintains all of my own unrelated changesets that have been added over time?

(Note: I would prefer not to “start over” with a fresh clone, and then applying my private changes, because I want to maintain the historical integrity of this repository for my own build/debugging purposes).

  • 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-25T17:57:45+00:00Added an answer on May 25, 2026 at 5:57 pm

    I have done something similar with git before. In the git->git case I was able to do a git-merge –strategy=ours which basically made my current repository believe that everything that was being merged in was a no-op.

    What you need to do that is a branch that represents everything upstream that you know is already merged into your tree and then do a no-op style of merge into your tree then start pulling in changes with “real” merges.

    From this site:

    https://www.mercurial-scm.org/wiki/TipsAndTricks#Keep_.22My.22_or_.22Their.22_files_when_doing_a_merge

    I see that a command like the following may be able to help you merge in the upstream repository and ignore everything upstream:

    $ hg --config ui.merge=internal:local merge #keep my files

    That should allow you to re-sync your downstream with upstream.

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

Sidebar

Related Questions

This is pretty simple, I come from a swing/awt background. I'm just wondering what
I'm kind of stuck with this pretty simple (I'm sure) jQuery/Javascript issue. Here's the
I've seen this pretty funny screencast yesterday about some oddities in languages like Ruby
I've googled this question repeatedly, but have not found a great answer anywhere. I'm
I'm starting with WPF and I have this pretty easy question: I have a
I'm pretty new to scala and I am not able to solve this (pretty)
This question exist only because of pure curiosity. Not a homework. Find the fastest
So I'm doing this pretty huge git-push, about 2 GB of data being pushed
This pretty much has me defeated. On XP and earlier versions of Windows you
this pretty much is the thing. When in tinymce I press anything that is

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.